How to configure multi-site access using Appserv

Source: Internet
Author: User

In the previous Appserv tutorial, I introduced the Appserv configuration and installation using the tutorial, Appserv as a PHP integrated environment installation package, can achieve a variety of functions, configuration Appserv implementation of multi-site functionality can be convenient for the PHP development team to debug multiple PHP sites in real time, Friends and relatives to me how to use Appserv configuration multi-site problems, through the practice of verification, I take the form of appserv tutorials to answer.

  Appserv Configuring multi-site Tutorials First step: Download Appserv and install

I downloaded the appserv-win32-2.5.10 version, after downloading directly double-click and follow the prompts to install.

  Appserv Configuring multi-site Tutorials Step Two: Modify the Windows system Hosts file

My Appserv installation environment is windowsxp, why first to modify the Hosts file? This is because the general Appserv installation and debugging are on this machine, when using Appserv configuration Multi-site, the domain name point is 127.0.0.1, you need to map different domain names, or even if the configuration is not accessible, unless you have a public network IP, and is mapped through DNS.

Locate the Windows\system32\drivers\etc\hosts file and open it, locate 127.0.0.1 localhost, and add the test site domain name that you want to map, such as

1
2
3
127.0.0.1 www.leapsoul.cn

127.0.0.1 www.phptest.cn

Save Hosts file

  Appserv Configuring multi-site Tutorials Step three: Modify the Apache configuration file to enable the virtual host configuration

Locate the apache2.2\conf directory in the Appserv installation directory, open the Apache configuration file httpd.conf, and find the # Virtual hosts

1 #Include conf/extra/httpd-vhosts.conf

# removal in.

Because the Apache configuration in the Appserv configuration is present in a custom manner, the above statement enables the virtual host configuration on behalf of Apache. At the same time, the Appserv multi-site configuration function is implemented as a virtual host, and you can combine the httpd configuration file

1 #LoadModule Vhost_alias_module modules/mod_vhost_alias.so

#去除 (after my test, in fact, this Apache module plus does not load very much)

  Appserv Configuring the Multi-site tutorial Step Fourth: Modifying the Apache Virtual host configuration

Open the conf/extra/httpd-vhosts.conf configuration file, the file itself has two virtual host configuration records, as long as a slight modification.

ServerAdmin (e-mail address), DocumentRoot (Web root directory, I set the directory for "c:/appserv/www/wwwleapsoulcn/" and c:/appserv/www/wwwphptestcn/), The ServerName (site domain name information), Serveralias (site domain name alias) configuration options are set to the information you need to set. Appserv Configure multi-site instances as follows

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
ServerAdmin your e-mail address BR style= "MARGIN-TOP:15PX;" >documentroot "c:/appserv/www/wwwleapsoulcn/"
serveralias www.leapsoul.cn
customlog "Logs/dummy-host.x-access.log" common

<virtualhost *:80>
serveradmin your email address
documentroot "c:/appserv/www/wwwphptestcn/"
errorlog "Logs/dummy-host2.x-error.log"
customlog "Logs/dummy-host2.x-access.log" COMMON
</VIRTUALHOST>

  Appserv Multi-site Configuration tip: If you are configuring multiple virtual hosts at the same time, make sure that the first virtual host record is not missing serveralias option, otherwise the configuration will not succeed.

Finally save the conf/extra/httpd-vhosts.conf configuration file.

When restarting Apache, be careful to restart Apache in cmd mode via the net start apache2.2 or net stop apache2.2 mode.

At this time through the IE domain name can be accessed using the Appserv configuration of multiple sites.

The above method is to use Appserv to configure the multi-site access function using the domain name method, if the IP is also possible to implement this configuration function, the difference is that different ports need to be used. In addition to the original above httpd.conf configuration, you need to Listen the statement, add the port to listen to, such as

1
2
Listen 8080
Listen 8081

The <virtualhost *:80> in the conf/extra/httpd-vhosts.conf configuration file is then modified to <virtualhost corresponding IP: the corresponding listening port >, the other configuration is the same.

Finally, delete the configuration previously set in the Hosts file and restart the Apache service.

At this point, how to use the Appserv domain name or IP address to implement the configuration of multi-site access tutorial is finished.

Empty square pressure has exhausted Prev rise 0.03%:http://licai.daiyuline.com/caijingxinwen/309.html

Interest rate hike expected cooling US finger weaken, gold will continue to go higher: http://licai.daiyuline.com/caijingxinwen/308.html

How to configure multi-site access using Appserv

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.