Set the primary IP address to display the default Apache page for my cPanel environment? Print

  • 0

How to set the primary IP address to display the default Apache page for my cPanel environment?

How do I set the primary IP address to display the default Apache page for my cPanel environment?
When cPanel is installed, the primary IP address for the server should display a default Apache page within a web browser. When you begin adding websites through cPanel, the first website added may start displaying for the primary IP address. This can be fixed to display the default Apache page by manually modifying the apache configuration file on the server.

NOTE: The following instructions involve updating configuration files directly on your server. If you are not familiar with updating configuration files, please contact support for assistance.

To restore the default Apache page, please follow these steps:
Log into your cPanel web server via Secure Shell (SSH).
Located the httpd.conf file using the following command:
located httpd.conf
Open the httpd config file found in step 2 using the following command:
pico /usr/local/apache/conf/httpd.conf
Find the first VirtualHost container in the file. It will look similar to the following: (xx.xx.xx.xx will be the primary IP address of your server)

BytesLog domlogs/cptemp.safesecureweb.com-bytes_log
ServerName cptemp.safesecureweb.com
DocumentRoot /usr/local/apache/htdocs
Above this section, add the following:

ServerAlias xx.xx.xx.xx
ServerAdmin admin@domain.com
DocumentRoot /usr/local/cpanel/htdocs
ServerName xx.xx.xx.xx
Save and exit the file.
Test the config file to ensure the text you entered is properly formatted using the following command: /etc/init.d/httpd configtest
Assuming the test returns the message Syntax OK, restart Apache using the following command: /etc/init.d/httpd restart
The restart of Apache will make your websites unavailable for a few seconds.


Was this answer helpful?

« Back

Powered by WHMCompleteSolution


["\r\n