Apache Configures multiple listening ports

Source: Internet
Author: User

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

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.