Apache Virtual Host/Port multi-Open

Source: Internet
Author: User
Tags php server

Apache is powerful ah, a simple configuration can then open another port Web services.

I recently used XAMPP to set up PHP server. There are some special needs: the same code that needs to start a different port,

The protocol type provides the Web service to the client (HTTP/HTTPS).

HTTP Service Port multiple open

Configuration method:

Open httpd.conf in

Listen 80

Add the following

Listen 8080

Then open conf/extra/httpd-vhosts.conf.

Add to

<*:8080>ServerAdmin [email protected]documentroot "d:/develop/xampp/ Htdocs/dummy-host2.example.com "ServerName Dummy-host2.example.comerrorlog" Logs/dummy-host2.example.com-error_ 8080.log "Customlog" Logs/dummy-host2.example.com-access_8080.log "common</VirtualHost >

HTTPS Service Port multiple open

Configuration method:

Open it

httpds-vhosts.conf add

<VirtualHost*:8081>documentroot "D:/develop/xampp/htdocs" ServerName www.example.com:8081ServerAdmin [email Protected]errorlog] d:/ Develop/xampp/apache/logs/error_8081.log "Transferlog" D:/develop/xampp/apache/logs/access_8081.log "SSLEngine Onsslcertificatefile "CONF/SSL.CRT/SERVER.CRT" Sslcertificatekeyfile "Conf/ssl.key/server.key "<FilesMatch"\. (cgi|shtml|phtml|php) $ ">ssloptions +stdenvvars</FilesMatch><Directory"D:/develop/xampp/apache/cgi-bin">ssloptions +stdenvvars</Directory>browsermatch "MSIE [2-5]" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0customlog "d:/develop/ Xampp/apache/logs/ssl_request_8081.log ""%t%h%{ssl_protocol}x%{ssl_cipher}x \ "%r\" %b "</VirtualHost>

The above configurations are not mutually exclusive. Change to restart Apache service at the same time to start 80/8080,443/8081 service

Apache Virtual Host/Port multi-Open

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.