Koozali.org: home of the SME Server

How do I setup two web servers?

Offline fixit

  • *
  • 216
  • +0/-0
    • http://www.fixitcomputers.com.au
How do I setup two web servers?
« on: March 02, 2006, 07:56:17 AM »
How do I setup two web servers?

I have 1 static ip and 4 web domains; all have name servers setup correctly and work fine on 1 web server.

What I would like to do is have 2 web servers using the 1 static ip and have 2 domains on each server.

Currently I have one computer setup as Server & Gateway and the other as Server only

How should I have the second web server setup

The reason why I would like to have the 2 servers separated is that I noticed that in the server manager when accessed via the other domains, such as https://www.otherdomains.com/server-manager all users and setting of the 4 domains are visible.

What would be the ideal way to separate these in the server manager? Or would it be easier to have two web servers, I would rather have the two seperate

any suggestion would be appreciated

Thanks in Advanced
.........

Offline kruhm

  • *
  • 680
  • +0/-0
How do I setup two web servers?
« Reply #1 on: March 04, 2006, 02:06:23 PM »
AFAIK, you're going to have a difficult time doing this as this is outside the scope of the stock SME.

advice:
-keep everything on 1 box. i can't imagine you have that much traffic on the 4 sites.

-you probably want to move in the direction on dungog's user-manager contrib here: http://no.longer.valid/phpwiki/index.php/SME7Contribs
if i remember correctly, the userpanels part filters out users by group. they only see the users in their group (thanks dungog).

(mod: please move to other forum)

Offline Rigger

  • ***
  • 71
  • +0/-0
How do I setup two web servers?
« Reply #2 on: August 22, 2006, 08:08:09 AM »
Did you ever figure this out? I am in a similar situation. I have one SME server acting as a gateway/server and one in server only mode. The system in server only mode deals with picture conversions for two seperate online galleries I maintain for my family. I found the when adding or editing picture the CPU load effects the other services including the gateway operations to the other computers on the network using only the one system for the galleries and gateway duties. This is why I moved the galleries to the seperate server only system. What I'm trying to do is have subdomains on the server only system. Crude layout below

Internet
    |
DSL Modem
    |
SME Gateway & server (Domain.xxx)
    |
Hub-----> SME Server only (xxx.Domain.xxx)
    |
Other systems



Rigger
'Doug Musty'

Offline wjhobbs

  • ****
  • 171
  • +0/-0
    • http://www.chryxus.ca
How do I setup two web servers?
« Reply #3 on: August 23, 2006, 02:18:06 AM »
You might want to consider using ProxyPass in Apache to route the two domains to the second machine.

I don't know enough to tell you specifically how to set it up -- but my belief is that this will accomplish what you want.

Let us know how it goes.

John
...

Offline Rigger

  • ***
  • 71
  • +0/-0
How do I setup two web servers?
« Reply #4 on: August 24, 2006, 03:14:22 AM »
I guess I should have mentioned that the SME server acting as a gateway is also used for content filtering (Dansuardian).


Rigger

Offline haymann

  • *
  • 212
  • +0/-0
How do I setup two web servers?
« Reply #5 on: September 07, 2006, 06:43:30 PM »
Quote from: "Rigger"
Crude layout below

Internet
    |
DSL Modem
    |
SME Gateway & server (Domain.xxx)
    |
Hub-----> SME Server only (xxx.Domain.xxx)
    |
Other systems
If I understand you right you are trying to do the same thing as I have been trying to figure out. I have Zoho Virtual Office installed on a CentOS box. When I setup a port forwarding rule on my SME box to forward port 8080 to my CentOS server it works great from the internet, but not from the local network as several other posters have noticed.
When I add the CentOS server to the hosts section in SME I am able to connect to Virtual Office by typing in http://vo.mydomain.xxx from the local network, but not from the internet.
I would love to figure out an address that would work for both, as there is a link on our main page to launch Virtual Office. It would be nice to not have links for on and off the local network. Does anyone know of a way to get vo.mydomain.xxx to be recognized from outside the local network?
Thanks,
Ryan

fern

Re: How do I setup two web servers?
« Reply #6 on: September 08, 2006, 07:09:43 AM »
fixit & Rigger

> How do I setup two web servers?

I think this recipe may meet the requirements of posters in this thread.
I'm writing it from memory & I have not tried all aspects of it together,
so there may be a correction or two (or an alternative) required.

There are three issues as I see it, seperating users and admin access to those users,
hosting domains on a second server and having that domain recognised locally and externally,
and handling email on the second server ie using the different mail server for some domains only.


