View previous topic :: View next topic |
Author |
Message |
proone n00b
Joined: 17 Jan 2006 Posts: 4
|
Posted: Tue Jan 17, 2006 4:45 am Post subject: getting cgi-bin directory to work |
|
|
I have a fresh install of gentoo with apache. The webserver works but the CGI-bin does not. I don't know what to do next. I've googled everything I can think to google and checked everything I can think to check in httpd.conf. I may have changed too many things...
I would be very appreciative if someone could tell me what to do or look at my httpd.conf file.
Thanks in advance!!!
Here is my httpd file:
http://24.220.249.33/httpd.conf.doc _________________ Linux Newbie, please be patient with me |
|
Back to top |
|
|
magic919 Advocate
Joined: 17 Jun 2005 Posts: 2182 Location: Berkshire, UK
|
Posted: Tue Jan 17, 2006 11:07 am Post subject: |
|
|
What errors do you get
1. In the browser?
2. In your Apache logs?
These will generally point you to what is going wrong.
You might wish to leave the config file as plain text as many won't open a .doc off the 'Net. |
|
Back to top |
|
|
Kloeri Retired Dev
Joined: 02 Sep 2002 Posts: 144
|
Posted: Tue Jan 17, 2006 11:41 am Post subject: |
|
|
You need to enable Options ExecCGI before CGIs are allowed. You can enable ExecCGI on a per-directory level in .htaccess or alternatively in vhost or global configuration. If enabling it using .htaccess files you need AllowOverride Options in your configuration. |
|
Back to top |
|
|
proone n00b
Joined: 17 Jan 2006 Posts: 4
|
Posted: Tue Jan 17, 2006 2:56 pm Post subject: |
|
|
Thanks for your replies! It is a txt file, I changed it to doc so notepad doesn't automatically open it and not wrap the lines (making it look a mess). No errors in apache log or in my browser, I'm trying to get bestdamlogger to work. I've gotten it to work on my paid hosting accounts so I think I know what I'm doing as far as that goes.
I went through that whole httpd.conf file and enabled everything I thought had to do with cgi...???
# Enable this additional section if you would like to make use of a
# suexec-enabled cgi-bin directory on a per-user basis.
#
<Directory /usr/htdocs/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>
#
# "/var/www/localhost/cgi-bin/" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/usr/htdocs/cgi-bin/">
AllowOverride None
AddHandler cgi-script .cgi
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Do these lines mean options execcgi is not enabled?? _________________ Linux Newbie, please be patient with me |
|
Back to top |
|
|
d11wtq Apprentice
Joined: 14 Jul 2005 Posts: 192 Location: Manchester, UK
|
Posted: Tue Jan 17, 2006 4:34 pm Post subject: |
|
|
Are you positive the file has execute permissions to the apache user? |
|
Back to top |
|
|
proone n00b
Joined: 17 Jan 2006 Posts: 4
|
Posted: Tue Jan 17, 2006 4:47 pm Post subject: |
|
|
you mean CHMOD? I believeso. Are you saying my apache is configured correctly? If so, then maybe I need to go to a bestdamlogger forum or something... _________________ Linux Newbie, please be patient with me |
|
Back to top |
|
|
Kloeri Retired Dev
Joined: 02 Sep 2002 Posts: 144
|
Posted: Tue Jan 17, 2006 5:58 pm Post subject: |
|
|
proone wrote: | # Enable this additional section if you would like to make use of a
# suexec-enabled cgi-bin directory on a per-user basis.
#
<Directory /usr/htdocs/cgi-bin>
Options ExecCGI
SetHandler cgi-script
</Directory>
<snip>
Do these lines mean options execcgi is not enabled?? |
That means ExecCGI is enabled for the path in <Directory> and below. The best thing to do would be to add Options ExecCGI to your vhost configuration - /etc/apache2/vhosts.d/00_default_vhost.conf or your own vhost configuration file if you have one. |
|
Back to top |
|
|
Janis n00b
Joined: 05 May 2003 Posts: 9 Location: New York
|
Posted: Tue Jan 17, 2006 6:58 pm Post subject: |
|
|
No, letting your cgi script run.. where is that located? hopefully it is in your cgi directory..
Your conf file looks ok.. |
|
Back to top |
|
|
proone n00b
Joined: 17 Jan 2006 Posts: 4
|
Posted: Thu Jan 19, 2006 4:02 am Post subject: |
|
|
I am extremely thankful for your help everyone! I've done everything you've instructed and still no luck When I'm on my page and hit view source, I see:
<!--#exec cgi="/cgi-bin/bdlogger/bdlogger.pl" --></div>
<!--#exec cgi="/cgi-bin/bdlogger/bdlogger.cgi" --></div>
So my server isn't executing the code.
http://24.220.249.33/permiss.jpg
The cgi-bin folder I created myself and set the permissions for, does this matter?
Thanks again everyone! _________________ Linux Newbie, please be patient with me |
|
Back to top |
|
|
Janis n00b
Joined: 05 May 2003 Posts: 9 Location: New York
|
Posted: Thu Jan 19, 2006 8:32 pm Post subject: |
|
|
Over here, the cgi directory and it's contents are owned by root but allow "everyone" read access and certain files allow exe access for "everyone":
filegate janis # dir /var/www/localhost/cgi-bin/ -ltr
total 649
-rw-r--r-- 1 root root 741 Oct 31 2003 oops.htm
-rw-r--r-- 1 root root 79 Oct 31 2003 mymessage.thx
-rwxr-xr-x 1 root root 15550 Oct 31 2003 joinform.cgi
-rwxr-xr-x 1 root root 29203 Mar 13 2004 FormMail.pl
-rwxr-xr-x 1 root root 547552 Feb 25 2005 htsearch
-rw-r--r-- 1 root root 757 Mar 17 2005 test-cgi
-rw-r--r-- 1 root root 274 Mar 17 2005 printenv
i.e., the owner can read-write-execute, group can
read-execute, and others can read-execute depending on the file.
That way when a web user wants to fill out our fidonet application (joinform.cgi) it's ok.
Take a look at http://www.filegate.net/zonew1/how-to-join.html .. there's a link for the cgi form down on the bottom of that page.
I couldn't see how you have any permissions set up on the files in your cgi directory so........ |
|
Back to top |
|
|
|