Ubuntu Apache new multiple sites via port

Source: Internet
Author: User

Cd/etc/apache2/sites-available

The recent virtual machine is not bound domain name, so, first use the domain name plus port to create a few sites with

1.

Vim/etc/apapche2/apapche2.conf

# Include List of ports to listen on
Include ports.conf
Find this, open this. Add listening port

Vim ports.conf

2. Add 8080 ports, or other ports you want

3, add the host configuration file, copy a previous configuration of your files, I used to match one, and then directly modify the good.

Cd/etc/apache2/sites-available
Vim Test.con

Just modify the directory of ports and DocumentRoot and other directories as well.

4, release the new site

sudo ln-s/etc/apache2/sites-available/test.conf/etc/apache2/sites-enabled/test.conf

The configuration files for the new site are created, and to make them effective they must also soft-link the profile to the Sites-enabled folder.

5. Restart Apache

Systemctl Restart Apache2

Restart the Apache server.
Open the browser access http://xxxx:8080 can access the correct, instructions on the configuration is a bit of crap, ha ha,, but to create in the root directory you re-config file documentroot path file,:)

Ubuntu Apache new multiple sites via port

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.