Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


pstar008

362 posts

Ultimate Geek


#62532 9-Jun-2010 12:16
Send private message

Hi, I've setup apache servers for personal projects using my home file server and desktop PC. Now I ended up
need find a way for them to share port 80 from my single IP address.

I think the answer is reverse proxy mod in Apache? Any start point for setting up one in Debian server?

Create new topic
chrisjunkie
413 posts

Ultimate Geek


  #339790 9-Jun-2010 13:57
Send private message

Something like the following. Substitute IP1 as the IP address (internally) of the PC that is going to be doing the proxy'ing. Replace IP2 with the IP address of the other PC's IP address. DomainName of PC2 should be straight forward :) (note that this will not work going straight to an IP address as this relies on NameBased Forwarding. Get a dyndns or no-ip domain if you need to - that is another topic)

<VirtualHost IP1:80>
        ServerName pc2.domainname.co.nz
        DocumentRoot /var/www/
        ProxyRequests Off

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

        ProxyPass / http://IP2:80/
        ProxyPassReverse / http://IP2:80/
</VirtualHost>

Hope that helps! I use many many of these in my vhosts file. You can place in apache.conf if you don't have a vhosts.conf (or similar)

Can actually use these to get past firewall issues too as the :80 can be changed to a non-standard port. E.g your web monitoring software runs on 1154 so you just change to IP2:1154 and off you go!

Please ask if you have more questions!
Cheers
Chris

 
 
 
 

Shop now for Lenovo laptops and other devices (affiliate link).
JAMMAN2110
871 posts

Ultimate Geek

Trusted

  #339794 9-Jun-2010 14:03
Send private message

Why not combine them as a Virtual Host for each project on the one server?

pstar008

362 posts

Ultimate Geek


  #340456 10-Jun-2010 22:31
Send private message

Hi Chris, thank you for the help, I finally get a chance to test it tonight, and it works!

I am on a Debian Lenny, so the proxy setting is on mods-available/proxy.conf. And as I am using named-based virtual host on PC2 I changed IP2 to server2's name.

Thanks again for the great helps.



pstar008

362 posts

Ultimate Geek


  #340576 11-Jun-2010 11:53
Send private message

@Jamman2010
Yes, put them all into a machine with vhost will certainly solve me problem, but I guess I am
just been lazy and think that there must be a way of doing that.

k1wi
484 posts

Ultimate Geek


  #340578 11-Jun-2010 11:58
Send private message

I have a couple of homedns configured using vhosts, very straightforward :)

Though I did manage to borge it one day when I removed the first line of the file thinking it was just superfluous! Turns out it was the line that tells apache that there is more than one vhost :o

JAMMAN2110
871 posts

Ultimate Geek

Trusted

  #340586 11-Jun-2010 12:14
Send private message

pstar008: @Jamman2010
Yes, put them all into a machine with vhost will certainly solve me problem, but I guess I am
just been lazy and think that there must be a way of doing that.


Don't get me wrong, I use vhosts and mod_proxy all the time. But given that its at home there doesn't seem to be much point..

<VirtualHost *:80>
 DocumentRoot /var/www/site1/www
 ServerName blah.com
 ServerAlias www.blah.com
</VirtualHost>

Minimalist but it works ;)

pstar008

362 posts

Ultimate Geek


  #341451 14-Jun-2010 11:26
Send private message

Hi Jamman2110

My question is how to have two servers serve http request to one IP address and one port, but I failed to see how ServerAlias going to solve that?

Create new topic





News and reviews »

New Suunto Run Available in Australia and New Zealand
Posted 13-May-2025 21:00


Cricut Maker 4 Review
Posted 12-May-2025 15:18


Dynabook Launches Ultra-Light Portégé Z40L-N Copilot+PC with Self-Replaceable Battery
Posted 8-May-2025 14:08


Shopify Sidekick Gets a Major Reasoning Upgrade, Plus Free Image Generation
Posted 8-May-2025 14:03


Microsoft Introduces New Surface Copilot+ PCs
Posted 8-May-2025 13:56


D-Link A/NZ launches DWR-933M 4G+ LTE Cat6 Wi-Fi 6 Mobile Hotspot
Posted 8-May-2025 13:49


Synology Expands DiskStation Lineup with DS1825+ and DS1525+
Posted 8-May-2025 13:44


JBL Releases Next Generation Flip 7 and Charge 6
Posted 8-May-2025 13:41


Arlo Unveils All-New PoE Adapter With Enhanced Connectivity
Posted 8-May-2025 13:36


Fujifilm Instax Mini 41 Review
Posted 2-May-2025 10:12


Synology DS925+ Review
Posted 23-Apr-2025 15:00


Synology Announces DiskStation DS925+ and DX525 Expansion Unit
Posted 23-Apr-2025 10:34


JBL Tour Pro 3 Review
Posted 22-Apr-2025 16:56


Samsung 9100 Pro NVMe SSD Review
Posted 11-Apr-2025 13:11


Motorola Announces New Mid-tier Phones moto g05 and g15
Posted 4-Apr-2025 00:00









Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.







Backblaze unlimited backup