Configuring the virtual host domain name in a Linux environment

Source: Internet
Author: User

Configure the virtual host domain name under the Linux environment

The first step:
Under the root directory (that is, the root directory)
LS (view file)
CD into etc directory
Find Hosts File
VI hosts open the Hosts file and edit it
At the bottom of the open file, add:
192.168.8.115 domain.com.cn


Step Two:
cd/usr/local/apache2/conf/Enter the directory below
LS View all files and directories under the current directory
VI httpd.conf Open and edit this file
Edit: Use PgDn on your keyboard to pull the cursor to the lowest end, and then add the following code:

Namevirtualhost 192.168.1.115: 80
<virtualhost 192.168.1.115:80>
DocumentRoot /usr/local/apache2/htdocs/project
ServerName domain.com.cn
</VirtualHost>

<directory "/usr/local/apache2/htdocs/project" >
Options Indexes FollowSymLinks
AllowOverride All
Order Deny,allow
Deny from all
Allow from all
</Directory>

Step Three:
Because there is no browser under Linux, even if you have all the configuration, in the end, we still have to go back to Windows. It is accessed by a browser.


So, finally, the most critical one

Open the Hosts file under the C:\WINDOWS\system32\drivers\etc directory

Add a 192.168.1.115 domain.com.cn and then. ok!~

I am configuring Host2, which is 192.168.8.202, namely:

Verify that:

Get!

Configuring the virtual host domain name in a Linux environment

Related Article

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.