Used to do on the PC, are configured a port, a whole bunch of virtual directories:
In the \conf\extra
next find httpd-vhosts.conf
This configuration file, like the following configuration on the line, listen to 80 port, access to the corresponding servername can. Sure, look at this httpd.conf
.
# Virtual Hostsinclude conf/extra/httpd-vhosts.conf
Open No.
<*:80>documentroot "D:\www\Apache2.2\htdocs\zjzhome" ServerName 127.0.0.2</VirtualHost><*:80> documentroot "D:\www\Apache2.2\htdocs\TravelNoteAMap" ServerName 127.0.0.3</ VirtualHost>
Now do the mobile phone, if you want to use a mobile phone to look at the effect, above simply not. So the configuration listens to multiple ports.
In httpd.conf
, set up to listen on multiple ports
Listen 80Listen 8888Listen 8011
Then find your own set of DocumentRoot, all the virtual directories are set under him.
DocumentRoot "D:/www/apache2.2/htdocs"
Then httpd-vhosts.conf
configure the directory and address in:
namevirtualhost *:8011 < *:8011>ServerName localhost:8011documentroot "D:\www\Apache2.2\htdocs\8011" </VirtualHost>namevirtualhost *:8888< *:8888 > ServerName localhost:8888documentroot "D:\www\Apache2.2\htdocs\8888" </ VirtualHost >
OK, the computer and the mobile phone under a network segment, Access can.
New Blog Address: http://zjzhome.sinaapp.com/#/blog/article/apache-ports
Apache Configures multiple listening ports