You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tim Johnson <ti...@johnsons-web.com> on 2010/11/01 01:05:08 UTC

Re: [users@httpd] cgi script as domain root index (howto)

* Tim Johnson <ti...@johnsons-web.com> [101031 15:05]:
> This questions concerns apache(2) on ubuntu 10.04 and apache on
> centOS (OS version 7?)
> Using the following apache directive:
>    ScriptAlias /reg/ /home/http/py/
>     <Directory "/home/http/py">
>         AllowOverride all
>         Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
>         Order allow,deny
>         Allow from all
>     </Directory>
> 
> And the following .htaccess directives:
> #
> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-f
> RewriteRule ^(.*)$ ./index.py/$1 [L,QSA]
> #
> I can point my browser to http://localhost/reg/
> (with trailing slash) and get a response from
> 'index.py'
> Two questions ::
> 
> 1)How may I configure apache so that users will not need the
> trailing slash?
> 
> 2)How may I configure apache so that pointing my browser to
> http://localhost 
> will give me the response from a CGI script at /home/http ?
  Well, I have done some 'poking around'. I have altered the
  configuration of /etc/apache2/mods-enabled/dir.conf
  with the following directive:
  ##
  DirectoryIndex index.html index.php index.py index.cgi index.pl
  index.xhtml index.htm
  ##
  I can verify that index.html and index.php will work, based on the
  priority of the file entries. However, if I rename both index.php
  and index.html - I get the following error message:
  """
  You don't have permission to access /index.py on this server
  """
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi script as domain root index (howto)

Posted by Tim Johnson <ti...@johnsons-web.com>.
* Eric Covener <co...@gmail.com> [101101 04:20]:
> >        Options +ExecCGI Indexes FollowSymLinks MultiViews
> manual says don't mix +/- and non +/-. This doesn't do what you expect.
  You're correct.
  It works now.
  Thank you!
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi script as domain root index (howto)

Posted by Eric Covener <co...@gmail.com>.
>        Options +ExecCGI Indexes FollowSymLinks MultiViews
manual says don't mix +/- and non +/-. This doesn't do what you expect.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi script as domain root index (howto)

Posted by Sean Conner <sp...@conman.org>.
It was thus said that the Great Tim Johnson once stated:
> * Eric Covener <co...@gmail.com> [101031 17:14]:
> > >  """
> > >  You don't have permission to access /index.py on this server
> > >  """
> > 
> > Check your error log for a more informative message.
> 
>   Yeah right. :) why didn't I remember to do that?  
>   
>   From /var/log/apache2/error.log (on ubuntu 10.04) 
>   Options ExecCGI is off in this directory: /home/http/index.py 
>   
>   Alas, I have tried adding +ExecCgi to `default' without any luck.
> 
>   Example:
>       <Directory /home/http/> 
>         #Options Indexes FollowSymLinks MultiViews
>         Options +ExecCGI Indexes FollowSymLinks MultiViews
>         #AllowOverride None
>         AllowOverride all
>         #AllowOverride FileInfo
>         Order allow,deny
>         allow from all
>     </Directory>
> 
> 
>   Further comments are welcome. But you have put me on a better
>   track. Thanks

  You might want to add

	AddHandler cgi-script .py
	DirectoryIndex index.py index.html index.htm

  in the appropriate spot in your configuration file.

  -spc


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi script as domain root index (howto)

Posted by Tim Johnson <ti...@johnsons-web.com>.
* Eric Covener <co...@gmail.com> [101031 17:14]:
> >  """
> >  You don't have permission to access /index.py on this server
> >  """
> 
> Check your error log for a more informative message.

  Yeah right. :) why didn't I remember to do that?  
  
  From /var/log/apache2/error.log (on ubuntu 10.04) 
  Options ExecCGI is off in this directory: /home/http/index.py 
  
  Alas, I have tried adding +ExecCgi to `default' without any luck.

  Example:
      <Directory /home/http/> 
        #Options Indexes FollowSymLinks MultiViews
        Options +ExecCGI Indexes FollowSymLinks MultiViews
        #AllowOverride None
        AllowOverride all
        #AllowOverride FileInfo
        Order allow,deny
        allow from all
    </Directory>


  Further comments are welcome. But you have put me on a better
  track. Thanks
-- 
Tim 
tim at johnsons-web.com or akwebsoft.com
http://www.akwebsoft.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] cgi script as domain root index (howto)

Posted by Eric Covener <co...@gmail.com>.
>  """
>  You don't have permission to access /index.py on this server
>  """

Check your error log for a more informative message.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org