![]() |
|
#1
|
|||
|
|||
Running perl/cgi scripts on Apache serverI am trying to run a cgi/perl script from a specific folder on an Apache server (from the 'cgi-bin' subdirectory in my main user directory: the script alias is already specified in the httpd.conf file) BUT I keep getting a "The page cannot be found" error. I am trying to run the script from an HTML form inside a subdirectory: I use a form with "<FORM ACTION="../cgi-bin/testmike.pl" METHOD="GET">", so it should go up one dir to the main dir, then go into the 'cgi-bin' dir to run the 'testmike.pl' file. BUT I keep getting the not found error. I've set the correct permissions on the directory and file but it still doesn't find it. IF I change the dir name to 'cgibin' and point there, then it finds the file, but doesn't run it, only displays it. It's as if the alias is making it think the dir is actually somewhere else. what should I put in the ACTION parameter for it to actually find the script?
thx, |
|
#2
|
||||
|
||||
|
Hi Mikenowo (or is it just Mike?).
Welcome to the forums. Here are mabye some things to check for. I found it easier not to give any type of path when running cgi, as apache is configured to look for you cgi scripts by default under the cgi-bin directory. I usually make a call in this manner: HTML Code:
BTW: that is a compiled c program, so there is no need in my case for .pl Now, about permissions. Just make sure that your permissions are set properly. By default apache runs as a guest, so your permissions have to allow access by everyone. (This assumes a *nix install) I would set my cgi-bin directory ownership to root, but access and reabable to everyone: Code:
Now, your script has to be at least executable and readable by everyone as well, so in my case, I would set: Code:
If this still doesn't work, please post back. There are other people that are way more experienced with this than I that should be able to help... Last edited by Allowee : 05-Feb-2004 at 07:40.
|
|
#3
|
||||
|
||||
|
404 Not Found errors are logged in your error log.
you can check your error log to see the full paths to the file. and then you might be able to find and fix the problem |
|
#4
|
|||
|
|||
|
Quote:
Thanks for the welcome Ok, the problem here is, it is not my site, it's a providers' (therefore I don't have access to system files etc). What I'm trying to do is let them know what to set through an email conversation which is tedious at best. In any event, what I want is to be able to run the script from within my OWN cgi-bin directory (not the main default one that Apache usually has, this because I don't have access to that default dir). The ISP has informed me that they do have an entry in the httpd.conf file that also points the script path to a cgi-bin directory within MY main dir, but I can't seem to get my form to recognize where it is. I tried using just the script name without specifying the cgi-bin dir in the form line "<FORM METHOD=POST ACTION="script_name">" as you suggested, but it still doesn't find it. As for my permissions, I have both the directory and the script set to 755, so that shouldn't be the problem... ... <dancing banana interlude > ...Ok, we're back... I've set up my own apache server before and have gotten this to work, just been a while so it's not fresh in my mind. I'm pretty sure the alias they set in the conf file is adding some sort of prefix to the directory path, it's just a matter of getting it right for my form statement. Never easy to solve a problem when you don't have access to the resources <g>. Thx for the suggestion, I'll just have to plug along until I solve this. |
|
#5
|
||||
|
||||
|
Mike,
Sorry, I couldn't be of more help. It definitely sounds like your problem is with your provider. All of my exp. has to do with on-site servers. If you do find anything groundbreaking, please post back and let others know. Thanks. |
|
#6
|
|||
|
|||
|
Quote:
I've attempted the same thing on my own apache server and get the same error, BUT I don't see any entry in the "/var/log/httpd/error_log" error log? Is there another log file you are talking about? |
|
#7
|
||||
|
||||
|
it could be that the error log is located somewhere else.
you will have to take a look at httpd.conf and search for 'ErrorLog' and 'LogLevel': `egrep -i '(ErrorLog)|(LogLevel)' /your/path/httpd.conf` if LogLevel is 'warn' it should log 404 errors |
|
#8
|
|||
|
|||
|
Quote:
Well, I checked the httpd.conf file and the error log file is in the default dir "etc/httpd/conf/" and the LogLevel *is* 'warn', BUT when I try to submit the program and get the '404' error, nothing gets logged to that file Here is the error page I get: *** The page cannot be found The page you are looking for might have been removed, had its name changed, or is temporarily unavailable. ------ Please try the following: If you typed the page address in the Address bar, make sure that it is spelled correctly. Open the 65.94.96.220 home page, and then look for links to the information you want. Click the Back button to try another link. Click Search to look for information on the Internet. HTTP 404 - File not found Internet Explorer *** |
Recent GIDBlog
Toyota - 2008 September Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| apache php no longer working (MX??) XP?? | ChicoMendez | Apache Web Server Forum | 5 | 30-Aug-2004 10:51 |
| · Windows 2003 Server Reseller Special: Unlimited Domains/2 GB Space/for $19.99 | contactsonia | Web Hosting Advertisements & Offers | 0 | 09-Jan-2004 05:46 |
| Help making Apache to WAP server ! | Lazmo | Apache Web Server Forum | 1 | 02-Jan-2004 12:27 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The