Setting Multiple Domain pada Apache Tomcat

Tutorial

Banyak domain (Multiple domain) dapat diletakkan pada satu mesin/server dengan satu web server, misalnya Tomcat, Apache atau IIS. Cara seperti ini dapat digunakan untuk menghemat IP publik. Beberapa domain dan subdomain misalnya www.domainku.com, blog.domainku.com dan download.domainku.com dapat di-host pada satu web server dengan satu IP publik.

Pada tomcat, yang perlu dilakukan adalah menambahkan beberapa konfigurasi:

Pertama,
Buka file server.xml pada ${CATALINA_HOME}/conf
${CATALINA_HOME} adalah direktori tempat tomcat diinstall. Misalnya /usr/local/tomcat pada linux atau c:\tomcat ada Windows tergantung dimana Tomcat diinstall, kemudian tambahkan kode berikut:

<Server>
     <Service>
         <Engine>
           ..................
           ..................
           <Host name="blog.domainku.com"
                       debug="0"
                       appBase="/home/user/blog"
                       unpackWARs="true"
                       autoDeploy="true"
                       xmlValidation="true"
                       xmlNamespaceAware="false">
                    <Alias>blog.domainku.com</Alias>
           </Host>
         </Engine>
     </Service>
 </Server>

Kedua,
Masuk ke direktori ${CATALINA_HOME}/conf/Catalina dan buat direktori baru blog.domainku.com

Ketiga,
Masuk ke direktori ${CATALINA_HOME}/conf/Catalina/blog.domainku.com dan buat file baru dengan nama ROOT.xml yang isinya adalah sebagai berikut:

<Context docBase="/home/user/blog" path="" />

Terakhir,
Restart tomcat.

10,014 thoughts on “Setting Multiple Domain pada Apache Tomcat

  1. An impressive share! I have just forwarded this onto a
    friend who had been doing a little research on this.

    And he actually ordered me dinner simply because I found it for him…
    lol. So allow me to reword this…. Thanks
    for the meal!! But yeah, thanks for spending time to discuss this matter here on your internet
    site.

  2. I am extremely impressed with your writing skills and
    also with the layout on your blog. Is this a paid theme or did you customize it yourself?
    Either way keep up the excellent quality writing, it
    is rare to see a great blog like this one nowadays.

  3. What’s up, all the time i used to check web site posts here in the early
    hours in the dawn, for the reason that i love to gain knowledge of more and more.

  4. This piece of writing will help the internet people for building up new web site or even a weblog from start to end.

  5. Pingback: viagra sale amazon

Comments are closed.