Go to: how to configure the virtual host with Multiple Apache ports on Ubuntu

Source: Internet
Author: User
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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.