Wampserver is an integrated environment software developed by Germans to implement Apache + PHP + MySql in a Windows environment. wampserver comes with sqlitemanager and phpMyAdmin. It provides users with a simple and easy-to-use graphical interface, more than 10 language packs, including simplified Chinese and English, can be switched freely. wampserver can be used for fast configuration in the server environment or local testing. You can download it from the wampserver official website.
This articleArticleThis section describes how to configure the cnpeng.org test environment in the wampserver environment of the Local Machine. Similarly, you can configure virtual hosts on the server to achieve coexistence of multiple sites.
-
- Start the wampserver service. Click the wampserver icon in the lower right corner to open the "httpd. conf" file under the Apache menu;
- Add the following at the bottom of the "httpd. conf" file: Code :
## start to configure the VM. The domain name is cnpeng.org and the directory is D:/Wamp/www/cnpeng.org/
namevirtualhost *: 80
# serveradmin = administrator email
serveradmin [url = mailto: admin@localhost.com] admin@localhost.com [/url]
# DocumentRoot = drive path of the home directory of the website
DocumentRoot D: /Wamp/www/cnpeng.org
# servername = the bound domain name portal
# That is: access requests through cnpeng.org
servername cnpeng.org
# Here is the access permission for configuring the website's main directory. Note the slash
options followsymlinks
AllowOverride none
order allow, deny
allow from all
# Redefine the wampserver root directory
Namevirtualhost *: 80
<Virtualhost *: 80>
# Serveradmin = administrator email
Serveradmin [url = mailto: admin@localhost.com] admin@localhost.com [/url]
# DocumentRoot = the drive letter path of the home directory of the website
DocumentRoot D:/Wamp/WWW
# Servername = bound domain name Portal
# That is, access requests through cnpeng.org
Servername 127.0.0.1
# Configure the access permission for the home directory of the website. Note the slash
<Directory "D:/Wamp/www/">
Options followsymlinks
AllowOverride none
Order allow, deny
Allow from all
</Directory>
</Virtualhost>
-
- Click wampserver in the tray to restart all services;
-
- Use NotePad to open the hosts file in the C:/Windows/system32/Drivers/etc/directory and add a line at the bottom:
127.0.0.1 cnpeng.org
OK! Enter the http://cnpeng.org in the browser, you can see that through HTTP has been accessed to the local D:/Wamp/www/cnpeng.org/directory.