Configuration of Ubuntu 12.04 virtual Hosting

Source: Internet
Author: User
Tags hosting

Configuration of the Ubuntu 12.04 virtual Host (1) Open etc/hosts file

Increase:

127.0.0.1 study.ubuntu.com

127.0.0.1 hello.ubuntu.com

127.0.0.1 test.ubuntu.com

(2) Establishment of three project catalogs

sudo mkdir-p/wwwroot/{study,hello,test}

Build a index.html in every project

(3) Configuring Apache virtual Host

To switch to the Apache configuration directory:

cd/etc/apache2/sites-available/

Copy three copies of configuration files:

sudo CP Default Study sudo CP Default Hello sudo CP Default test

To modify a configuration file:

Vim Hello

Content:

ServerName hello.ubuntu.com Add

Documentroot/wwwroot/hello modification

<Directory/wwwroot/hello/> modification

Startup configuration file:

[Email protected]:/etc/apache2/sites-available$ CD. /sites-enabled/[email protected]:/etc/apache2/sites-enabled$ llls: Initialization of month string error total usage8drwxr-xr-x2Root root40967? +  -: A./drwxr-xr-x7Root root40967? +  -: at.. /lrwxrwxrwx1Root root -7? +  -: A  the-default. /sites-available/Default[email protected]:/etc/apache2/sites-enabled$

You need to create three soft connections, respectively, pointing to the three configuration files that you just copied.

sudo Ln -S. /sites-available/Hello hellosudoln -S. /sites-available/test testsudoln -S: /sites-available/study Study

Restart Apache:sudo Service apache2 restart

You will then be able to access

Hello.ubuntu.com

Study.ubuntu.com

Test.ubuntu.com

Configuration of Ubuntu 12.04 virtual Hosting

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.