How to configure an apache virtual machine in Linux

Source: Internet
Author: User
In Linux, after configuring the apache virtual machine, I first installed apache in linux by compiling the source code, I want to configure a virtual machine, just like using different domain names in windows to locate the root directory of the site that cannot be located. People who have done this should understand that the following is my configuration in linux: according to the above configuration, I configured the apache virtual machine in DocumentRoot Linux by modifying
First, after installing apache using the source code compilation method in linux, I want to configure a virtual machine, just like using different domain names in windows to locate the root directory of the site. People who have done this should be able to understand that the following is my configuration in linux:



According to the above configuration, if I modify the DocumentRoot path and access it with the IP address 127.0.0.1, we can locate the root directory of different sites, then, my url rewriting also plays a role, but when I access it through my configured ServerName, that is, koma.com, instead of accessing a local site but accessing a site on the Internet, I don't know how to use my configured ServerName to access the local site? Please help ....

You can modify the hosts file in windows, but I don't know how to do it in linux .... Share:
------ Solution --------------------
You can modify the hosts file in linux, but you can test it yourself.
------ Solution --------------------
Where is the access? only the host machine configured with the host can access the server effectively.
------ Solution --------------------


DocumentRoot "E:/AppServ/www/web"
ServerName koma.com
ErrorLog "logs/error. log"

------ Solution --------------------
Http://www.baidu.com? Wd = linux + hosts
Modify hosts in linux
------ Solution --------------------
In Linux, you can also configure hosts and directly add the corresponding ip address and virtual domain name to vi/etc/hosts.

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.