• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question adding <VirtualHost with alternative port in Apache config

T0nio

New Pleskian
Greetings,

I have searched the forum but have not found a unique solution for my question: I'm on Plesk Onyx and have nginx activated. I would like to add "<VirtualHost xxx.xxx.xxx.xxx:8004>" and "<VirtualHost xxx.xxx.xxx.xxx:8005>" entries to the Apache config to have Apache listening additionally on these ports and directing requests to a certain directory containing PHP files.
Editing the /var/www/vhosts/system/mydomain.com/conf/httpd.conf is not an option for known reasons ("#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,") and adding the entries to a vhost.conf in that directory results in an error as the include directive sits within the default "<VirtualHost ..." entry. I hope I have not overlooked an obvious solution and have expressed myself clearly.

Thank you very much in advance

Tonio
 
Thanks Igor for the answer, yes I have. I have read it once again right now and still don't get it. vhost.conf, vhost_ssl.conf and vhost_nginx.conf which relate to the "Additional directives" entry fields in Plesk (Plesk actually creates the .conf files from that content) are all included in the default sections: <VirtualHost xx.xx.xx.xx:7081 > (vhost_ssl.conf into httpd.conf), <VirtualHost xx.xx.xx.xx:7080 > (vhost.conf into httpd.conf) and likewise for vhost_nginx.conf which is then included in the corresponding "<VirtualHost xx.xx.xx.xx:443/80" sections in nginx.conf. And I get an error when I add my "<VirtualHost xxx.xxx.xxx.xxx:8004>" section in there because it is already within a "<VirtualHost xxx.xxx.xxx.xxx:>" section. How do I get my stuff included in these files on the "top level", outside the default "<VirtualHost xxx.xxx.xxx.xxx:*>" sections?
 
Well, I have now made my changes manually to httpd.conf and my project works fine as expected. With the downside that the changes will be lost, when editinng things from withing Plesk. There HAS to be a way to achieve this from within Plesk - or isn't this possible?
 
Back
Top