【問題】虛擬主機與Windows+appserv架設XOOPS的網址問題



贊助商連結


bsup
2006-05-05, 04:35 PM
大家好:

最近有使用虛擬主機與Windows+appserv來架設XOOPS,均架設成功可以正常運作。
但是在加裝"樹枝狀選單後",發現小小的問題。:confused:

在虛擬主機中 http://abc/xoops/modules/news
可以正確轉到 http://abc/xoops/modules/news/

但在Windows+appserv中 http://xyz/xoops/modules/news
卻是"無法顯示網頁",需要在最後的網址加上"/"才能正確顯示。

而在架設Windows+appserv的本機電腦上,打入 http://xyz/xoops/modules/news
卻可以正確轉到 http://xyz/xoops/modules/news/

有利用appserv和alias的關鍵字尋找過,但是並沒有找到相關的資料,相信虛擬主機做的到的設定,應該在自行架設的部分應該也做得到...

感謝各位前輩的指教^^:)

贊助商連結


uason
2006-05-05, 11:56 PM
建議你把httpd.conf 設定檔
VirtualHost設定貼出來看看.
比較容易找出問題所在.

carloschen
2006-05-08, 09:29 AM
但在Windows+appserv中 http://xyz/xoops/modules/news
卻是"無法顯示網頁",需要在最後的網址加上"/"才能正確顯示。

而在架設Windows+appserv的本機電腦上,打入 http://xyz/xoops/modules/news
卻可以正確轉到 http://xyz/xoops/modules/news/

有利用appserv和alias的關鍵字尋找過,但是並沒有找到相關的資料,相信虛擬主機做的到的設定,應該在自行架設的部分應該也做得到...

感謝各位前輩的指教^^:)
你windows+appserv中server name設定為何?

bsup
2006-05-09, 08:18 AM
httpd.conf 設定檔 (http://ufowater.pcadsl.com/httpd.conf.txt)

**********

VirtualHost設定:
### Section 3: Virtual Hosts
#
# VirtualHost: 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://www.apache.org/docs/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 *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin [email protected]
# 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>

**********

windows+appserv中server name
#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName localhost
#ServerName http://ufowater.pcadsl.com/

這裡我試過把
#ServerName http://ufowater.pcadsl.com/
改為
ServerName http://ufowater.pcadsl.com/

但是,http://ufowater.pcadsl.com 在其他電腦會自動導向 http://ufowater.pcadsl.com/

http://ufowater.pcadsl.com/demo 還是會出現"無法顯示網頁",必須打入"/"

carloschen
2006-05-13, 09:04 AM
httpd.conf 設定檔 (http://ufowater.pcadsl.com/httpd.conf.txt)

**********

VirtualHost設定:
### Section 3: Virtual Hosts
#
# VirtualHost: 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://www.apache.org/docs/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 *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *:80>
# ServerAdmin [email protected]
# 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>

**********

windows+appserv中server name
#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
ServerName localhost
#ServerName http://ufowater.pcadsl.com/

這裡我試過把
#ServerName http://ufowater.pcadsl.com/
改為
ServerName http://ufowater.pcadsl.com/

但是,http://ufowater.pcadsl.com 在其他電腦會自動導向 http://ufowater.pcadsl.com/

http://ufowater.pcadsl.com/demo 還是會出現"無法顯示網頁",必須打入"/"
如果servername改成ufowater.pcadsl.com呢?

bsup
2006-05-15, 04:08 PM
啊!可以了!

我改成
#ServerName localhost
ServerName ufowater.pcadsl.com

就可以了!:circle:

感謝carloschen前輩^^