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.

9,917 thoughts on “Setting Multiple Domain pada Apache Tomcat

  1. It’s really a cool and useful piece of info. I am happy
    that you shared this useful info with us. Please keep us up to date like this.
    Thank you for sharing.

  2. Magnificent items from you, man. I’ve take note your stuff prior to
    and you’re just extremely wonderful. I actually like what you’ve got right here, really like what you’re
    stating and the way by which you assert it.
    You make it enjoyable and you continue to take care of to
    stay it smart. I can’t wait to read far more from you. This is really
    a tremendous site.

  3. Hi mates, its fantastic paragraph regarding cultureand entirely explained, keep it up all the time.

  4. Amazing blog! Do you have any hints for aspiring writers?
    I’m planning to start my own website soon but I’m a little lost on everything.
    Would you suggest starting with a free platform like WordPress or
    go for a paid option? There are so many choices out
    there that I’m totally confused .. Any suggestions? Kudos!

  5. Hi there! I could have sworn I’ve visited this website before but after looking at some of the articles I
    realized it’s new to me. Anyways, I’m definitely pleased I found it and I’ll be bookmarking it and checking back often!

  6. Having read this I thought it was rather informative.
    I appreciate you taking the time and effort to put this
    content together. I once again find myself personally spending
    a lot of time both reading and commenting. But so what, it was still worthwhile!

  7. If some one wishes to be updated with most
    recent technologies after that he must be visit this website and be up
    to date every day.

Comments are closed.