Apache虚拟主机快速搭建攻略
2008-06-03 00:00:00 来源:WEB开发网文件样例:
<VirtualHost 192.168.33.101:80>
ServerAdmin webmaster@myserver.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it
ServerName server.myserver.com
DocumentRoot /srv/www/htdocs/server_port80
ErrorLog /var/log/apache2/server_port80.log
CustomLog /var/log/apache2/access_port80.log combined
HostnameLookups Off
UseCanonicalName Off
ServerSignature On
ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_port80/cgi-bin/"
<Directory "/srv/www/htdocs/server_port80/cgi-bin">
AllowOverride None
Options +ExecCGI -Includes
Order allow,deny
Allow from all
</Directory>
<Directory "/srv/www/htdocs/server_port80">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
如果你想在不同的端口上运行你的web页面,使用下面的配置文件:
<VirtualHost 192.168.33.101:8090>
ServerAdmin webmaster@myserver.comThis e-mail address is being protected from spam bots, you need JavaScript enabled to view it
ServerName server.myserver.com
DocumentRoot /srv/www/htdocs/server_port8090
ErrorLog /var/log/apache2/server_port8090.log
CustomLog /var/log/apache2/access_port8090.log combined
更多精彩
赞助商链接