Hi,
I have a domain (example.com) which points to 123.456.789.012. If I visit Example Domain, everything is fine. My problem occurs when I try to visit http://123.456.789.012/. I expect to see the same content as visiting example.com directly but instead I am redirected to http://123.456.789.012/cgi-sys/defaultwebpage.cgi and am shown the default cPanel/Apache page.
I have checked /etc/httpd/conf/httpd.conf and see:
The obvious problem is that there are 2 VirtualHost's pointing for 123.456.789.012:80.
I have searched everywhere but I don't know what or where I am meant to modify in order for the first VirtualHost (the one pointing to /usr/local/apache/htdocs) to be removed.
As a test, I edited the httpd.conf file manually and removed that VirtualHost and restarted Apache. I was then able to access http://123.456.789.012/ and see the site, as expected.
I ran "/usr/local/cpanel/bin/apache_conf_distiller --update" and "/usr/local/cpanel/bin/build_apache_conf" and as before, the bad VirtualHost returned.
Does anyone know where in cPanel or WHM I am meant to go, or what files I need to edit on the filesystem, to remove this bad VirtualHost?
I have a domain (example.com) which points to 123.456.789.012. If I visit Example Domain, everything is fine. My problem occurs when I try to visit http://123.456.789.012/. I expect to see the same content as visiting example.com directly but instead I am redirected to http://123.456.789.012/cgi-sys/defaultwebpage.cgi and am shown the default cPanel/Apache page.
I have checked /etc/httpd/conf/httpd.conf and see:
Code:
NameVirtualHost 123.456.789.012:80
<VirtualHost 123.456.789.012:80>
ServerName server.example.com
DocumentRoot /usr/local/apache/htdocs
ServerAdmin [email protected]
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
</VirtualHost>
<VirtualHost *>
ServerName server.example.com
DocumentRoot /usr/local/apache/htdocs
ServerAdmin [email protected]
<IfModule mod_suphp.c>
suPHP_UserGroup nobody nobody
</IfModule>
</VirtualHost>
<VirtualHost 123.456.789.012:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/example/public_html
ServerAdmin [email protected]
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/example.com combined
CustomLog /usr/local/apache/domlogs/example.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
## User example # Needed for Cpanel::ApacheConf
UserDir enabled example
<IfModule mod_suphp.c>
suPHP_UserGroup example example
</IfModule>
<IfModule !mod_disable_suexec.c>
<IfModule !mod_ruid2.c>
SuexecUserGroup example example
</IfModule>
</IfModule>
<IfModule mod_ruid2.c>
RMode config
RUidGid example example
</IfModule>
ScriptAlias /cgi-bin/ /home/example/public_html/cgi-bin/
# To customize this VirtualHost use an include file at the following location
# Include "/usr/local/apache/conf/userdata/std/2/example/example.com/*.conf"
</VirtualHost>
I have searched everywhere but I don't know what or where I am meant to modify in order for the first VirtualHost (the one pointing to /usr/local/apache/htdocs) to be removed.
As a test, I edited the httpd.conf file manually and removed that VirtualHost and restarted Apache. I was then able to access http://123.456.789.012/ and see the site, as expected.
I ran "/usr/local/cpanel/bin/apache_conf_distiller --update" and "/usr/local/cpanel/bin/build_apache_conf" and as before, the bad VirtualHost returned.
Does anyone know where in cPanel or WHM I am meant to go, or what files I need to edit on the filesystem, to remove this bad VirtualHost?