• 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

Linux 10.04, Paralles Plesk 11, Change apache port

GiedriusD

New Pleskian
I googled for the past hew hours just to found few sources which didn't help so far. My task is to change apache port to anything but 80.

I'm running newest Plesk 11.0.9 on Ubuntu 10.04 and so far I had a website working nicely on :80 port.

So far I have changed ports.conf which is included into apache2.conf

Code:
NameVirtualHost *:81
Listen 81

Also as told by comments in that file I have changed VirtualHost statement in
Code:
/etc/apache2/sites-enabled/000-default
It is a shortcut there so I just renamed that shortcut and added copy with with changed ports to :81

these changes alone makes apache listen on specified ports, I see It works! page.

But that is where my luck runs out, changing plesk port turns out to be not that easy.

I've followed this link which explains how to change port for Parallels Plesk Panel 11.x for Linux.

http://kb.parallels.com/en/114249

I've tried to put on :8080 but there is a tomcat server running so I have deleted the custom folder which was created in tutorial and redid steps to change port to :1234, of course I have changed apache2.conf and VirtualHosts files accordingly and I've downloaded random file from custom folder to check whether or not port has changed. Port changes are present but when I type domain.com:1234 after a long waiting I'm redirected to domain.com without any port Error 101 message.

I'm wondering does plesk takes templates from custom folder that was created, or the tutorial missing some crucial steps?

In any way I'm stuck very badly here and any help would be very much appreciated.
 
Last edited:
I've spend some more time, just redid everything again on a various ports and the outcome is always same, port where apache should be running redirects me straight to port :80.
I'm absolutely lost, if I just change apache conf file, port is responding with default apache page without any content, but from the moment I do these commands, redirection starts. And so far I have tried on ports :81, :1234, :8081, so I believe it doesn't matter what port I will choose.

Code:
# cd /usr/local/psa/admin/conf/templates
cp -a default custom
cd custom
find . -type f | xargs sed -r -i~ 's/\{?\$VAR->server->webserver->httpPort\}?/81/g'
find . -type f | xargs sed -r -i~ 's/\{?\$VAR->server->webserver->httpsPort\}?/82/g'

/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
 
Code:
find . -type f | xargs sed -r -i~ 's/\{?\$VAR->server->webserver->httpPort\}?/81/g'
find . -type f | xargs sed -r -i~ 's/\{?\$VAR->server->webserver->httpsPort\}?/82/g'

This might not be the best idea. Apache ports should be configurable via DB.

Do you have nginx enabled? If so, disable it first.
 
Thank you very much for your reply!

I've did in this way just because it was a tutorial how to change Apache port, the link to tutorial I have provided in my first post.

Anyway, by configurable via DB you mean something like this?
Code:
mysql -uadmin -p$(cat /etc/psa/.psa.shadow) -D psa -e'replace into misc (param, val) values ("http_port", 8080);'

The above line is from tutorial, which very new and the only one not ancient that I've managed to find.
http://geroldm.com/2013/05/install-varnish-on-plesk-11-server/

Yet, I have followed tutorial and the outcome was exactly the same, once I typed domain.com:1234 I was redirected back to domain.com.

Regarding nginx, no I do not have in enabled in plesk settings, and it is not even installed on a system yet. My first task is to make Apache perform on some other port in the same way as it was functioning on port 80.
 
Back
Top