View previous topic :: View next topic |
Author |
Message |
luca Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 11 Feb 2004 Posts: 374
|
Posted: Wed May 17, 2006 2:41 pm Post subject: Apache config: can only display .cgi files |
|
|
Hi All
I think I need some help with my apache2 configuration. When I try to display, lets say index.html, I get an Internal Server Error.
Here is my 00_default_vhost.conf:
Code: | <VirtualHost *:80>
<IfModule mod_perl.c>
<Directory /opt/www>
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
Options -Indexes +ExecCGI
<IfDefine MODPERL2>
PerlOptions +ParseHeaders
</IfDefine>
<IfDefine !MODPERL2>
PerlSendHeader On
</IfDefine>
</Directory>
</IfModule>
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/opt/www/"
<IfModule peruser.c>
# this must match a Processor
ServerEnvironment apache apache
# these are optional - defaults to the values specified in httpd.conf
MinSpareProcessors 4
MaxProcessors 20
</IfModule>
#<IfModule mod_perl.c>
#<Files *.pl>
#SetHandler perl-script
#PerlResponseHandler ModPerl::Registry
#Options -Indexes ExecCGI
#PerlSendHeader On
#</Files>
#</IfModule>
</VirtualHost>
|
Here are also some parts from httpd.conf:
Code: | <Directory />
Options FollowSymLinks +ExecCGI
AllowOverride None
</Directory>
ScriptAlias /cgi-bin /opt/www/
|
So, I can run index.cgi (/opt/www, but I also see some problems with my .css file) but I cannot run index.html !
Any suggestions ?
Thanks a lot
Luca |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bin-doph Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/19876762173f66421e4e903.gif)
Joined: 23 May 2003 Posts: 302
|
Posted: Fri May 19, 2006 1:56 pm Post subject: Re: Apache config: can only display .cgi files |
|
|
luca wrote: | Hi All
I think I need some help with my apache2 configuration. When I try to display, lets say index.html, I get an Internal Server Error.
Here is my 00_default_vhost.conf:
Code: | <VirtualHost *:80>
<IfModule mod_perl.c>
<Directory /opt/www>
SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
Options -Indexes +ExecCGI
<IfDefine MODPERL2>
PerlOptions +ParseHeaders
</IfDefine>
...rest of config...
</VirtualHost> |
|
there you say "All files in /opt/www should be called as perl-scripts" with that SetHandler, which is not what you want.
option 1
Create a cgi-bin-directory and put all your stuff in there. connect that directory to the perl-script-Handler
option 2
set default handler to text/html and add a location-match, for example
Code: | SetHandler text/html
<LocationMatch "/*.cgi">
SetHandler perl-script
</LocationMatch> |
untested, but should do I guess
hth
-fe _________________ perl -e '$_=q;4a75737420616e6f74686572205065726c204861636b65720as;;for(s;s;s;s;s;s;s;s;s;s;s;s){s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}' |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
luca Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 11 Feb 2004 Posts: 374
|
Posted: Mon May 22, 2006 7:13 am Post subject: |
|
|
Thanks a lot, your untested code worked very well!!
Now my 00_default_vhost.conf looks like: Code: |
<VirtualHost *:80>
<IfModule mod_perl.c>
<Directory /opt/www>
#SetHandler perl-script
PerlResponseHandler ModPerl::PerlRun
Options -Indexes +ExecCGI
<IfDefine MODPERL2>
PerlOptions +ParseHeaders
</IfDefine>
<IfDefine !MODPERL2>
PerlSendHeader On
</IfDefine>
</Directory>
</IfModule>
SetHandler text/html
<LocationMatch "/*.cgi">
SetHandler perl-script
</LocationMatch>
DocumentRoot "/opt/www/"
... |
Luca |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
bin-doph Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/19876762173f66421e4e903.gif)
Joined: 23 May 2003 Posts: 302
|
Posted: Mon May 22, 2006 9:51 am Post subject: |
|
|
I think you could remove that SetHandler text/html, it should be the default if you dont overwrite it somewhere else.
gth
-fe _________________ perl -e '$_=q;4a75737420616e6f74686572205065726c204861636b65720as;;for(s;s;s;s;s;s;s;s;s;s;s;s){s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}' |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|