这不是一个问题,但想知道为什么会发生这种情况。
我们有一个运行WHM的专用服务器。 如果我直接通过IP地址访问服务器,我会自动redirect到
http://xx.xxx.xx.xxx/ cgi-sys / defaultwebpage.cgi
我知道如何编辑这个页面(这不是问题)
我只是好奇,为什么我redirect到这个.cgi页面,而不是简单地保持@
xx.xxx.xx.xxx/并查看我的默认“着陆页”,如果你喜欢。
我可以更改什么设置,以便如果有人访问我的服务器IP,他们不会被redirect到xx.xxx.xx.xxx / cgi-sys / defaultwebpage.cgi
例如,如果您访问173.194.37.104(谷歌),您查看谷歌的主页,但url保持不变。
希望这是有道理的。
谢谢
不知道你是否仍然想搞清楚,但你需要编辑你的httpd.config。 如果您在VPS或专用服务器上,则应该可以在以下位置find它。 /etc/httpd/conf/httpd.config
find它看起来像这样的地方。 通常被“不编辑这个”
<VirtualHost xxx.xxx.xxx.xxx:80> ServerName domain.com ServerAlias www.domain.com DocumentRoot /home/domain/public_html ServerAdmin [email protected] UseCanonicalName Off CustomLog /usr/local/apache/domlogs/domain.com combined CustomLog /usr/local/apache/domlogs/domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." ## User domain # Needed for Cpanel::ApacheConf <IfModule mod_suphp.c> suPHP_UserGroup domain domain </IfModule> <IfModule !mod_disable_suexec.c> SuexecUserGroup domain domain </IfModule> ScriptAlias /cgi-bin/ /home/domain/public_html/cgi-bin/ </VirtualHost>
我有同样的行为,我会打我的头,因为这个:(你之所以得到这个是因为/etc/httpd/htdocs/index.html IS的内容
<html><head><META HTTP-EQUIV="refresh" CONTENT="0;URL=/cgi-sys/defaultwebpage.cgi"></head><body></body></html>
我需要2天的时间来解决这个问题。 如果你设法在你的服务器上login你的请求,但是你要求的名字(在我们的例子中是IP)并不存在于apache虚拟主机中,那么apache将会响应这个文件。 😉