apache如何設置兩個站點?
apache要運行兩個網站:
第一網站埠為默認的80埠。第二個網站為8080埠。
請問在apache里怎麼設置?
《解決方案》
1.普及一下知識.虛擬主機實現方法.
A.一IP多域名.一般都用它.
B.一IP一域名.
C.一IP多埠.
2.你涉及到虛擬主機方面知識.因為很少使用埠.涉及到配置參數如下.你具體試試吧!
Listen ip
NameVirtualHost *
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
<VirtualHost *:8080>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /www/docs/dummy-host.example.com
ServerName dummy-host.example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
please try it above
《解決方案》
"*"要替換成ip地址嗎?
《解決方案》
建議LZ先去讀手冊http://man.chinaunix.net/newsoft/ApacheMenual_CN_2.2new/vhosts/index.html
有手冊不能解決的問題再來提問
《解決方案》
好的!:wink: