• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Question Change Apache Port

Krooms

New Pleskian
Server operating system version
Ubuntu 24.04
Plesk version and microupdate number
18.0.71
Hello,

I want to use Caddy or Traefik as reverse proxy, so I want to change the listen ports for Apache from 80/443 to 8080/4443.
I already tried editing the ports.conf to
Code:
Listen 8080

<IfModule ssl_module>
        Listen 4443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 4443
</IfModule>
and the 000-default.conf to
Code:
<VirtualHost *:8080>

In Caddy I set a reverse proxy for the website domain to server-ip:4443 and tried server-ip:8080, also.

In both cases I see the default Apache2 page, when I visit the domain, but editing the index.html in Plesk has no effect.

Setting the reverse proxy to :4443 allows me to get a Let's encrypt certificate for the domain, setting it to :8080 gets me a failure while obtaining a certificate.

When I open the httpd.conf (#/var/www/vhosts/system/domain/conf/)for my website I can see that still port 443 and 80 are in use.
Code:
<VirtualHost IP:443 >
.
.
.
<VirtualHost IP:80 >

In the httpd.conf it is written that I should not modify this file and instead modify those two files:

#/var/www/vhosts/system/domain/conf/vhost.conf
#/var/www/vhosts/system/domain/conf/vhost_ssl.conf

But those two files do not exist.

Any help would be appreciated. I'm totally new to this and it took me days to figure this all out.
 
This setup is not supported out of the box.

You can use nginx on ports 80 and 443. Proxy the requests to your desired Caddy or Traefik then proxy to Apace on 7080/7081.
With this option, Plesk will handle the SSL certificates for you.
You can also set Apace to listen on localhost thus the Caddy/Traefik rules don't have to use your public IP.

Another approach, I don't recommend, is using a custom template.
 
Back
Top