May 182009
 

Sponsored Link

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 (/).

Sponsored Link

 Posted by at 12:14 am

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

  1. That’s usually called a “Reverse proxy”.

  2. 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 ;)

  3. But how do I resolve DNS on internet? to find the server…

 Leave a Reply

(required)

(required)

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