You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Norman Khine <no...@khine.net> on 2007/09/30 21:26:10 UTC
[users@httpd] Improvement to my conf file
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]
<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">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<IfModule alias_module>
ScriptAlias /cgi-bin/ /var/www/www.domain.com/cgi-bin/
</IfModule>
</VirtualHost>
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?
Can the above conf file be simplified or improved in any way.
Thanks
--
Norman Khine
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or chr(97+(ord(c)-83)%26)
for c in ",adym,*)&uzq^zqf" ] )
---------------------------------------------------------------------
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] Improvement to my conf file
Posted by Joshua Slive <jo...@slive.ca>.
On 9/30/07, Norman Khine <no...@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