The configuration method of Apache virtual host _linux

Source: Internet
Author: User
Tags port number
method One:
First open the http.conf file under the Apache Conf. Open the comments of the virtual host: The following removes the # in front of the second line
# Virtual Hosts
# Include Conf/extra/httpd-vhosts.conf
Open the httpd-vhosts.conf file in the extra directory under the Conf directory again
At the back of the file, add
<virtualhost *:80>//The port number used by your virtual host
ServerAdmin Webmaster@dummy-host2.localhost//Virtual Host Administrator account
DocumentRoot "D:/wamp/www/phpwind"
The file path of the Web site you want to configure, and the local test needs to be configured
ServerName bbs.1jiayuan.com//server name local test required configuration
ErrorLog "Logs/dummy-host2.localhost-error.log"//error log
Customlog "Logs/dummy-host2.localhost-access.log" common//user log
</VirtualHost>
Save after configuration is complete
Then open the c:/windows/system32/drivers/etc/hosts and configure the hosts you need
For example:
127.0.0.1 bbs.1jiayuan.com
192.168.1.80 bbs.1jiayuan.com
Method Two:
Directly at the back of the http.conf, add:
Copy Code code as follows:

<virtualhost 192.168.1.80>
ServerName bbs.1jiayuan.com
DocumentRoot D:/wamp/www/phpwind
<directory d:/wamp/www/phpwind>
AllowOverride All
Options All
</Directory>
Php_value include_path D:/library
Php_value MAGIC_QUOTES_GPC off
Php_value register_globals off
</VirtualHost>

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.