LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices



Reply
 
Search this Thread
Old 09-01-2009, 05:28 AM   #1
hiarunn
LQ Newbie
 
Registered: Apr 2006
Posts: 7

Rep: Reputation: 0
Exclamation apache fail to pick the DirectoryIndex index.py


Here is the scnerio.
I have hosted some cgi-scripts on my web server and I want my web server to serve the script when I access just the URL http://myhost.example.com/

I configured the virtual host directive as below.

<VirtualHost *:80>
ServerName myhost.example.com
ServerAlias myhost
DocumentRoot /home/arun/www/html
ScriptAlias / /home/arun/www/cgi-bin
DirectoryIndex index.py
</Directory "/home/arun/www/cgi-bin">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>

Now, when I access the URL http://myhost.example.com/index.py, it works. But when I try to access the URL http://myhost.example.com/, the returning error "403 forbidden".

I guess DirectoryIndex works only with DocumentRoot and not with ScriptAlias. I could make it work by using ReWrite directive, but its again a work around I feel.

Appreciate any inputs on this regard.
 
Old 09-01-2009, 06:06 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,971

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
</Directory "/home/arun/www/cgi-bin">
I guess this is a typo. You mean <Directory "/home/arun/www/cgi-bin">.
Now to be able to execute scripts in the above dir, you need to add:
Code:
Options ExecCGI
 
Old 09-01-2009, 07:50 AM   #3
hiarunn
LQ Newbie
 
Registered: Apr 2006
Posts: 7

Original Poster
Rep: Reputation: 0
Yup, its a typo. Sorry.

"Options ExecCGI" didn't work. Still apache couldn't pick the file index.py.
 
Old 09-01-2009, 08:09 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,971

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
OK, use the following for the DocumentRoot:
Code:
<Directory "/home/arun/www">
DirectoryIndex index.py
Options ExecCGI
AddHandler cgi-script .py
</Directory>
 
  


Reply

Tags
apache, conf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Index file order in DirectoryIndex not working Nickalf Linux - Server 4 05-17-2009 11:59 AM
apache index.html doesn't show up but index.php do zoffmann Linux - Server 5 01-28-2008 04:53 PM
Graphical Apache configuration under RedHat 9.0 fails to include DirectoryIndex? bastianmk Red Hat 0 03-02-2004 01:43 AM
apache 1.3.29 directoryindex and chmod axion0917 Linux - Software 1 11-30-2003 02:01 PM
Apache DirectoryIndex problem jester_69 Linux - General 1 07-14-2002 01:39 PM


All times are GMT -5. The time now is 08:23 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration