Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
getting cgi-bin directory to work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
proone
n00b
n00b


Joined: 17 Jan 2006
Posts: 4

PostPosted: Tue Jan 17, 2006 4:45 am    Post subject: getting cgi-bin directory to work Reply with quote

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
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Tue Jan 17, 2006 11:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Kloeri
Retired Dev
Retired Dev


Joined: 02 Sep 2002
Posts: 144

PostPosted: Tue Jan 17, 2006 11:41 am    Post subject: Reply with quote

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
View user's profile Send private message
proone
n00b
n00b


Joined: 17 Jan 2006
Posts: 4

PostPosted: Tue Jan 17, 2006 2:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
d11wtq
Apprentice
Apprentice


Joined: 14 Jul 2005
Posts: 192
Location: Manchester, UK

PostPosted: Tue Jan 17, 2006 4:34 pm    Post subject: Reply with quote

Are you positive the file has execute permissions to the apache user?
Back to top
View user's profile Send private message
proone
n00b
n00b


Joined: 17 Jan 2006
Posts: 4

PostPosted: Tue Jan 17, 2006 4:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
Kloeri
Retired Dev
Retired Dev


Joined: 02 Sep 2002
Posts: 144

PostPosted: Tue Jan 17, 2006 5:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
Janis
n00b
n00b


Joined: 05 May 2003
Posts: 9
Location: New York

PostPosted: Tue Jan 17, 2006 6:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
proone
n00b
n00b


Joined: 17 Jan 2006
Posts: 4

PostPosted: Thu Jan 19, 2006 4:02 am    Post subject: Reply with quote

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
View user's profile Send private message
Janis
n00b
n00b


Joined: 05 May 2003
Posts: 9
Location: New York

PostPosted: Thu Jan 19, 2006 8:32 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum