apache2虚拟主机配置:
default:
代码: 全选
NameVirtualHost *
<VirtualHost *>
ServerName abc.3322.org
ServerAdmin [email protected]
DocumentRoot /var/www/mainsite
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/mainsite>
Options Indexes FollowSymLink MultiView
AllowOverride None
order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiView +SymLinksIfOwnerMatch
order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
代码: 全选
<VirtualHost *>
ServerName phpmyadmin.abc.3322.org
ServerAdmin [email protected]
DocumentRoot /var/www/phpmyadmin
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/site1>
Options Indexes FollowSymLink MultiView
AllowOverride None
order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiView +SymLinksIfOwnerMatch
order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>
代码: 全选
<VirtualHost *>
ServerName testsite.abc.3322.org
ServerAdmin [email protected]
DocumentRoot /var/www/testsite
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/testsite>
Options Indexes FollowSymLink MultiView
AllowOverride None
order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiView +SymLinksIfOwnerMatch
order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
LogLevel warn
CustomLog /var/log/apache2/access.log combined
ServerSignature On
</VirtualHost>