Other php site in same server

Dear All,

I want to have another php website in the same server as that of ERPNext. Is that possible?

1 Like

It will happen a problem with ports.
Web server needs port 80 and 443 (for SSL)
Also If your PHP is configured as FPM module, the default port is 9000 (if it is not configured to connect through sockets).

Port 80, 443 and 9000 are also needed by ERPNext.
So, if you are in the situation above, you need to change ports for your PHP application or change ports for your ERPNext Instance.

You can also add in a 2nd webserver, like apache2 - which also supports Named Virtual Hosts. This will allow multiple hosts to share the same IP and port

1 Like

Have anyone successfully implemented such setup?

1 Like

Sure. Many of us have done this with a Reverse Proxy.

  • Your Reverse Proxy server listens on ports 80/443, and handles inbound user requests.
  • Depending on URL, the proxy server redirects traffic to your other web servers:
    • ERPNext (port 8000)
    • Web Server XYZ (port 3000)
    • Web Server ABC (port 3001)
    • etc.

You don’t want your individual web servers to serve your public IP address. So you limit them to 127.0.0.1. That way only the proxy server is accepting inbound connections.

I don’t know anything about Apache, but I’ve done this with Nginx. It’s not difficult, but you do need a solid understanding of how to configure your web server.

1 Like

After my last comment i tried a lot to achieve this. After lots of trial and error i was able to do as below.

I wanted to have Apache for all my other site and nginx for erpnext and i am on AWS EC2, Ubuntu 18.04. so i did below

By default AWS assigns a private ip to an instance, i added a secondary private ip.
I mapped different public ips for both the private ips

In server,

vi /etc/netplan/60-secondary-ip.yaml

network:
version: 2
renderer: networkd
ethernets:
eth0:
addresses:
- 172.31.51.23/20
- 172.31.51.24/20

The private ips

vi /etc/nginx/conf.d/frappe-bench.conf
listen 172.31.16.86:80; The private ip from AWS
vi /etc/apache2/ports.conf
Listen 172.31.28.208:80 Second Private Ip from AWS

service nginx restart
service apache2 restart

Thats all. I was able to access nginx from the first public ip and apache from the second.

I am not sure if this is the right way to to. But so far this was what i wanted.

I have not installed all my apps, if stuck anywhere will post here.

Hope this will help others in this form.

where should I upload files for another sites on php? And what should I do more? Maybe I need add some config?

yes manyt times…
just add a nignx a reverse proxy and lt main be server be apache … then route all traffic of your website to nignx virual host… through .htaccess file…

this is complicatd process a backup is a must… but one done it works flawlessly…
no port changes needed