From: Http://www.blogjava.net/zhyiwww/archive/2010/05/24/321742.html
How to configure a virtual host with multiple ports in Apache in Linux
Linux (UBUNTU)
By default
The default document directory is/var/www.
Default port: 80
To publish a system resource directory, run the following command:
(1) Add a listening port
# Cd/etc/apache2
# Vim ports. conf
File addition:
Namevirtualhost*: 8000
Listen 8000.
(2) configure the virtual directory
# Cd/etc/apache2/sites-available
# Cp default-me
# Vim default-me
The file content is as follows:
<Virtualhost *:8000>
Serveradmin webmaster @ localhost
DocumentRoot/Wwwroot
<Directory/>
Options followsymlinks
AllowOverride none
</Directory>
<Directory/Wwwroot/>
Options indexes followsymlinks Multiviews
AllowOverride none
Order allow, deny
Allow from all
</Directory>
Errorlog/var/log/apache2/error. Log
# Possible values include: Debug, info, notice, warn, error, crit,
# Alert, emerg.
Loglevel warn
Customlog/var/log/apache2/access. Log combined
</Virtualhost>
The bold part is the key point.
(3) release site
# Ln-S/etc/apache2/sites-available/default-me/etc/apache2/sites-enabled/001-Default
(4) restart the service
#/Etc/init. d/apache2 restart
(5) test
Http: // localhost: 8000/
If the access is normal, the configuration is correct.