• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

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.
 
You can change the Apache2 Port in the "ServiceNodeConfiguration" table of the "psa" database.
After that you need to rebuild all webserver configuration files and should be good to go. (you can use the Configurations Troubleshooter extension for that)

But just so I've mentioned it, this is completely unsupported by Plesk, so do at your own risk.
There is a chance, that a Plesk upgrade may reset/revert that configuration again.
 
So the easiest and safest way is to use nginx as proxy?

Installing the nginx package via plesk will reconfigure apache to use ports 7080/7081?
 
Back
Top