SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2012-10-27 04:47:11

antiv0rtex
#! Die Hard
From: Earth
Registered: 2012-10-05
Posts: 573

Running multiple LAMP servers on multiple ports under one IP

Good evening, fellow members -

For the past several months, I have been attempting to get a simple LAMP server up and running. The concept of hosting a website from my bedroom is extremely attractive, but I don't really know what I am doing.

I have posted a thread at LinuxQuestions and recieved some good help from users there, but since the inhabitants of this forum are all so friendly I thought it would be worthwhile to post my next question(s) here. Moderators: If this is not appropriate, please let me know.

I have an HP Compaq dx2200 Microtower configured with #! Statler and Apache/PHP/MySQL. That part has gone smoothly, and everything is working well locally, but unfortunately my internet service provider (Cox Communications) has blocked port 80 and specifically forbids servers on certain plans.

I am fairly sure that I am working with a plan on which running a low-traffic LAMP server will not be an issue - certain plans above a certain line, so to speak, are fine -  but until I can check if this is correct, I am hoping to run this box on an alternate port.

That seems to be fairly easy to get working, assuming the instructions in these two articles are correct: (1, 2). But beyond that, I am unsure of myself.

As some of you may know, I recently posted a thread here indicating that I had received a number of old desktop boxes; further, I had mentioned that I have plans to convert one or more of them into dedicated LAMP servers. Assuming, as may or may not turn out to be the case, that I do only convert one of these new acquisitions into a functioning server, I would be left with a total of two servers (counting the HP Microtower I mentioned in the fourth paragraph of this post).

This is where my understanding of what I am doing becomes somwhat hazy.

Every computer system in my home - there are several - is connected to the Internet via a Linksys WRT300N wireless router. Some systems are connected wirelessly, and the rest are utilizing ethernet connectivity from the ports on the back of this router. All of these systems seem to be known by one static IP address which, for the purposes of this post, will be referred to as "184.1xx.xxx.3x".

If I do suddenly have two properly configured Apache2 servers on this network, is it possible to have them running on different ports on the same network, but both still be accessible? e.g. server #1 would have its /index.html and other files visible at 184.1xx.xxx.3x:6830 and server #2 would have its entirely separate /index.html and other files accessible at 184.1xx.xxx.3x:3820?

I would suppose this is done by editing Apache's configuration files as shown in the articles linked to above, and if doing so would not cause conflict I am thoroughly ready and able to do that. However, I wanted to check here first to make sure that doing so would not make the network implode somehow. wink

Thank you for sparing time of your evening(s) to read this post. Warm regards, etc.

/L

Offline

Help fund CrunchBang, donate to the project!

#2 2012-10-27 14:14:56

brontosaurusrex
#! Red Menace
Registered: 2012-06-15
Posts: 1,014

Re: Running multiple LAMP servers on multiple ports under one IP

If I do suddenly have two properly configured Apache2 servers on this network, is it possible to have them running on different ports on the same network, but both still be accessible? e.g. server #1 would have its /index.html and other files visible at 184.1xx.xxx.3x:6830 and server #2 would have its entirely separate /index.html and other files accessible at 184.1xx.xxx.3x:3820?

Your router needs to be configured to forward port xxx to machine1 with port zzz and port yyy to machine2 with port zzz. Also make sure that all the servers always get the same internal ip - reserved ip, static ip, consult your router docs)

p.s.
I would probably set zzz to 80, so you can acess them both in lan using directly, with just an ip entered in browser.

(If you want single apache to serve mutiple sites then check virtual hosts. < there was a nice explanation somewhere on this forum, but cant find it right now)

Last edited by brontosaurusrex (2012-10-27 14:27:33)

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo