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.

11,487 thoughts on “Setting Multiple Domain pada Apache Tomcat

  1. I’m pretty pleased to uncover this website. I wanted to thank you for ones time just for this fantastic read!!
    I definitely liked every little bit of it and I have you saved as a favorite to check out new information in your blog.

  2. Hello, everything is going well here and ofcourse every one is sharing information, that’s genuinely excellent, keep up writing.

  3. Sweet blog! I found it while browsing on Yahoo News. Do you
    have any suggestions on how to get listed in Yahoo News?
    I’ve been trying for a while but I never
    seem to get there! Thank you

  4. I don’t even understand how I finished up right
    here, but I thought this post used to be great. I don’t understand who you might be but definitely you’re
    going to a well-known blogger in case you aren’t already.
    Cheers!

  5. Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something.
    I think that you could do with some pics to drive the message home a bit, but instead of that, this
    is excellent blog. An excellent read. I’ll certainly be back.

Leave a Reply

Your email address will not be published.