Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Deploying multiple web apps which using the same port
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Deploying multiple web apps which using the same port

I have a web apps (it's not made by me and the source code is encrypted).

The thing is I and the other 49 users want to deploy this web apps online. It's using php and mysql. Because the connection file is encrypted, I can't change the port of mysql or the database name. So, the mysql port has to be 3306. What are my options ? of course I can always buy 50 vps, but that's my last resort.

How about buying dedicated server on ovh and buy additional 49 ips and setup proxmox ? Basically I want to know my possible cheapest option.

p.s. This apps have nothing to do with spam.

Comments

  • Put it in a docker container, or use network namespaces.

  • FAT32FAT32 Administrator, Deal Compiler Extraordinaire

    Docker will be the easier solution. You can also create virtual interfaces and bind nginx to the private IP addresses.

    You can then map each of them to subdomain or path using nginx.

  • I just heard about docker (this year). Never really know what it is, and how to use it. I guess I will give docker a try.

    @FAT32 said:
    Docker will be the easier solution. You can also create virtual interfaces and bind nginx to the private IP addresses.

    You can then map each of them to subdomain or path using nginx.

    Private IP Address is a good idea. Can apache do this too ? forwarding domain into specific private IP ?

  • FAT32FAT32 Administrator, Deal Compiler Extraordinaire

    @yokowasis said:
    I just heard about docker (this year). Never really know what it is, and how to use it. I guess I will give docker a try.

    Private IP Address is a good idea. Can apache do this too ? forwarding domain into specific private IP ?

    I am just curious about how powerful your server is. It sounds like you must run 50 instances of MySQL services. If thats the case running container (Docker / LXC) might be slightly easier to maintain (but more resource intensive)

    I am not sure about Apache but Nginx is definitely possible.

  • Yeah, Apache can do that.

  • IkoulaIkoula Member, Host Rep
    edited December 2018

    Hello,

    I do not totally unsderstand your issue so this might not resolve it but maybe it's a start.
    If your app is reachable via an url can't a good DNS zone config with subdomains do the trick ?

    user1.youapp.com:3306
    user2.youapp.com:3306
    user3.youapp.com:3306

    Thanked by 1NanoG6
  • @Ikoula said:
    Hello,

    I do not totally unsderstand your issue so this might not resolve it but maybe it's a start.
    If your app is reachable via an url can't a good DNS zone config with subdomains do the trick ?

    user1.youapp.com:3306
    user2.youapp.com:3306
    user3.youapp.com:3306

    the app connect to localhost:3306

  • solairesolaire Member
    edited December 2018

    Ikoula said: I do not totally unsderstand your issue so this might not resolve it but maybe it's a start.

    @yokowasis please fill me in here, but what I understood is that OP has an application that he can't modify, but that needs to connect to a MySQL server. Even the configuration cannot be modified, meaning that the application is always connecting to localhost:3306 using a pre-defined database name that cannot be changed by OP.

    The issue he wants to resolve is that he wants to run multiple instances of this application (preferably on the same server). In order to achieve that he needs to run many instances of MySQL, because they obviously can't work together in the same database. As ports can only be bound to once, and he cannot change the port in the configuration, he needs different virtual networks (and some iptables magic), or a completely virtualized system per instance.

    I'd strongly suggest @yokowasis to go with docker as network namespaces can get messy and are harder to maintain. But that's just my 2 cents.

    Thanked by 2Ikoula NanoG6
  • @solaire said:

    Ikoula said: I do not totally unsderstand your issue so this might not resolve it but maybe it's a start.

    @yokowasis please fill me in here, but what I understood is that OP has an application that he can't modify, but that needs to connect to a MySQL server. Even the configuration cannot be modified, meaning that the application is always connecting to localhost:3306 using a pre-defined database name that cannot be changed by OP.

    The issue he wants to resolve is that he wants to run multiple instances of this application (preferably on the same server). In order to achieve that he needs to run many instances of MySQL, because they obviously can't work together in the same database. As ports can only be bound to once, and he cannot change the port in the configuration, he needs different virtual networks, or a completely virtualized system per instance.

    Yes, that is accurate.

  • jvnadrjvnadr Member
    edited December 2018

    If yo give us some more information on what webapp is this, maybe we can help you further.
    In general, from what I have understand, the solution is a combination from what else here said. Setup docker on a kvm or lxc on a kvm or dedicated server, isolate each instance with own internal ip, setup a proxy server on the main vps/dedi and forward your internet requests to the app via the internal address using domains or subdomains.
    I just find weird that when installing the app, you do not have any option to change either the MySQL port or, better, the database prefix. If you can install the app with custom prefix, then, you can install a seperate lxc/docker container and install there a single mysql instance, letting all the webbapps connect there.
    I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

  • solairesolaire Member
    edited December 2018

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

  • IkoulaIkoula Member, Host Rep

    @solaire thanks for the explanation, #screen will not match neither i guess ?

  • @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

  • leapswitchleapswitch Patron Provider, Veteran

    @yokowasis said:

    @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

    You should be able to do this on your CloudJiffy containers. A tech is sending you the steps shortly.

  • MikePTMikePT Moderator, Patron Provider, Veteran
    edited December 2018

    Decrypt the file and change the database name. Probably easier :-)

    PM me if you need my help.

  • @leapswitch said:

    @yokowasis said:

    @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

    You should be able to do this on your CloudJiffy containers. A tech is sending you the steps shortly.

    Thank you. I don't know it was possible using your service. I tried to find it , but I can't find it. Nice to know it's possible.

    @MikePT said:
    Decrypt the file and change the database name. Probably easier :-)

    PM me if you need my help.

    Can you decrypt ioncube ?

  • MikePTMikePT Moderator, Patron Provider, Veteran

    @yokowasis said:

    @leapswitch said:

    @yokowasis said:

    @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

    You should be able to do this on your CloudJiffy containers. A tech is sending you the steps shortly.

    Thank you. I don't know it was possible using your service. I tried to find it , but I can't find it. Nice to know it's possible.

    @MikePT said:
    Decrypt the file and change the database name. Probably easier :-)

    PM me if you need my help.

    Can you decrypt ioncube ?

    Possibly. PM me and I will have a look at it tomorrow. Upload the file to some where and send me the link.

  • @leapswitch said:

    @yokowasis said:

    @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

    You should be able to do this on your CloudJiffy containers. A tech is sending you the steps shortly.

    On second thought I don't think it's possible. Your MySQL server is not located on localhost.

  • leapswitchleapswitch Patron Provider, Veteran

    @yokowasis said:

    @leapswitch said:

    @yokowasis said:

    @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

    You should be able to do this on your CloudJiffy containers. A tech is sending you the steps shortly.

    Thank you. I don't know it was possible using your service. I tried to find it , but I can't find it. Nice to know it's possible.

    Even though CloudJiffy is a Platform - as - a - Service, we allow full control over configurations. So you can change anything within the predeployed MySQL (or any other service).

  • leapswitchleapswitch Patron Provider, Veteran

    @yokowasis said:

    @leapswitch said:

    @yokowasis said:

    @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

    You should be able to do this on your CloudJiffy containers. A tech is sending you the steps shortly.

    On second thought I don't think it's possible. Your MySQL server is not located on localhost.

    Is the script hard coded to use localhost for mysql?

    In this case, you can use the Elastic VPS option in CloudJiffy and install your own PHP / Mysql and create one Elastic VPS per installation by cloning the first setup.

    The Elastic VPS is also auto scalable so you can run extremely low memory containers with PHP and MYSQL.

  • Use LXC and redirect different ports to the containers with iptables.

  • FAT32FAT32 Administrator, Deal Compiler Extraordinaire
    edited December 2018

    I am wondering if it is possible to use a proxy layer between the connection to the real MySQL server. Just a random thought anyway.

    The proxy filter based on the private IP addresses and rename the database name to the correct one before passing to the real MySQL server.

    Example:

    PHP        <->  MySQL Proxy  <->  MySQL Service
    10.0.0.1   -->  USE Ion_DB   -->  USE Ion_DB_001
    10.0.0.50  -->  USE Ion_DB   -->  USE Ion_DB_050
    

    You can then just run 1 instance of MySQL service and more memory efficient.

  • @leapswitch said:

    @yokowasis said:

    @leapswitch said:

    @yokowasis said:

    @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

    You should be able to do this on your CloudJiffy containers. A tech is sending you the steps shortly.

    On second thought I don't think it's possible. Your MySQL server is not located on localhost.

    Is the script hard coded to use localhost for mysql?

    In this case, you can use the Elastic VPS option in CloudJiffy and install your own PHP / Mysql and create one Elastic VPS per installation by cloning the first setup.

    The Elastic VPS is also auto scalable so you can run extremely low memory containers with PHP and MYSQL.

    Yes. It's hard coded and encrypted. Is docker container run in elastic vps ? Or it run on something else ?

  • leapswitchleapswitch Patron Provider, Veteran

    @yokowasis said:

    @leapswitch said:

    @yokowasis said:

    @leapswitch said:

    @yokowasis said:

    @solaire said:

    jvnadr said: I am suggesting this because running 49 different instances of MySQL in a vps, will probably be a killer... So, even if you buy a dedicated server with 50 ips, you will need a really expensive one because of the memory needs, the speed of the HDD etc.

    Though I understand what you're saying, I have to disagree there. This is the whole point of microservices (and indirectly docker). Certainly, the overhead of 49 MySQL processes will be (slightly) more than running 1 MySQL process with 49 databases, but it's not that this overhead will immediately kill your performance. On modern hardware, impact should be negligible. On modern (trusted) container platforms, memory pages can be shared leaving little to no overhead.

    Any provider that provide this micro-services and using custom port ? Because the app is not using standard port for mysql.

    My original post said it's 3306 because I want to simplify things. The original apps, come with xampp installer and using custom for both apache and mysql. The custom port for apache doesn't really matter, it's the mysql custom port which makes things more tricky.

    You should be able to do this on your CloudJiffy containers. A tech is sending you the steps shortly.

    On second thought I don't think it's possible. Your MySQL server is not located on localhost.

    Is the script hard coded to use localhost for mysql?

    In this case, you can use the Elastic VPS option in CloudJiffy and install your own PHP / Mysql and create one Elastic VPS per installation by cloning the first setup.

    The Elastic VPS is also auto scalable so you can run extremely low memory containers with PHP and MYSQL.

    Yes. It's hard coded and encrypted. Is docker container run in elastic vps ? Or it run on something else ?

    Yes it is run in an Elastic VPS.

  • Ioncube can be decrypted, pm'ing you

  • ProxySQL (https://github.com/sysown/proxysql/wiki/Main-(runtime)#mysql_query_rules) is a MySQL proxy that allows replacing patterns. Setup one proxy in each netns/docker that listens on loopback and forwards it out of the netns. Also run a ProxySQL in your root namespace that listens on all veth external endpoints (assuming netns) and forwards it to real MySQL instance.

    I would just use netns instead of docker: https://blogs.igalia.com/dpino/2016/04/10/network-namespaces/ for setting up loopback in a netns and running it.

  • Thank you all for the awesome response. I think I will setup docker with internal IP and forward the request from nginx.

    Thanks for all the insight. Good Stuff.

Sign In or Register to comment.