Use XAMPP to build detailed steps to run a PHP virtual host, xampp a virtual host _php tutorial

Source: Internet
Author: User

Use XAMPP to build detailed steps to run a PHP virtual host, xampp the virtual host

Recently, the new xampp such a software to build their own web development environment, installation is natural to virtual several directories to put their own projects, now how to build a Web server environment in XAMPP to create a virtual host process summary sharing, the general process is divided into three steps , as follows:
First step: Open the C:/windows/system32/drivers/etc/hosts file with Notepad (Win7 Hosts file location:%systemroot%\system32\drivers\etc),
Under localhost I added a, so that each time in the browser to enter the, it is no longer to the network DNS parsing, but directly resolved to local. So in fact you can not visit, of course, you may also set yourself up as if you like.
Step two: because I xampp is on the D-disk: Open the d:/xampp/apache/conf/httpd.conf file with Notepad, I found the include "conf/extra/httpd-vhosts.conf", Confirm that the previous # is not added.
Step Three: D:/xampp/apache/conf/extra/httpd-vhosts.conf, add the following code snippet to the back:

  DocumentRoot "D:/tuolarapp" ServerName ""

Or the detailed points are as follows:

  DocumentRoot "D:/tuolarapp" ServerName ""
   options Indexes Followsymlinksserveralias *.2.comerrorlog Logs/ logs/ commonallowoverride allorder allow,denyallow
    from all

Then save and restart Apache so that when I enter in the browser, it will automatically parse the site into the D:/tuolarapp directory. This input is more convenient, the key self-feeling will be better.

for each of the above configuration elements do the following description:
: localhost for the site domain name, 80 port can not write, if you change to another port to write on, but also to modify the httpd.conf in the listening port number: Listen 80
ServerName:Website domain name, ibid., must fill in;
DocumentRoot:Website program main directory, must fill in;
Options Indexes followsymlinks:Display directory list, if you want to set the security point can be indexes removed, do not display directory list, not necessary;
Alias:can be accessed through multiple domain names;
errorlog:Where the error log file is stored;
Customlog:Access log file storage location;
Resinconfigserver:Resin Server listening port, I here is the Local:, if there are more than one machine as a server, modified to the corresponding IP address can be;
The above will be the virtual host configuration completed, a Web site corresponding to a Tag
This completes the XAMPP implementation of the multi-site application.
What if you want to run the site under a different port?
Very simple: In the "httpd.conf" main configuration file, set up multiple ports, such as listen 8081

How to use XAMPP to build a virtual host running PHP, I believe that later encountered similar problems, it will not be difficult to everyone, I hope you will like this article. true techarticle use XAMPP to build the detailed steps to run the PHP virtual host, XAMPP virtual host recently, the new XAMPP so a software to build their own web development environment, the installation of natural to virtual a few eyes ...

  • Related Article

    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: 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.