The most detailed WAMP configuration virtual domain steps in history

Source: Internet
Author: User

Wamp configuration Virtual domain name is the foundation of web development, early in the first time, configuration wamp virtual domain name is quite big, often encounter server connection is not, change to change to change not good, find all over the internet did not find a comprehensive method, to change are not good, was the company's old birds tease, and later found a time to carefully study the next, I wrote a detailed configuration process, is now shared out, hoping to help beginners.


WAMP environment Configuration Virtual domain Name method:


1. Open the Apach mode_rewrite function module


Open the httpd.conf in the bin and find Rewrite_module modules/mod_rewrite.so.

Get rid of the front #



2. Introduction of the Http-vhosts.conf file (the practice is to find this line to remove the comments)


Still in the open httpd.conf, and then find the include confi/extra/httpd-vhosts.conf this line also remove the comment #,



3. Modify the VirtualHost configuration to add the desired domain name


The path shown in this line (Include confi/extra/httpd-vhosts.conf) is modified httpd-vhosts.conf


Here's an example, as an example.

Copy Namevirtualhost *:80 This line (bound to Apach port, port 80 is the default listening port for Apach start)


In the first paragraph of this example, the comment that precedes each line is removed, the line is configured, and the copy looks like this


Namevirtualhost *:80//Don't forget the line.

<virtualhost *:80>

ServerAdmin//This line is a domain name management account, can be written casually

DocumentRoot//Access this domain name to specify the working directory, this is the Wamp www folder under your address, copy your location path and replace \

ServerName//The name of the virtual domain you want to start with www

Errolog//log These two lines can be erased

Customlog//log These two lines can be erased


</VirtualHost>


4. Open access permissions for the working directory you set up

Go back to httpd.conf file, search for 188 lines, copy this paragraph

Next to the 3rd step, the results are as follows



Namevirtualhost *:80

<virtualhost *:80>

ServerAdmin

DocumentRoot working Directory

ServerName

</VirtualHost>

<directory working directory >//change here to your working directory

Options FollowSymLinks

Allowoverrride None

Order Deny.allow

Enable from all//modify Deny to allow everyone to access the working directory

</directory >



5. Modify the host file in the window System


This file is under SYSTEM/WINOW32/DRIVER/ETC.

Directly in the Add


127.0.0.1 your own www starting with the name of the virtual domain



Workflow is: When we enter www this domain name in the browser, our host has assigned this address to our local IP127.0.0.1, Apach service will go to the default start in httpd-vhosts.conf file search virtual directory configuration, Match the domain name you just accessed in the browser, and then assign the working directory to your configuration directory.



6. After you complete the above 5-step configuration restart Apach, verify that under your working directory you create a new test.php file, echo something in it, and then visit the browser


Enter www your domain name. com/test.php, he will output your echo content, the configuration is in effect.



Very useful Tips:wamp environment startup failure handling method


If you encounter a Wamp environment can not start

Control Panel, System and security management tools->windows logs--application, open here to see Wamp environment Apche start failed log (red warning), according to the prompt error changes, change and restart Apach, refresh the log, The error log is gone.


This article from "Barking Dog blog" blog, declined reprint!

The most detailed WAMP configuration virtual domain steps in history

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.