• 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

Failed to succefull change apache's port in plesk 10.3

H

HristosH

Guest
Failed to change apache's default port in plesk 10.3

Hello

i have switched to 10.3 plesk in a ubuntu 8.04 x64 linux and i followed the instructions in apache-configuration pdf of how to change apache's port.

so i setup in domainVirtualHost.php , that is located in
/opt/psa/admin/conf/templates/default/domain/domainVirtualHost.php
, by changing the variable
from
$VAR->server->webserver->httpPort
to

so far i didn't find that this ports is using by other service in plesk or virtuozzo and i did a reconfigure of all of my domains port with this command .

/opt/psa/admin/bin/httpdmng --reconfigure-all
/etc/init.d/apache2 force-reload
/etc/init.d/apache2 restart

the restart option gave me a warning
[Sat Aug 20 16:41:35 2011] [warn] VirtualHost 178...[server i.p.]...:8080 overlaps with VirtualHost 178..[server i.p.]....:8080, the first has precedence, perhaps you need a NameVirtualHost directive

i did a netstat to check if apache using the 8080 port and the report was that

netstat -lpn | grep apache2
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 12173/apache2
tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 12173/apache2

so it did not changed the port from 80 to 8080 ( 0 0.0.0.0:80 ) .am i missing something in pdf instructions ?

I would like notice that in the plesk apache-configuration there is not any description on how can you set different ports on different domains. there is by default in apache's configuration this option !!!!!!!

p.s. i am trying to setup varnish in front of apache server for better perfomance .Also , if there is any guide how to setupa varnish under plesk 10.3 i will be glad if you give a link or a detailed guide :)
 
Last edited by a moderator:
of cource i have read it . i think i explained it in my post.

as i said above i changed the two (2 ) values in domainVirtualHost.php

$VAR->server->webserver->httpPort

to

"8080"

and nothing happens .



now i logged to my server and i did a :

locate domainVirtualHost.php


and i found that i have two (2) domainVirtualHost.php



/opt/psa/admin/conf/templates/default/domain/domainVirtualHost.php
/opt/psa/admin/conf/templates/load_balancing/domain/domainVirtualHost.php


must i change both of them ? after of these changes must i run any command ? pls help me
 
Last edited by a moderator:
has anybody succefull changed the apache's default port without warnings or problems ?

is there any working solution on this issue ?
 
thank you for the answer

this solution is for 10.2 plesk . it works in 10.3 whitout brake anything ? i am asking it because it maipulates the whole psa database and i am afraid if there is any problem with compatibilty with 10.3.

it will be nice if we have an official answer because i do not know if this will brake feature updates
 
I have testit with plesk 10.3.1 in my test server and works. In other I think that you don't have any other method if too the documentation don't works ... when I do the reload of the setting nothing warn or error I see.

You can try ... there is only 1 value ... if don't works, restore again the old 80 port into DB.
 
thanks again . it worked , also worked the reverse from 8080 port to 80 .

it gave some errors but was ok after i rerun the command .

still remains the problem to change the apache port only on one specific domain ,since this is a main feature on apache
 
ok,
if you want to use a sutom apache port for only one vhost just copy all from
/var/www/vhosts/example.com/conf/13643241700.92657600_httpd.include
and past into end of file /etc/apache2/apache2.conf

CHANGE port from 80
<VirtualHost 173.244.212.25:80 >
ServerName "example.com"
.........
TO custom
<VirtualHost 173.244.212.25:8283 >
ServerName "example.com"
.........
Here /etc/apache2/ports.conf add
Listen 80
Listen 8283

[centos] /etc/init.d/httpd restart
[debian] /etc/init.d/apache restart


and enjoy
 
Last edited:
Back
Top