• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • 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 multiple ips with same port runing

stevemartin

Basic Pleskian
hello all

i have 2 public ips on plesk and i want to run 1 website 1 apps on port 80

site runs on domain.com
app on client.domain.com

so both are hosted on same server with ,how can i achieve this one ip on website another ip for app

but iam not netaddress already used when i run app as nginx is runing on both IP on port 80

[root@server]# sudo netstat -tlnp | grep 80
tcp 0 0 87.59.471.443:80 0.0.0.0:* LISTEN 11699/nginx: master
tcp 0 0 87.59.471.444:80 0.0.0.0:* LISTEN 11699/nginx: master
tcp 0 0 0.0.0.0:8880 0.0.0.0:* LISTEN 8225/sw-cp-server:
tcp6 0 0 :::7080 :::* LISTEN 8622/httpd
tcp6 0 0 :::8880 :::* LISTEN 8225/sw-cp-server:
 
There is no need to run 2 services for hosting 2 sites. I run hundreds of domains on 1 IP.
You can tell Plesk which one of the IP's it should use for each domain.

If the browser asks for "client.domain.com", Apache will provide the content of /var/www/vhosts/client.domain.com/httpdocs
If the browser asks for "domain.com", Apache will provide the content of /var/www/vhosts/domain.com/httpdocs

 
its not 2 sites its one site and one is App as both need to run on port 80 that is why i took 2 IP`s so site run on one ip and another one on another IP
 
If you app connects to myapp.com and your website is mysite.com, Apache will deliver the correct content.

About what we are talking? Does the app http(s) requests? Then everything is fine, with one IP.

If you really need two IPs, then configure them in Tools & Settings -> IP Adresses.
 
its not 2 sites its one site and one is App as both need to run on port 80 that is why i took 2 IP`s so site run on one ip and another one on another IP
It's not easy to get an idea what someone knows. I assumed you didn't know how virtual hosting works.

This doesn't mean there's any need to free that IP. I have several "apps" running on my server and these all run through nginx.

You need to tell your app to run on localhost on some exotic port. Then tell nginx to proxy a certain domain on 1 of your IP's and forward that to localhost.

You don't need to change any of the config files. The only thing you need to do is add an appropriate config-file in the folder /etc/nginx/conf.d/

I have somewhere on this forum a post where I explain the details.
 
its simple how to stop nginx runing on both ips, as i need nginx to run on only one IP not both ips as iam getting bind address already in use
 
Just don't tell Plesk you have that IP.
AFAIK they don't bind to 0.0.0.0, so that will leave you a free IP.

Why you dismiss the good advice I gave you regarding using Nginx as a proxy is beyond me. It does save me of explaining any further.
 
Back
Top