Home > php教程 > php手册 > body text

Configure apache virtual machine + software download

WBOY
Release: 2016-11-30 23:59:38
Original
1213 people have browsed it

Step one:

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

Enter vhosts with ctrl+f in httpd.conf

Find that line and remove the # sign in front of it

The operation is as shown in the picture

Step 2:

Open the main configuration file of the virtual host

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

As shown in the picture

Preparations before starting configuration

Open httpd-vhosts.conf

Anything with # in it can be deleted

Just leave these two lines at the end, ()

As shown in the picture

Start configuration

NameVirtualHost *:80

Description:

NameVirtualHost // Virtual host configuration based on domain name (meaning: different domain names access different hosts)

There is at least

one space after NameVirtualHost

"*" // refers to all IP addresses of the server.

*:80 // Regarding the port setting, please note that it must be consistent with the port configured by listen in httpd.conf.

NameVirtualHost *:80 // Note that in the main configuration file of the virtual host, this sentence has only one line .

Main configuration section of virtual host:

Description:

VirtualHost space *:80 //Start of the main configuration section of the virtual host

//The main configuration section of the virtual host ends

ServerName space www.sina.com

Description: ServerName //Customized domain name, mainly used for testing the host

DocumentRoot "c:/sina" //The root directory setting of the host (website), note: This directory must exist

DirectoryIndex index.php index.html default.php //The default homepage setting of the host (website), multiple settings can be separated by spaces.

About directory permission settings:

//The configuration section of directory permissions is also similar to double labels.

Description: "Website directory" // must be consistent with DocumentRoot.

About permission settings:

Options //About server feature settings, Indexes | None

Indexes // When the default homepage does not exist, it will be displayed in a list

. Order Deny, Allow //Settings about the host access order

Deny //Access Denied

Allow //Allow access

There is a comma between these two words.

Order Deny, Allow //Access permissions are superimposed. The final result of this sentence is to allow all users to access

Order Allow, Deny //Access permissions are superimposed. The final result of this sentence is to deny access to all users

Order Allow , Deny

Allow from IP address //Two lines are superimposed, and ultimately only the specified IP is allowed to access

Order Deny, Allow

Deny from IP address //Two lines are superimposed, and ultimately only the specified IP access is denied

As shown in the picture

The difference between

indexes and none is as shown in the figure

The final configuration is like this, as shown in the picture

Step 3:

Native DNS resolution:

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

Add a self-defined domain name resolution.

Format: IP space Custom domain name

Method 1: 127.0.0.1 www.sina.com //Can only be accessed by yourself

Method 2: Local network card IP address www.sina.com //Externally, others can access

Finally restart apache

Enter www.daima.com and you will see the following results

Baidu cloud addresses of 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

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!