• 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

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