ubuntu 14.0.4 apache vhosts.conf
在Apache2/sites-enabled 下添加vhosts.conf文件,內容如下,保存重啓apache 就行了。
<Directory "/home/www/*">
# Options Indexes MultiViews
Options All ExecCGI FollowSymLinks Indexes
AllowOverride All
Order allow,deny
Allow from all
# AuthName "Login dev website"
# AuthType Basic
# AuthUserFile /home/websites/.htpasswd
# require valid-user
</Directory>
Listen 8022
#NameVirtualHost *:8022
<VirtualHost *:8022>
ServerName demo.com
ServerAlias demo.cn
Options All ExecCGI FollowSymLinks Indexes
DirectoryIndex index.php
DocumentRoot /home/www/demo
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
80端口在Apache2/sites-enabled/000-default.conf
添加內容如下:
<VirtualHost *:80>
DirectoryIndex index.php
ServerAdmin [email protected]
DocumentRoot "/home/www/pp"
ServerName ppinvoice.cn
<Directory "/home/www/pp">
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
重啓apache : service apache2 restart
<Directory "/home/www/*">
# Options Indexes MultiViews
Options All ExecCGI FollowSymLinks Indexes
AllowOverride All
Order allow,deny
Allow from all
# AuthName "Login dev website"
# AuthType Basic
# AuthUserFile /home/websites/.htpasswd
# require valid-user
</Directory>
Listen 8022
#NameVirtualHost *:8022
<VirtualHost *:8022>
ServerName demo.com
ServerAlias demo.cn
Options All ExecCGI FollowSymLinks Indexes
DirectoryIndex index.php
DocumentRoot /home/www/demo
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
80端口在Apache2/sites-enabled/000-default.conf
添加內容如下:
<VirtualHost *:80>
DirectoryIndex index.php
ServerAdmin [email protected]
DocumentRoot "/home/www/pp"
ServerName ppinvoice.cn
<Directory "/home/www/pp">
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
重啓apache : service apache2 restart
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.