• The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question Set http port 777 for subdomain

Bull Criss

New Pleskian
I have been searching the web for an answer to this question but I couldn't find anything.

I have a CentOs server managed with Plesk 12.5, with a 2nd level domain mysite.com for which I have created a number of subdomains (3rd level) sd1.mysite.com, sd2.mysite.com, etc.
The web server is Apache and also NGix is installed and working.

All the subdomains are reachable from the web : e.g. http://sd1.mysite.com, through port 80.

For one of these subdomains, I need it to be reachable through port 777, which means http://sd7.mysite.com:777

How can I achieve that by setting additional directives (Apache and/or NGix, like "listen"), for a specific subdomain, without affecting all the other ones ?

I hope my question is clear... Thank you in advance for your support!
 
@Bull Criss

In fact, the most easy method is to use Nginx.

In the subdomain, one would easily copy the various default entries, except for the fact that the ports 80 and 443 will be changed to port 777.

If I am not mistaken, you can simply

1) go to /etc/nginx/plesk.conf.d/vhosts

2) copy sub.domain.tld.conf file, use the command: cp -p sub.domain.tld.conf customsub.domain.tld.conf

Note: the name <customsub> can be replaced by any name of your choice.

3) edit the file customsub.domain.tld.conf and replace the port values 80 and 443 with the port value 777 (and that is all you have to do)

4) run a Nginx configuation test: nginx -t

5) restart Nginx: service nginx restart

and you should be done.

Note a number of important things:

a) the files sub.domain.tld.conf and customsub.domain.tld.conf can easily co-exist, so there is no problem there, except when a typo in the URL has been or will be made: any request to http://sd7.mysite.com will be served via port 80 (that is, if the file sub.domain.tld.conf has not been deleted),

b) removing the file sub.domain.tld.conf is possible, but not recommended (and this file will return sooner or later, due to the autogeneration of these files),

c) you might want to consider to do a simple redirection of traffic on ports 80 and 443, with the directive of the form

return 301 $scheme://customsub.domain.tld:777$request_uri;

and the above should be entered in the Plesk Panel in the part "Additional nginx directives" on the domain sub.domain.tld.


Hope the above helps a bit, you can surely give it a try.

Regards..........
 
thank you for your replies!

but....
1) go to /etc/nginx/plesk.conf.d/vhosts

2) copy sub.domain.tld.conf file, use the command: cp -p sub.domain.tld.conf customsub.domain.tld.conf
how do I do this? From the file manager of the domain mysite.com I see an "etc" folder but inside it I only have 3 files : group, passwd and resolv.conf...
 
@Bull Criss

You stated

how do I do this? From the file manager of the domain mysite.com I see an "etc" folder but inside it I only have 3 files : group, passwd and resolv.conf...

and the answer to your question is: via SSH.

However, what do you mean with "from the file manager..."? Which file manager??

It certainly is not a good idea that you can access the "passwd" file from any file manager, is there something strange or wrong with the hosting setup?
 
and the answer to your question is: via SSH.
I asked my hosting/server provider : looks like I won't do it because they say that if I access the server via SSH they will suspend their maintenance service.
I was hoping it was possible to do the port setting simply in the part "Additional nginx directives", but if that's not possible then I'll have to give up...
 
Back
Top