Configure a VM in PHPApache

Source: Internet
Author: User
PHPApache: configure the VM 1. find the httpd. conf file under the \ conf directory of Apache, open it, and find the following two lines:

# Virtual hosts

# Include conf/extra/httpd-vhosts.conf

Remove the # sign in front of him. the modification is as follows:

# Virtual hosts

Include conf/extra/httpd-vhosts.conf

It means to enable the virtual host settings file httpd-vhosts.conf, virtual host settings are set under this file, do not change httpd. conf, this is clearer.



2. find the httpd-vhost.conf file under the \ conf \ extra directory of Apache.

When you open it, it contains the following content:

? VM configuration starts

ServerAdmin webmaster@dummy-host.localhost

DocumentRoot "E:/wamp/www/ecshop" // root path of the website-the Directory of the VM, that is, the root directory corresponding to the domain name

ServerName "www.baidu.com" // virtual host domain name-the domain name you want

ServerAlias www. dummy-host.localhost

ErrorLog "log/dummy-host.localhost-error.log"

CustomLog "logs/dummy-host.localhost-access.log" common


Add the following content before each virtual host configuration starts:

// This is the authorized directory of your vm. generally, it is different from DocumentRoot ""? The Directory of the VM, that is, the root directory of the domain name is the same.

Options Indexes FollowSymLinks between Des ExecCGI

AllowOverride All

Order allow, deny

Allow from all

Allow from all-only allow users can access the directory defined above. Otherwise, the Error 503 will be displayed during IE or firefox access, that is, access is prohibited. This is the default setting of Apache. The last line is like this.

Deny from all: Deny all access to the root directory. others cannot access your website,

So if you want other users to access your project, you have to change it

Allow from all

3. find the hosts file under the C: \ WINDOWS \ system32 \ drivers \ etc directory.

Add the following sentence

127.0.0.1 www.baidu.com? This is your domain name. how many virtual hosts do you need to add such records.

========================================================== ========================================================== ======================================
Example
 
  Options Indexes FollowSymLinks Includes ExecCGIAllowOverride AllOrder allow,denyAllow from all
 
 
  ServerAdmin webmaster@dummy-host2.localhostDocumentRoot E:\wamp\www\ecshopServerName www.test.comErrorLog logs/dummy-host2.localhost-error_logCustomLog logs/dummy-host2.localhost-access_log common
 

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.