Fedora Linux Support Community & Resources Center
  #1  
Old 10th April 2004, 01:33 AM
Eli Offline
Registered User
 
Join Date: Feb 2004
Location: Winston-Salem, NC
Age: 37
Posts: 49
httpd & CGI

I installed apache, and have a problem with getting my CGI scripts to work. Every time I try to access them, I get "Internal Server Error."
I saved them in /var/www/cgi-bin, which is where you are supposed to save them, but they still will not work. Mayday, mayday.

PERL does work though. I can execute my code, so that is not the issue, it is just a matter of turning CGI "on," I guess.
Reply With Quote
  #2  
Old 10th April 2004, 01:43 AM
Eli Offline
Registered User
 
Join Date: Feb 2004
Location: Winston-Salem, NC
Age: 37
Posts: 49
It was simply a matter of permissions. I had not chmod my script.
Reply With Quote
  #3  
Old 10th April 2004, 08:53 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 27
Posts: 7,909
Access Denied errors also occur from messed up permissions.

The apache user needs to be able to read files under the web root, and execute scripts.
Reply With Quote
  #4  
Old 11th April 2004, 07:11 AM
Eli Offline
Registered User
 
Join Date: Feb 2004
Location: Winston-Salem, NC
Age: 37
Posts: 49
I have another problem. I am trying to give my regular user, bob, permission to execute his own CGI scripts and I have changed the default 'public_html' directory to 'html.' I am having no luck at pulling up bob's directory @ http://localhost/~bob/html/index.html or his cgi-bin directory. I followed the instructions on the Apache site. Is there another place in the /etc/httpd/conf/httpd.conf file that I need to modify?

%%%%
Excerpt from the /etc/httpd/conf/httpd.conf file
%%%%

#
<IfModule mod_userdir.c>
#
# UserDir is disabled by default since it can confirm the presence
# of a username on the system (depending on home directory
# permissions).
#
UserDir disable root
UserDir enable bob

#
# To enable requests to /~user/ to serve the user's public_html
# directory, remove the "UserDir disable" line above, and uncomment
# the following line instead:
#
UserDir html

</IfModule>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#
<Directory "/home/*/html/cgi-bin">
Options ExecCGI
SetHandler cgi-script
</Directory>

#<Directory "/var/www/cgi-bin">
# AllowOverride None
# Options None
# Order allow,deny
# Allow from all
#</Directory>
Reply With Quote
  #5  
Old 12th April 2004, 01:10 PM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 27
Posts: 7,909
Remove the UserDir disable root and UserDir enable bob lines. This is just specifies a directory for the user's public html directory.

If you want to check your config, run
Code:
/sbin/service httpd configtest
See the Apache docs for a complete reference.
Reply With Quote
  #6  
Old 12th April 2004, 01:50 PM
Eli Offline
Registered User
 
Join Date: Feb 2004
Location: Winston-Salem, NC
Age: 37
Posts: 49
A rainy day. Blah.

Well I did what you had recomended Jman, and the 'services' returned 'syntax okay' I also thought that it was a permission thing. So I 'chmod 755 *' in ~/bob/html/*. I did this recursively, and also on the html directory itself. But I still get.
403 Forbidden. From Apache.
Reply With Quote
  #7  
Old 14th April 2004, 12:36 AM
Jman Offline
Registered User
 
Join Date: Mar 2004
Location: Minnesota, USA
Age: 27
Posts: 7,909
Check the error logs. Look at the end of /var/log/httpd/error_log.
Reply With Quote
  #8  
Old 14th April 2004, 03:52 AM
Eli Offline
Registered User
 
Join Date: Feb 2004
Location: Winston-Salem, NC
Age: 37
Posts: 49
I am getting a permission error

[Tue Apr 13 22:37:33 2004] [notice] Apache/2.0.48 (Fedora) configured -- resuming normal operations
[Tue Apr 13 22:37:34 2004] [error] [client 127.0.0.1] (13)Permission denied: access to /~bob/html/index.html denied
[Tue Apr 13 22:42:17 2004] [error] [client 127.0.0.1] (13)Permission denied: access to /~bob/html/index.html denied

I am going to work on it tomorrow. I tried 'chgrp apache -R /home/bob/html' and I still am having no luck. I will read the documentation and see if there is anything I might have missed.

By the way, thanks for the tip to check the error logs. I was trying to look in /var/www/error/HTTP_UNAUTHORIZED.html.var
:o

Last edited by Eli; 14th April 2004 at 03:54 AM.
Reply With Quote
  #9  
Old 21st January 2005, 01:27 PM
goll Offline
Registered User
 
Join Date: Dec 2004
Posts: 15
Hi,

I have a similar problem. I can't get mod_userdir working
accessing to http://192.168.1.4/ works fine
accessing to http://192.168.1.4/~rolf/index.html says "Forbidden, You don't have permission to access /~rolf/index.html on this server"

The error_log says:
[Fri Jan 21 14:17:41 2005] [error] [client 192.168.1.202] (13)Permission denied: access to /~rolf/index.html denied

Here's an excerpt of httpd.conf
<IfModule mod_userdir.c>
UserDir enabled rolf
UserDir public_html
</IfModule>
<Directory /home/*/public_html>
AllowOverride FileInfo AuthConfig Limit
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
Order allow,deny
Allow from all
</Directory>

