Debian Admin

Debian/Ubuntu Linux System Administration Tutorials,Howtos,Tips

  • RSS Subscribe

    subscribe to the Debian Admin RSS feed
  • Sponsors



  • Categories

  • Sponsors

  • Support DebianAdmin

    Amount $:
    Website(Optional):


  • Meta

  • Archives



Apache Public webserver with multiple local webserver with Debian

Posted by arisnb on May 18th, 2009

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

If we have one Ip Public, but our web server more then one. How to configuration with apache webserver ? Tukang Nggame have tips. That tips have implemeted with GNU/Linux Debian Etch and Lenny.

Follow example network topology :

wbsvr-1,wbsvr-2,etc —–main-server(public)——–client-browser

wbsvr-1 is a local webserver 1, example http://192.168.1.1/tukang-nggame/
wbsvr-2 is a local webserver 2, example http://192.168.1.2/tukangnggame/
main-server(public) is main web server, exh http://www.example.com

client-browser is a browser how we browse our homepage (exp Mozilla Firefof, Opera, IE, Safari or the other )

In main-server use Apache web server and Isntall mod proxy-html. This command at console :

#apt-get install libapache2-mod-proxy-html

Enable that module (make link module) with command at console :

#ln -s /etc/apache2/mods-available/proxy_http.conf /etc/apache2/mods-enabled/proxy_html.conf
#ln -s /etc/apache2/mods-available/proxy_http.load  /etc/apache2/mods-enabled/proxy_html.load

Edit configuration /etc/apache2/apache2.conf (main server)


<Location /tukang-nggame/ >

Order Deny,Allow

Allow from All

ProxyPass http://192.168.1.1/tukang-nggame/

ProxyPassReverse   http://192.168.1.1/tukang-nggame/

< /Location >


<Location /tukangnggame/ >

Order Deny,Allow

Allow from All

ProxyPass http://192.168.1.2/tukangnggame/

ProxyPassReverse   http://192.168.1.2/tukangnggame/

< /Location >

Restart apache server in main server with command at console.
#/etc/init.d/apache2 restart

Then browse from client-browser
http://192.168.1.1/tukang-nggame/ with url http://www.example.com/tukang-nggame/
http://192.168.1.1/tukangnggame/ with url http://www.example.com/tukangnggame/

Don’t forget last url with slash (/).

  • Share/Bookmark

2 Responses to “Apache Public webserver with multiple local webserver with Debian”

  1. foo Says:

    That’s usually called a “Reverse proxy”.

  2. RLBFerreira Says:

    When you say:

    Enable that module (make link module) with command at console :

    #ln -s /etc/apache2/mods-available/proxy_http.conf /etc/apache2/mods-enabled/proxy_html.conf
    #ln -s /etc/apache2/mods-available/proxy_http.load /etc/apache2/mods-enabled/proxy_html.load

    You could just use this little command: a2enmod proxy_http

    Use the debian way… It’ll simplify your work ;)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>