Point Two Websites to Two Different PCs on Same Network? - mysql

I have a network at home. On this network, I have two computers. Each of these computers have apache and mysql installed on them. I have two websites that I would like to point to my network, one to each computer. My domains are hosted with GoDaddy.
I have always had one computer with my localhost on it working perfectly fine on port 80. Now I'd like to add in this second computer and be able to access it from outside my local network. I've set the port forwarding to 8079 and the listening port to 8079 on apache on the second computer. But from this point, I have no idea how to differentiate between the two. Or even if I can?
I want WebsiteOne to point to ComputerOne on port 80 and WebsiteTwo to point to ComputerTwo on port 8079. If this is possible, can anyone point me in the right direction?

Yes, by using port forwarding you can do that my friend.
Point your domains as your desire. WebOne -> routerip:80 and webTwo -> routerip:8079
Configure the port forwarding in your router so any request to the port 80 will be routed to the WebOne destined server and any request to the port 8079 will be routed to the WebTwo destined server
Configuration on the router may vary for each router but the bottom line is the same.
Hope it can help you mate.

Related

issue to access multiple applications with IP and port on Google Compute Engine

I am new to Google Cloud. Instance has been created with Ubuntu16.04 image on Compute Engine. Three applications has been installed on it. One is running on nginx on port 80 [say A], second is on 8001[say B] and other one is on 8080 [say C].
I can able to access application A directly when click on external IP [or if give port 80 along with IP]. This application internally access application B on port 8001. Configuration of two applications has been updated for. There is inbound firewall rule for 8001. This application can not be accessible when we try to access with IP and port.
Same case with application C. That application is running on port 8080 in tomcat. Inbound Firewall rule has been created for this port too. This application is not accessible with IP and port. Server.xml for this application is updated to 0.0.0.0 instead of localhost [as mentioned not able to access port(11444 & 5072 ) externally(using Ubuntu on Google compute Engine)
I am not sure about the issue. Can anyone help me out?
I searched around but did not find anything for multiple applications. And most of the time example has given for port 80 only.
This application internally access application B on port 8001
Same case with application C.
It sounds like you don't actually want 8001 or 8080 to be accessible; in this case, leave the firewall rules alone (don't permit traffic to them from the outside) and configure them to listen only on localhost (which is not firewalled anyway).
In case you do want these to be accessible, then post a screenshot of your firewall configuration and we'll take a look.

create a domain name pointing to an IP of port different than 80

I would like to use a domain name to point to a web page on the local server's IP address. However, the problem is that the page is linked to an IP address set up on port 8088 rather than 80 because the latter is already used by another web page. By the domain company I was told that they cannot do it because the domain can only point to an IP address set up on port 80. So now I am in a deadlock. What alternatives do I have and how can I make a domain pointing to the IP:8088?
Thanks
The domain company that you talked to may have done a poor job of explaining how domains work. Domain names don't refer to specific ports. They just refer to IP addresses. The client can look up a hostname to get the IP address which the client should connect to, but the client has to figure out the port without the help of DNS. Port 80 is just the default port for HTTP service.
You can certainly run a web server on port 8088 if you like. The port number would have to appear in the URL, e.g. http://somehost.example.com:8080/some/page. Clients would parse this and know to connect to port 8080 instead of the default port 80.
If you don't want URLs to contain the port number, then requests are going to go to the default port 80, and you have no choice but to make the web server running on port 80 handle these requests. HTTP/1.1 requests include the hostname which the client wants to contact, and modern web server programs are normally capable of serving completely different sets of content based on the hostname in the request. There are few ways todo what you need:
Just configure the web server for port 80 to handle both sites. This will depend on what web server software you're using. Apache for example calls these "virtual hosts", and here is a set of examples. This is a typical solution, and some people run hundreds of sites on the same server this way.
Run your two web servers as you planned. Set up the server for port 80 to be a reverse proxy for the second website. The server would continue to serve content for the site it handles now. When it receives a request for the second site, it would relay the request to the server running on port 8088, and relay the server's response back to the client.
Move the existing server for port 80 to a different port. Run a pure reverse proxy server on port 80, relaying requests for both web sites to their respective web servers.
You might be better off taking further questions to https://webmasters.stackexchange.com/ or https://serverfault.com/.
You can use a Proxy to reroute the given domain to the IP:PORT. To accomplish this you could either spin up a Nginx server and configure it as your reverse proxy or use this project that does exactly what you want and with almost no config https://github.com/cristianoliveira/ergo
If you run Apache on port 80, which is the most common case then the easiest way to solve this issue is to set a VirtualHost that uses ProxyPass.
<VirtualHost sub.domain.com:80>
ProxyPass / https://ip-or-domain.com:8088/
</VirtualHost>

Remote Port Forwarding on OpenShift

I just saw this blog about hosting Minecraft on OpenShift and I'd like to give it a try.
My only concern is the port forwarding. For the other players that I would invite, setting up a local port forward would be too complex.
How can I forward the ports on the server so that can just enter a simple TLD instead? Is it even possible?
Thanks!
If you want everyone to be able to access the minecraft server it is quite involved, you need everyone to sign up for an openshift account, add their accounts to your domain, and then have everyone do the port forward.
If you don't want to do that, you basically have to run something on another server where you had full access and run the port forward and tie them to publicly available ports.

Localhost database connect from other sysytem

I am testing a website which in other machine like 192.168.0.1 in my machine which is 127.168.0.2 so in the website ajax jquery is used on page load in which the url is
http://localhost/Demo/store.php
but when i execute that page in website in other machine the database isnt connecting and even if i give the url as
http://192.168.0.1/Demo/store.php
its not connecting to database..What is the issue please tell me...How can i access from other system so that all my local database values can be displayed in other machines also..Thanx..
From http://technet.microsoft.com/en-us/library/cc940018.aspx:
address 127 .x.y.z is reserved for loopback testing and interprocess communication on the local computer.
Your probably not connected to your network correctly. Check your physical connection (blinking leds), then make sure you have a DHCP server on the network, otherwise assign a static IP.
After this try pinging the address to make sure the 2 hosts can see each other. Also open up any ports which may be behind a firewall, 3306 is default for MySQL DB.

Manage mySQL DB by using phpMyAdmin and point browser to ip

Hi I am completely new to phpMyAdmin and mySQL
Is there any way to configure remote management/access of my MySQL database by pointing requests or a browser to an IP? I have my server set up behind a router and have setup port forwarding for ports 8080 (tomcat) and 3306(should be default mySQL). Everything works locally on the machine, however I cannot access the dbs or phpmyadmin by pointing a browser from a computer on the local network to http://IP/phpmyadmin or from externally by pointing the browser to the IP given to me by my ISP. Any thoughts? Is there a specific way to edit the config files in order to allow the use of IP addresses?
Exposing your db and appserver on the internet is not a good idea. If these need to be accessed remotely, use a VPN or authenticated SSL. In the case of phpmyadmin - if this is running on a webserver on your network then you'll need to forward port 80 too - although I'd recommend using HTTPS/SSL (port 443)