cgi scripts not working on the httpd server
I have an ARM linux board with 2.6.34 Linux on it with Busybox v1.15.0
I start the httpd server with the following parameters: httpd -p 80 -h /root/www. The html pages work. Then there is /root/www/cgi-bin folder, where I put my cgi scipt. If I try to load the script with "192.168.X.X/cgi-bin/my-cgi-scipt I get "404 page not found". I set permissions for the script and the cgi-bin to 777. I also tried to make my own config file "httpd.conf" and put in into /etc/ with the following content: Code:
H:/root/www So the question is - how do I enable cgi on httpd ? |
Bump.
I cant believe noone uses httpd server and / or CGI. Need urgent help with this. |
Urgent for you isn't necessarily urgent for us.
Have you tried following the example instructions which I found with a 10 second google search: http://wiki.openwrt.org/doc/howto/http.httpd |
Quote:
httpd works without a configuration file. Default is /etc/httpd.conf I tried with and without a config. I already posted earlier what I had in the config. Checked. httpd expects it's CGI script files to be in the subdirectory cgi-bin under main web directory set by options -h (default is /www, so /www/cgi-bin). I also have the root of the webserve at /wwww and the cgi subdirectory at /www/cgi-bin. Checked. The CGI script files must also have permission to be executed (min mode 700). I set the permission for the whole www folder to 777. Checked. So then in the folder /www/cgi-bin I have a file called testcgi with the following content: Code:
#!/bin/sh Code:
404 Not Found The article you gave doesnt say how to activate cgi which implies the cgi is working by default by running the httpd server. You signature says you are a RHCT and have 15 y of experience with linux. I am sure this problem should be trivial for you. |
Quote:
|
Check your cgi module installed
#httpd -M Checked whether you had loaded cgi module in your httpd.conf file LoadModule cgi_module modules/mod_cgi.so Look after the article http://httpd.apache.org/docs/2.2/howto/cgi.html |
Quote:
|
So this is all weird. If I use the following https.conf:
Code:
H:/root/www If I use Code:
H:/root/www Code:
H:/root/www For the config I looked here: http://wiki.chumby.com/index.php/Usi...ox_HTTP_server. The "/root/www/cgi-bin:foo:bar" should be a valid config command. |
Another weird thing is that I cant run my cgi script from the console. If I navigate to /root/www/cgi-bin/ and list all files I see the "testcgi" file. If I try to execute this file with "./testcgi" I get "file not found" in the console. :confused:
Whats going on oO |
Ok, I'd assumed you'd checked that your script would run in the console. First thing to check in this case is that it does have permissions that allow execution, 755 or 777 and that the #! line is the very first line of the file, and that there is indeed an executable shell by running /bin/sh
|
Quote:
Code:
#!/bin/sh |
Quote:
|
"which sh" gives me "/bin/sh" so it was right. And I dont understand why I cant run the script via "./testcgi" getting "not found".
If I remove #!/bin/sh line I get execute the script with "./testcgi" but the web servers still doesnt find the file saying "404 page not found". |
I'm stumped then, suggest you raise this on a Busybox forum?
|
Quote:
|
All times are GMT -5. The time now is 10:03 PM. |