Configure apache Virtual Machine + software download, apache Virtual Machine

Source: Internet
Author: User

Configure apache Virtual Machine + software download, apache Virtual Machine
Step 1:

Open the httpd. conf file in c:/wamp/apache/conf,

In httpd. conf, press ctrl + f and enter vhosts.

Find the line and remove the # above

Operation

 

Step 2:

Open the master configuration file of the VM

Httpd-vhosts.conf in c:/wamp/apache/conf/extra

Preparations before configuration

Open httpd-vhosts.conf

# Can be deleted.

Leave these two lines at last (<VirtualHost *: 80> </VirtualHost>)

Start Configuration

NameVirtualHost *: 80

Note:

NameVirtualHost //Based on Domain NameVirtual Host Configuration (meaning: different domain names access different hosts)

After NameVirtualHost, at leastThere is a space

"*" // Indicates all IP addresses of the server.

*: 80 // for port settings, be sure to keep the port consistent with the listen configuration in httpd. conf.

NameVirtualHost *: 80 // note that in the master configuration file of the VMOnly one row.

 

Master configuration segment of the VM:

<VirtualHost *: 80> </VirtualHost>

Note:

VirtualHost space *: 80 // The Master configuration segment of the VM starts.

</VirtualHost> // The Master configuration segment of the VM ends.

ServerName space www.sina.com

Note: ServerName // custom domain name is mainly used to test the host

DocumentRoot "c:/sina" // set the root directory of the host (website). Note:This directory must exist.

DirectoryIndex. php index.html default. php // default homepage settings for host (website). Multiple default homepage settings can be set to be separated by spaces.

Directory permission settings:

<Directory "Directory of the Website"> </Directory> // The configuration segment of the Directory permission is similar to that of the double label.

Note: The "website directory" must be consistent with DocumentRoot.

Permission settings:

Options // about Server feature settings, Indexes | None

Indexes // when the default homepage does not exist, it is displayed as a list

 

. Order Deny, Allow // set the host access sequence

Deny // Access Denied

Allow // Allow access

There is a comma between the two words.

Order Deny, Allow // The access permission is superimposed. The final result of this sentence is to Allow all users to access

Order Allow, Deny // The access permission is superimposed. The final result of this sentence is to Deny access by all users.

Order Allow, Deny

Allow from IP address // overlay the two lines to Allow access by the specified IP address only

Order Deny, Allow

Deny from IP address // overlay the two lines to Deny access from the specified IP address.

 

Differences between indexes and none

This is the final configuration,

 

Step 3:

Local DNS resolution:

Open the local DNS file --> Run --> drivers --> etc --> hosts open

Add a custom domain name resolution.

Format: IP space custom Domain Name

Method 1: 127.0.0.1 www.sina.com // only accessible by yourself

Method 2: the IP address of the local Nic is www.sina.com // accessible to others.

Restart apache

Enter www.daima.com and the following result is displayed:

Baidu cloud address of the three Software

Database

Link: https://pan.baidu.com/s/1pL5139D password: 56x3

Php

Link: https://pan.baidu.com/s/1c2cbHIS password: uyh9

Apache

Link: https://pan.baidu.com/s/1c2MITZa password: p3da

 

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.