LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-03-2003, 07:46 PM   #1
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Rep: Reputation: 30
apache still won't let me run scripts...


hooo, boy...another apache thread.

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
 
Old 04-04-2003, 03:41 AM   #2
sidey
Member
 
Registered: Mar 2003
Location: Essex UK
Distribution: rh 8.0 bsd 5.0 slack 9.0 rc2 crux
Posts: 147

Rep: Reputation: 15
are you getting any error messages on the webserver

eg 500 server made a boo boo etc?
do the scripts run at a command line?
anything in /$path/logs/error.log?

 
Old 04-04-2003, 03:13 PM   #3
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Original Poster
Rep: Reputation: 30
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.
 
Old 04-07-2003, 02:24 AM   #4
sidey
Member
 
Registered: Mar 2003
Location: Essex UK
Distribution: rh 8.0 bsd 5.0 slack 9.0 rc2 crux
Posts: 147

Rep: Reputation: 15
can you try setting the permissions to 775?

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

but hopefully you wont need to :P

edit:

oh i cant pm you :/
 
Old 04-07-2003, 11:48 AM   #5
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Original Poster
Rep: Reputation: 30
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!

http://128.226.198.93/Apache_WebPages.tar.gz
 
Old 04-07-2003, 09:48 PM   #6
rose_bud4201
Member
 
Registered: Aug 2002
Location: St Louis, MO
Distribution: Xubuntu, RHEL, Solaris 10
Posts: 929

Original Poster
Rep: Reputation: 30
OOOOOOOOOPS

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

Thank you so much for all your help!
 
Old 04-11-2003, 02:51 AM   #7
sidey
Member
 
Registered: Mar 2003
Location: Essex UK
Distribution: rh 8.0 bsd 5.0 slack 9.0 rc2 crux
Posts: 147

Rep: Reputation: 15
Heh ok,

Sorry i been so long away just been a bit busy

But gald its semi working
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
does apache support cgi scripts and how to run them abhis_mail2002 Fedora 3 03-15-2005 04:37 AM
Cant run CGI scripts on Apache! mylo2003 Linux - General 5 11-09-2004 09:22 AM
php4 & apache installed but will not run web pages with scripts oberon-ken-obi Linux - Newbie 5 07-06-2004 08:00 AM
How do i get scripts to run? jihadcman Fedora 3 06-06-2004 10:15 AM
Apache 2.0.43 will not run cgi scripts RobbieRoy Linux - Networking 5 09-04-2003 02:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration