Changing port numbers on existing Virtual Hosts
Good morning everyone.
I would appreciate some help on this problem.
I am trying to get Apache to Listen on port 8080. I have been able to change this via "Tweak Settings" in WHM/Cpanel.
I also need to change all references to the old Port 80 to Port 8080 in existing Virtual Hosts as shown in the excerpt from the httpd.conf file, which I understand should not be modified directly, as shown below:
I understand that Virtual hosts can be modified by creating a new conf file to be included in the following path: " /etc/apache2/conf.d/userdata/ssl/2_4/username/example.com/*.conf" repeated for each domain. The question is what would be the instruction within the file(s) to effect this change or if this is not the right method, how do I do this. Some instructions I have come across on the internet suggest making this change in the following file: /etc/apache2/sites-enabled/000-default.conf. However there is no such directory/file on my system. I would appreciate some help. I am running a VPS server with Centos 6.9, Apache 2.4.9 and CPanel 66 installed with root access. Thanks
ServerName example.com
ServerAlias mail.example.com www.example.com
DocumentRoot /home/username/public_html
ServerAdmin webmaster@example.com
UseCanonicalName Off
CustomLog /etc/apache2/logs/domlogs/example.com combined
ServerName example2.com
ServerAlias mail.example2.com www.example2.com
DocumentRoot /home/username/public_html
ServerAdmin webmaster@example2.com
UseCanonicalName Off
CustomLog /etc/apache2/logs/domlogs/example2.com combined
ServerName example3.com
ServerAlias mail.example3.com www.example3.com
DocumentRoot /home/username/public_html
ServerAdmin webmaster@example3.com
UseCanonicalName Off
CustomLog /etc/apache2/logs/domlogs/example3.com combined
I understand that Virtual hosts can be modified by creating a new conf file to be included in the following path: " /etc/apache2/conf.d/userdata/ssl/2_4/username/example.com/*.conf" repeated for each domain. The question is what would be the instruction within the file(s) to effect this change or if this is not the right method, how do I do this. Some instructions I have come across on the internet suggest making this change in the following file: /etc/apache2/sites-enabled/000-default.conf. However there is no such directory/file on my system. I would appreciate some help. I am running a VPS server with Centos 6.9, Apache 2.4.9 and CPanel 66 installed with root access. Thanks
-
Solved 0 -
Hello Andy, You shouldn't need to change the port number in the existing virtual hosts after modifying the port globally via "WHM >> Tweak Settings". Thank you. 0
Please sign in to leave a comment.
Comments
2 comments