Windows下Apache連接埠配置

來源:互聯網
上載者:User

標籤:

找到設定檔 httpd.conf  並用編輯器開啟。

 

 

在添加連接埠之前,我們可以查看連接埠是否已經被開啟,命令如下:

window查看連接埠:

# 查看所有連接埠
$ netstat -n -a
# 查看 8081 連接埠是否被佔用
$ netstat -aon|findstr "8081"

  

Mac查看連接埠:

lsof -i tcp:port

  確認某個連接埠未被佔用,則設定該連接埠。我們在 httpd.conf 設定檔裡添加連接埠,並開啟虛擬機器主機。

 

添加連接埠:

Listen 8081

 

開啟虛擬機器主機:

# Virtual hosts #Include conf/extra/httpd-vhosts.conf 

  改為如下開啟虛擬機器主機。

# Virtual hosts Include conf/extra/httpd-vhosts.conf 

  儲存並關閉 httpd.conf 檔案。

然後打 conf/extra/httpd-vhosts.conf 檔案,配置連接埠資訊:

<VirtualHost *:8081>     ServerAdmin [email protected]     DocumentRoot "C:/PhpDocRoot/Site1"     ServerName localhost     ServerAlias localhost     ErrorLog "logs/dummy-host.localhost-error.log"     CustomLog "logs/dummy-host.localhost-access.log" common     <Directory "C:/PhpDocRoot/Site1">         Options Indexes FollowSymLinks         AllowOverride None         Order allow,deny         Allow from all     </Directory> </VirtualHost>

  

Windows下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.