how to add multiple ports for apache + add some custom vhost with easyapache

bryan.kewl

Member
Feb 23, 2011
5
0
51
Hi

I know how to make apache to listen to multiple ports, or add a vhost via changing the conf files directly, but need to know if there is a way to achieve it from easyapache UI in cpanel/WHM.

thanks
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
There is not a way to have Apache listen on multiple ports in cPanel or WHM interfaces. You might want to open up a feature request in regards to having this available in WHM if the feature hasn't already been suggested at the following location:

Feature Requests for cPanel and WHM

I cannot foresee any point when it will be doable for cPanel itself, since the user should not be adding or configuring Apache ports on their own account.

In regards to customizing VirtualHost entries as well, again this is not available in WHM > Apache Configuration > Include Editor area, so it would make a good feature request to have the VirtualHost entries there to customize. You'll have to decide if you mean /var/cpanel/userdata/username/domain.com entries or whether you are wanting to have /usr/local/apache/conf/userdata ones (or possibly if you want both).
 

bryan.kewl

Member
Feb 23, 2011
5
0
51
thanks,

so basically easyapache is just for normal users. If I add the settings via changing the config files directly, will they stay or easyapache will erase them?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
If you make changes to the configuration file directly for the VirtualHost section of /usr/local/apache/conf/httpd.conf file, those changes will not stay given it says this at the top of each entry:

# DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
If you modify the template file directly as /var/cpanel/templates/apache2/vhost.default, this will also be overwritten. To modify the /var/cpanel/templates/apache2/vhost.default file, that must be copied to /var/cpanel/templates/apache2/vhost.local and then vhost.local file edited instead to retain the changes.

Your options would be to either use the include files placed into /usr/local/apache/conf/userdata/ location or by editing the entries at /var/cpanel/userdata/username/domain.com location (where username is the cPanel username and domain.com is the domain name).

For details on adding include files at /usr/local/apache/conf/userdata location, please view the following documentation:

Changes Contained within a VirtualHost Directive