Configure server 1 as server and gateway
Configure server 2 as server-only (not as private server and gateway).

Configure server 1 as your sites DNS server
(this should be automatic & not need manual configuration, do not set a different corporate DNS server IP)

Configure server 2 to look for DNS on server 1
Do this in the Configure this server menu after logging in as admin
eg On the screen "Corporate DNS server address" set server 2 DNS server as server1-IP


Configure server 2 to look for Internet gateway on server 1.
Do this in the Configure this server menu after logging in as admin
eg On the screen "Select gateway IP address" set server 2 gateway address as server1-IP


Setup say 1 main domain on server 1 & 1 virtual domain eg domain1 & domain2
Setup say 2 additional domains on server 2 (can be the main & a virtual) eg domain3 & domain4

External records should point all these domains to the external IP for the gateway server 1


On server 1 create virtual domains for domain2, domain3 & domain4 (and domain1 if preferred)
domain1 is the main domain for server1 (which can also be configured as a virtual domain if you want it in an ibay rather than Primary)

domain2 will point to a local ibay on server 1
domain3 & domain4 will point to different local ibays,
but then you use the proxy pass contrib "virtual domain entry" to seperately point domain3 & domain4 to server2 IP or domain name
eg virtualdomain3 >>> http://server2-IP or http://domain3.com


Create the users you wish to have on server 1 which will be maintained by admin1 eg ...domain1/server-manager or ...domain2/server-manager

Create the users you wish to have on server 2 which will be maintained by admin2  ...domain3/server-manager or ...domain4/server-manager


You will also need to configure server1 to forward email for domain3 & domain4, do this using the command

db domains setprop domain3.com MailServer server2-IP
db domains setprop domain4.com MailServer server2-IP
signal-event email-update


The only aspect I'm not sure about is whether the https request will get through to server2 (which I think it won't).
There is an alternative choice in the proxy pass panel,
that does give the option of configuring a ProxyPass URL entry,
where you can specify http & http access.
As I understand it, that setting is for redirecting a local domain URL request to another domain
eg ...domain1/ibay1 to domain 2, so it may not really suit this situation.


Beyond those suggestions then you could start tweaking custom templates to sort out any finer details.


Let us know how you go.

Offline Jean-Philippe Pialasse

  • *
  • 2,743
  • +11/-0
  • aka Unnilennium
    • http://smeserver.pialasse.com
How do I setup two web servers?
« Reply #7 on: September 08, 2006, 09:11:51 AM »
this methode is fine for http forward.

if it is th e only thing you want it is perfect.


But your users from the second SME won't receive any email from the internet  neither from the first SME,  as with this configuration the first SME (gateway one) will consider any email for domain1 domaine2 domain3 domain4 are for its users. If there is no users withe the correct name the mail will be simply rejected.

If you want to receive email too:
on the first SME box foreach domains pointing on the second sme box
(where HOTE = the hostname of the SME server-only)

mkdir -p /etc/e-smith/templates-custom/var/qmail/control/smtproutes
echo "HOTE.domaine.com:HOTE.domaine.com" > /etc/e-smith/templates-custom/var/qmail/control/smtproutes/90maison1Mail

mkdir -p /etc/e-smith/templates-custom/var/qmail/control/rcpthosts
echo "HOTE.domaine.com" > /etc/e-smith/templates-custom/var/qmail/control/smtproutes/90maison1Mail
echo ".HOTE.domaine.com" >> /etc/e-smith/templates-custom/var/qmail/control/smtproutes/90maison1Mail

/sbin/e-smith/signal-event email-update


then you ***MUST*** change in the server-manager of the gateway SME the polycy for mail without local users  to "globalUP" instead of "reject"

skm

How do I setup two web servers?
« Reply #8 on: March 23, 2007, 04:19:10 AM »
But can I create two web sites on the same SME server with two different domain names?

Offline raem

  • *
  • 3,972
  • +4/-0
How do I setup two web servers?
« Reply #9 on: March 23, 2007, 04:40:02 AM »
skm

> can I create two web sites on the same SME server with two different domain names?

Yes, read the manual especially the chapter on Domains panel in server manager
...

skm

How do I setup two web servers?
« Reply #10 on: March 23, 2007, 11:29:38 AM »
Quote from: "RayMitchell"
skm

> can I create two web sites on the same SME server with two different domain names?

Yes, read the manual especially the chapter on Domains panel in server manager

Thanks a lot.