virtualhost, listening on a different port

rblue16

Member
Aug 5, 2014
5
0
1
cPanel Access Level
Reseller Owner
I have access to a WHM/cPanel setup from a client and would like to add a VirtualHost listening on a different port. I'm not very familiar with WHM/cPanel, but I am familiar with changing Apache config files. I know in order to accomplish what I want, I would need to change httpd.conf and add the following:

Listen <my_port>
<VirtualHost *:port>
...
</VirtualHost>

How could I do that the cPanel/WHM way? Would I need to create another WHM account, or could I use an existing one?

Thank you
 

rblue16

Member
Aug 5, 2014
5
0
1
cPanel Access Level
Reseller Owner
Thank you for your response, Michael.

From what I am understanding, I don't need to create another cPanel account, correct? Say that I have an account where it's pointing to: mydomain.com. What I want to do is to have mydomain.com:7000 pointing to a different folder, but it can be owned by the same user.

And yes, I do have root access to the server.

Thanks
 

rblue16

Member
Aug 5, 2014
5
0
1
cPanel Access Level
Reseller Owner
I forgot to ask: can I create a new virtualhost using these include files, or do they only change an existing virtualhost container? If the latter, I don't see a way to create a new virtualhost directive.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,222
463
You can actually modify the httpd.conf file directly if you need to, provided you use the Apache distiller after making changes. This is documented here:

Modify the httpd.conf file directly

As far as what custom entries to use, you may need to consult with a system administrator if you are not sure what custom modifications are required for your preferred setup.

Thank you.