服务器显示我的VPS主机上的默认CGI页面

即使将index.php放在root / public_html文件夹中,我也得到了默认的cgi [ http://xx.xxx.xxx.xxx/cgi-sys/defaultwebpage.cgi]page 。

我的VPS上的Httpd Conf具有以下条目

<VirtualHost 127.0.0.1:80 *> ServerName server1.mydomain.com ServerAlias cpanel.* whm.* webmail.* webdisk.* autodiscover.* autoconfig.* DocumentRoot /usr/local/apache/htdocs ServerAdmin [email protected] <IfModule mod_suphp.c> suPHP_UserGroup nobody nobody </IfModule> RewriteEngine On <IfModule core.c> SSLProxyEngine On </IfModule> RewriteCond %{HTTP_HOST} ^cpanel\. RewriteCond %{HTTPS} on RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P] RewriteCond %{HTTP_HOST} ^webmail\. RewriteCond %{HTTPS} on RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P] RewriteCond %{HTTP_HOST} ^whm\. RewriteCond %{HTTPS} on RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P] RewriteCond %{HTTP_HOST} ^webdisk\. RewriteCond %{HTTPS} on RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P] RewriteCond %{HTTP_HOST} ^cpanel\. RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P] RewriteCond %{HTTP_HOST} ^webmail\. RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P] RewriteCond %{HTTP_HOST} ^whm\. RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P] RewriteCond %{HTTP_HOST} ^webdisk\. RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P] RewriteCond %{HTTP_HOST} ^autodiscover\. RewriteRule ^[^?]*(\?.*)? http://127.0.0.1/cgi-sys/autodiscover.cgi [P] RewriteCond %{HTTP_HOST} ^autoconfig\. RewriteRule ^[^?]*(\?.*)? http://127.0.0.1/cgi-sys/autoconfig.cgi [P] UseCanonicalName Off </VirtualHost> 

我需要做什么修改,使专用的IP从public_html文件夹加载index.php。

请帮忙

您的documentroot将需要从DocumentRoot / usr / local / apache / htdocs更改

 DocumentRoot /root/public_html 

/根是一个不寻常的地方有公共的HTML,如果你有selinux运行,你将被阻止访问它,检查sestatus如果有疑问

如果您还没有运气,请尝试像下面这样的基本虚拟主机,然后逐渐更改上面的条目,直到您发现问题

 <VirtualHost xx.xx.xx.xx:80> ServerName server1.mydomain.com DocumentRoot /root/public_html DirectoryIndex index.php <Directory /root/public_html> order allow, deny allow from all </Directory </VirtualHost>