Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm having trouble getting apache to let me run a python script through my web page...it keeps coming back "you don't have permission to access /cgi-bin/AddUser.py" ...I've changed the cgi aliasing to /var/www/html/cgi-bin, which is where my scripts are located, and both the directory and the scripts have user and group 'apache'.
(Part) of my commonhttpd.conf file looks like this:
Code:
<IfModule mod_alias.c>
#
# Note that if you include a trailing / on fakename then the server will
# require it to be present in the URL. So "/icons" isn't aliased in this
# example, only "/icons/"..
#
Alias /icons/ /var/www/icons/
Alias /doc /usr/share/doc
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the realname directory are treated as applications and
# run by the server when requested rather than as documents sent to the client.
# The same rules about trailing "/" apply to ScriptAlias directives as to
# Alias.
#
ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/
ScriptAlias /protected-cgi-bin/ /var/www/protected-cgi-bin/
<Directory /var/www/html/cgi-bin/>
Options +ExecCGI
AllowOverride Options
AddHandler cgi-bin .cgi .pl .py
</Directory>
<IfModule mod_perl.c>
#Provide two aliases to the same cgi-bin directory,
#to see the effects of the 2 different mod_perl modes
#for Apache::Registry Mode
Alias /perl/ /var/www/perl/
#for Apache::Perlrun Mode
Alias /cgi-perl/ /var/www/perl/
</IfModule>
</IfModule>
The .py extension in the AddHandler line is python's extension.
I've looked through lots of posts here, and they all seem to center around the <Directory> settings...but I've done what they say (many times and in many different ways) and none of it seems to change anything.
The folder and files have 755 permissions.
Thanks!
Laura
Ok, umm...odd...but I'm getting a different error message now (All I did was restart httpd, but I've done that before and it's never made a difference. Go fig.)
Now I press the submit button in my HTML form and get this:
Code:
Method Not Allowed
The requested method POST is not allowed for the URL /cgi-bin/AddUser.py.
I'm not entirely sure what that means, actually...What other method is there for running scripts? The first line in the script is "#!/usr/bin/python", which is where the binary for python resides.
I recreated this on my apache 2.0.45 install and this gave me no problems.
If this still fails could you please send me the actual script so that i can use exactly what you are using and see if i can recreate the error i will pm you my email addy
Surely - here's my apache config script[s] as well as the source for my html pages and python scripts. Hopefully it's just something simple that I'm doing wrong - thanks!
OK, I think I solved my own problem. In my commonhttpd.conf file, I had the line
AddHandler cgi-bin .py
where it should have been
AddHandler cgi-script .py
(either I read it wrong somewhere, or I made an error copying.) It's still not working perfectly, but now it's running and just giving me a premature python header error which I don't think is related to apache...more to my python coding skills
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.