Configuration of Apache Virtual Host installed with apt-get In Ubuntu

Source: Internet
Author: User
Configuration of apache Virtual Host installed with apt-get In Ubuntu 1. After installing apache, the sites-enabledsites-available folders in the/etc/apache2 directory are about the virtual host configuration. In fact, sites-enabled is the connection file of sites-available, use ls-l to see 2. In sites-available

Configuration of apache Virtual Host installed with apt-get In Ubuntu

1. First, let's take a look at the directory generated after apache is installed.

In/etc/apache2

Sites-enabled

Sites-available

These two folders are about the virtual host configuration. In fact, sites-enabled is the connection file of sites-available, which can be seen through ls-l.

2. A default file is found in sites-available.

The default file is actually a standard configuration file for the VM,

Iii. VM configuration steps

If you create a VM such as pma.com

The root directory of the website is in/var/www, and pma.com corresponds to the/var/www/pma folder.

① In the sites-available folder, create a file pma with the following content:

Just follow default. Of course, it can be simpler.

ServerName pma.com

DocumentRoot/var/ww/pma/

② Connect to the sites-enabled folder

Sudo a2ensite pma

At this time, we can see that in sites-enabled, the connection file pma is generated.

③ Restart apache

Sudo service apache2 reload

Or sudo service apache2 restart

If you are familiar with Apache2, you may ask why it is so troublesome. Is it okay to put it in a file? Why should I use two files? It's actually very simple,

Because if I want to maintain the pma site, I only need to run the following command:

Sudo a2dissite pma

Sudo/etc/init. d/apache2 restart

You can maintain the pma site without affecting the normal operation of other sites.

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.