and here some other infos:
[root@thor html]# /sbin/service httpd configtest
Syntax OK
[root@thor html]# /etc/rc.d/init.d/httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

[root@thor html]# l /home/rolf/
total 180
drwx------ 23 rolf users 4096 Jan 12 20:08 .
drwxr-xr-x 8 root root 4096 Jan 10 16:13 ..
[...]
drwxrwxr-x 8 rolf users 4096 Jan 3 09:44 public_html
[...]

[root@thor html]# l /home/rolf/public_html/index.html
-rw-r--r-- 1 rolf users 466 Jan 3 09:33 /home/rolf/public_html/index.html


SELinux is not activated (at least I think - how can I find this out?), so http://fedora.redhat.com/docs/selinux-apache-fc3/ doesn't apply here.


My system is basically an installation of FC3 out-of-the-box. I have only applied minor changes to the fresh install. I think, I've really tried everything.

Apache configuration has always been a pain for me

do you have any ideas?

Thanks

Rolf
Reply With Quote
  #10  
Old 25th January 2005, 08:17 PM
jcpunk Offline
Registered User
 
Join Date: Jan 2005
Posts: 6
Quote:
Originally Posted by Eli
I am getting a permission error

[Tue Apr 13 22:37:33 2004] [notice] Apache/2.0.48 (Fedora) configured -- resuming normal operations
[Tue Apr 13 22:37:34 2004] [error] [client 127.0.0.1] (13)Permission denied: access to /~bob/html/index.html denied
[Tue Apr 13 22:42:17 2004] [error] [client 127.0.0.1] (13)Permission denied: access to /~bob/html/index.html denied

I am going to work on it tomorrow. I tried 'chgrp apache -R /home/bob/html' and I still am having no luck. I will read the documentation and see if there is anything I might have missed.

By the way, thanks for the tip to check the error logs. I was trying to look in /var/www/error/HTTP_UNAUTHORIZED.html.var
:o
perhaps I am missing something, but it seems to me that your filesystem looks like:

/home/bob/html/index.html

if this is correct you will never be able to access your web space at http://hostip/~bob/html/index.html

the ~bob part of the address is telling apache to enter the /home/bob/html folder, so unless your dir structure looks like /home/bob/html/html/index.html you are pointing towards a bogus directory and that would account for your 403 error.

try http://hostip/~bob/index.html
Reply With Quote
  #11  
Old 25th January 2005, 08:41 PM
Adesso's Avatar
Adesso Offline
Registered User
 
Join Date: Sep 2004
Location: Germany
Age: 36
Posts: 274
Just a idea... but would this not have to do with the fact that apache must be compiled with the --enable-pcntl option.. or am I way wrong.. ?
__________________
Whatever you do, will return to you three fold...

My Work Box
My Home Box
Reply With Quote
Reply

Tags
cgi, httpd

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
httpd problem and caused my httpd to shut-down golpemortal Using Fedora 4 8th April 2007 03:33 AM
httpd / httpd-suexec circular(?) dependency ronbiah Using Fedora 6 14th November 2005 02:39 PM


Current GMT-time: 05:09 (Saturday, 25-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat