Configure Apache Virtual Hosts in Ubuntu and Windows

Source: Internet
Author: User
Configure the VM in Ubuntu: 1. Run the root user command to enter the/etc/apache2/sites-available/directory. 2. Create a VM configuration file named after the domain name, such as Androidj.com

Configure the VM in Ubuntu:

1. Use the root user command line to enter the/etc/apache2/sites-available/directory.

2. Create a VM configuration file and create a file named after the domain name, such as Androidj.com. You need to create the file androidj,

Namevirtualhost*: 9011

ServerAdmin master@test.com # email address

ServerName www.androidj.com # Domain Name

DocumentRoot/var/www/androidj # virtual host directory

Options Indexes FollowSymLinks MultiViews

AllowOverride None#If you configureUrlRewrite the lineAllowOverride All

Order allow, deny

Allow from all

ErrorLog/var/log/apache2/www_test_com_error.log

LogLevel warn

CustomLog/var/log/apache2/www_test_com_access.log combined

ServerSignature On

3. Run the/etc/apache2/directory command.

Vi posts. conf

Add two lines of text and configure the corresponding listening port.

Namevirtualhost*: 9001

Listen 9001.

4. Run a2ensite androidj in/etc/apache2.

This command establishes a soft connection to wwwtest under the/etc/apache2/sites-enabled directory.

Run/etc/init. d/apache2reload to re-load the configuration file.

If no error is reported, the configuration is successful.



The following describes how to configure an apache Virtual Host in windows:

Remove the # Before Include

# Virtual hostsInclude conf/extra/httpd-vhosts.conf

Save the modified httpd. conf file.

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.