Wednesday, September 1, 2010

httpd.conf name virtual hosts basic auth example apache 2.2.14 worker MPM httpd

ServerRoot "/www/apache/2.2.14"
Listen 10.10.120.32:80
LoadModule authn_alias_module modules/mod_authn_alias.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule rewrite_module modules/mod_rewrite.so
User w3admin
Group w3admin
ServerAdmin m2@mydomain.com
ServerName download.mydomain.net:80
DocumentRoot "/www/apache/2.2.14/download.mydomain.net.docs"

Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all


Options Indexes FollowSymLinks
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all


DirectoryIndex index.html


Order allow,deny
Deny from all
Satisfy All

DefaultType text/plain

TypesConfig conf/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz


SSLRandomSeed startup builtin
SSLRandomSeed connect builtin


NameVirtualHost 10.10.120.32:80

ServerName download.mydomain.net
ServerAlias download.mydomain2.com
DocumentRoot "/www/apache/2.2.14/download.mydomain.net.docs"
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/download.mydomain.net.access_log common
ErrorLog "logs/download.mydomain.net.error_log"
LogLevel info


ServerName funpics.mydomain.net
ServerAlias funpics.mydomain2.com
DocumentRoot "/www/apache/2.2.14/funpics.docs"
LogFormat "%h %l %u %t \"%r\" %>s %b" common
CustomLog logs/funpics.access_log common
ErrorLog "logs/funpics.error_log"
LogLevel info

AuthType Basic
AuthName "Authentication Required"
AuthUserFile "/www/apache/2.2.14/conf/.htpasswd"
Require valid-user
Order allow,deny
Allow from all

No comments: