【問題】XAMPP的 Virtual Host 問題



贊助商連結


sam369
2006-11-04, 06:31 AM
我是用XAMPP1.5.4a架在WIN 2003上但就是沒辦法同一IP對兩個網域.也都看過找過很多設定說明(也爬過文)但就是不行~煩請各位大大看是哪裏問題~PS:一個網域是OK的~一個網域是更改這個檔案httpd.conf 但設兩個網域是更改這個檔案httpd-vhosts.conf ~如下 (DNS是沒問題狀態下然後httpd.conf是沒更改狀態下)


#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost xxx.xxx.xxx.xxx:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost xxx.xxx.xxx.xxx:80>
## ServerAdmin [email protected]
## DocumentRoot /xxx/abc
## ServerName abc.xxx.idv.tw
## ServerAlias *.xxx.idv.tw
## ErrorLog log/xxx.idv.tw-error_log
## CustomLog log/xxx.idv.tw-access_log common
##</VirtualHost>

##<VirtualHost xxx.xxx.xxx.xxx:80>
## ServerAdmin [email protected]
## DocumentRoot /xxx/def
## ServerName def.xxx.idv.tw
## ErrorLog logf/xxx.idv.tw-error_log
## CustomLog log/xxx.idv.tw-access_log common
##</VirtualHost>






XAMPP基本套件如下
Apache HTTPD 2.2.3, MySQL 5.0.24a, PHP 5.1.6 + 4.4.4 + PEAR + Switch, MiniPerl 5.8.7, Openssl 0.9.8d, phpMyAdmin 2.9.0.1, XAMPP Control Panel 2.3, Webalizer 2.01-10, Mercury Mail Transport System für Win32 und NetWare Systems v4.01a, FileZilla FTP Server 0.9.18, SQLite 2.8.15, ADODB 4.91, Zend Optimizer 3.0.1, XAMPP Security. SSI bug fixed. For Windows 98, 2000, XP.



謝謝各位大大

贊助商連結


sam369
2006-11-04, 08:15 PM
把#拿掉 apache就無法啟動耶!!

NameVirtualHost xxx.xxx.xxx.xxx:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin [email protected]
DocumentRoot /xxx/abc
ServerName abc.xxx.idv.tw
ServerAlias *.xxx.idv.tw
ErrorLog log/xxx.idv.tw-error_log
CustomLog log/xxx.idv.tw-access_log common
</VirtualHost>

<VirtualHost xxx.xxx.xxx.xxx:80>
ServerAdmin [email protected]
DocumentRoot /xxx/def
ServerName def.xxx.idv.tw
ErrorLog logf/xxx.idv.tw-error_log
CustomLog log/xxx.idv.tw-access_log common
</VirtualHost>