Ubuntu Configuration Virtual Host

Source: Internet
Author: User

For actual project development, you may need different domains to point to different projects, then you need to configure the virtual host

The steps are as follows:

1. First, you need to go to the/etc/apache2/sites-available folder

Command:

  

Cd/etc/apache2/sites-available  

  

, enter LS, you can see 000-default.conf this configuration file

2. Then, copy and rename the file, and enter the following:

sudo cp 000-default.conf new profile name. conf  

  

For example:

1 sudo cp 000-default. conf index.conf


3. After the copy is finished, edit the file as follows:

sudo vim index.conf  

  

After the modification, save and exit (for VIM related actions can be self-search, no longer described here)

Next, load the configuration file and do the following:

4. Registering a virtual host

sudo a2ensite index.conf  

  

5. Re-execution:

  

6. Then restart the Apache server to

sudo service apache2 restart  

Other:


/etc/apache2/sites-enabled (This is the virtual host you have registered)

Note: If you want to unregister, you can do

sudo a2dissite index.conf  

  

After that, perform 5 or 6 operations

Ubuntu Configuration Virtual Host

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.