LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How do I fix two webservers(diffrent boxes) under same external ip? (https://www.linuxquestions.org/questions/linux-server-73/how-do-i-fix-two-webservers-diffrent-boxes-under-same-external-ip-4175425096/)

mazzse 09-01-2012 03:25 AM

How do I fix two webservers(diffrent boxes) under same external ip?
 
Hi Guys!

I have for a couple of years been running a Debian webserver at my home. With a pleaseness of 100%. I am really so satisfied. :)
And now this machin is going to be replaced, and under this replaceing time Iam going to have both accesible from outside Internet.

So I need some help how to conf the first webserver to pass on the traffic to the second one. (with first I mean, the one who is forwarded port 80 in my firewall/router to) With second I mean the one who is going to be the new one.
I have figured out that I will need to conf /etc/apache2/sites-avaiable/default vith virtualhost and ProxyPass, right?
But I dont find an tut when I google, and others exaples only shows www.abc.com, 123.abc.com, 456.abc.com etc to the same machine. But it does not covers to another machine.

What I want to do is:
Config so that I can run owncloud.mydomain.com to another fysical server than the one that is exposed to internet today.

Can some friendly soul out there (here :) ) pls help me?

Best Regards
Mats

barghota 09-01-2012 08:27 PM

First, you need to check apache's virtual hosts Virtual Hosts specifivally Name-based hosts on more than one IP address and Using Virtual_host and mod_proxy together.

This URL provides a good information as well Using Apache with virtual hosts and mod_proxy

Basically, you will need something like;

Quote:

<VirtualHost *>
ServerName owncloud.mydomain.com

ProxyRequests Off
<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://internal-owncloud.mydomain.com
ProxyPassReverse / http://internal-owncloud.mydomain.com
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
Also check /etc/apache2/mods-available/proxy.conf.

mazzse 09-02-2012 06:23 AM

Thank you for your help, it helped me the right way.
So I got it working now.

Tank you once again!

:D

barghota 09-04-2012 05:25 AM

you will find

'Did you find this post helpful? Yes'

Click on yes

mazzse 09-14-2012 08:20 AM

1 Attachment(s)
Now I have found another problem... :) (just because I expand my system... :P )

I just bought a USB-RJ12 thing that you can plug in dallas temperature sond in, to measure for example temperature (even called 1-wire system). Now I have tried to put this to its own adress like: temp.mydomain.com
I cant get this to work together with owncloud.mydomain.com, but only with temp.mydomain.com or owncloud.mydomain.com running.
Seems to be a problem when I activate two subdomains.
But if I set it up with owncloud.mydomain.com/temp or with temp.mydomain.com/owncloud or servername.mydomain.com/temp and servername.

But unfortunately I would have got in to this trouble soner-or-later bacause my plan is to move al the diffrent serverapplications to the "new" server.

See the Schematic picture that I have attached, for a more detaled explanation of how I have planed this to action.

All this wouldnt be a trouble if I just could do this config for a couple of days instantly, but that is the major problem, I cant. Just need to have this services up-and-runnign. :)

Please help me further on! :)


All times are GMT -5. The time now is 03:34 PM.