Re: Improvement to my conf file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/30/07, Norman Khine <norman@xxxxxxxxx> 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@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux