Apache Build Virtual Host method
DocumentRoot:/home/fdipzone/sites/demo.fdipzone.com
ServerName:demo.fdipzone.com
1. Enter Apache virtual host Setup Directory
Cd/etc/apache2/sites-available
2. Create File demo.fdipzone.com
<virtualhost *:80>
ServerAdmin webmaster@localhost
documentroot/home/fdipzone/sites/ demo.fdipzone.com
ServerName demo.fdipzone.com
serveralias demo.fdipzone.com <directory
"/home/ Fdipzone/sites/demo.fdipzone.com ">
allow from all Options + Indexes
</Directory>
</ Virtualhost>
3. Activate the virtual host configuration
sudo a2ensite demo.fdipzone.com
Back to the column page: http://www.bianceng.cnhttp://www.bianceng.cn/Servers/web/
4. Enter the/etc/apache2/sites-enabled/directory to view all active virtual hosts. You can log off with sudo a2dissite demo.fdipzone.com
cd/etc/apache2/sites-enabled
ls-lt
displays
lrwxrwxrwx 1 root 2013-04-05 17:29 demo.fdipzone.com. /sites-available/demo.fdipzone.com
5. Restart Apache Service
Sudo/etc/init.d/apache2 restart
6.ubuntu Setting Host
Vim/etc/hosts
127.0.0.1 demo.fdipzone.com
7.<directory> settings Open. htaccess and display directory structure list
<directory "/home/fdipzone/demo.fdipzone.com" >
allowoverride none
allowoverride all
Options- Index followsymlinks
</Directory>
AllowOverride none indicates closing. htaccess, if you want to turn on the can set to allowoverride all
Options-indexes indicates that the directory structure is turned off to display if you want to turn on options Indexes
The Options followsymlinks indicates support for symbol link (soft connection), if you want to turn it off to be set to Options-followsymlinks