httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joshua Slive" <jos...@slive.ca>
Subject Re: [users@httpd] Improvement to my conf file
Date Sun, 30 Sep 2007 21:04:18 GMT
On 9/30/07, Norman Khine <norman@khine.net> wrote:
> Hello,
> I have the following configuration:
>
> <VirtualHost *:80>
>      ServerName www.domain.com
>      DocumentRoot "/var/www/www.domain.com/htdocs/"
>      RewriteEngine on
>      RewriteCond %{SERVER_PORT} !^443$
>      RewriteRule ^/cgi-bin/wwwweb.cgi
> https://%{SERVER_NAME}/cgi-bin/wwwweb.cgi$1 [L,R]

Since, based on the virtual host, you already know you are not using
SSL, and the server_name is fixed, you can replace the above three
lines with simply
Redirect permanent /cgi-bin/wwwweb.cgi https://www.domain.com/cgi-bin/wwwweb.cgi

>      <Directory "/var/www/www.domain.com/htdocs">
>          Options Indexes FollowSymLinks
>          AllowOverride None
>          Order allow,deny
>          Allow from all
>      </Directory>
> </VirtualHost>
>
> <VirtualHost *:443>
>      ServerName www.domain.com
>      ServerAlias cowwwo.domain.com
>      DocumentRoot "/var/www/www.domain.com/htdocs/"
>      <Directory "/var/www/www.domain.com/cgi-bin">
>          Options Indexes FollowSymLinks
>          AllowOverride None
>          Order allow,deny
>          Allow from all
>      </Directory>
>      <Directory "/var/www/www.domain.com/htdocs/wwwweb">

This path is probably a typo. I guess it should match the one in the
non-ssl virtualhost.

Since the two are identical, you could remove them both an put one
<Directory> section in the "main server config" (outside the
<VirtualHost> sections), but it doesn't make a big difference.

> It seems in apache 2.2.6 you have to specify the 'Allow from all' to all
> directories that I want to be able to see - is this correct?

This is true if you start from the default config file, since it
includes something along the lines
<Directory />
Order deny,allow
Deny from all
</Directory>
which sets the default state to deny.

Joshua.

---------------------------------------------------------------------
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


Mime
View raw message