Apache虛擬機器主機/連接埠多開

來源:互聯網
上載者:User

標籤:env   cgi   browser   admin   htm   互斥   ica   服務   document   

Apache就是強大啊,簡單配置一下就可以再開啟另一個連接埠的web服務。

筆者最近使用XAMPP架設php服務端。有一些特別的需求:同樣的代碼,需要開始不同的連接埠,

協議類型提供web服務給用戶端(http/https)。

http服務連接埠多開

配置方法:

開啟httpd.conf在

Listen 80

下面添加

Listen 8080

然後開啟conf/extra/httpd-vhosts.conf

添加

<VirtualHost *: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服務連接埠多開

配置方法:

開啟

httpds-vhosts.conf添加

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

 

 以上配置彼此對立不互斥。修改以後重啟apache服務,即可同時開始80/8080,443/8081服務

Apache虛擬機器主機/連接埠多開

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.