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. This piece of writing is truly a pleasant one it helps new internet visitors, who are wishing in favor
    of blogging.

  2. Hey I know this is off topic but I was wondering if you knew of any widgets I could
    add to my blog that automatically tweet my newest twitter updates.

    I’ve been looking for a plug-in like this
    for quite some time and was hoping maybe you would have some experience with something like this.
    Please let me know if you run into anything.
    I truly enjoy reading your blog and I look forward to your
    new updates.

  3. What i do not realize is if truth be told how
    you are not really a lot more well-preferred than you might be now.
    You’re so intelligent. You realize therefore considerably
    in the case of this matter, produced me in my view believe it from
    so many numerous angles. Its like men and women don’t seem to be involved unless it is something to accomplish with Girl gaga!
    Your personal stuffs great. Always deal with it up!

  4. Paragraph writing is also a fun, if you be acquainted with then you can write if not it is
    difficult to write.

  5. Its like you read my mind! You seem to know a lot about this, like you wrote the book in it
    or something. I think that you can do with some pics to drive the
    message home a bit, but other than that, this is fantastic blog.

    A great read. I will definitely be back.

  6. certainly like your web site however you have to take a look at the
    spelling on several of your posts. Many of them are rife with spelling
    issues and I find it very bothersome to tell the truth on the other
    hand I will definitely come again again.

  7. Hi there! I’m at work surfing around your blog from
    my new iphone! Just wanted to say I love reading your blog and look forward
    to all your posts! Carry on the outstanding work!

  8. What’s Taking place i’m new to this, I stumbled upon this I have found It positively useful and it
    has helped me out loads. I am hoping to contribute
    & help different users like its helped me. Great job.

  9. Good day I am so thrilled I found your weblog, I really found you by mistake,
    while I was researching on Yahoo for something else, Anyhow
    I am here now and would just like to say cheers for a tremendous post and
    a all round enjoyable blog (I also love the theme/design), I don’t have time to read it all at the
    minute but I have bookmarked it and also added in your RSS feeds, so when I have time I
    will be back to read more, Please do keep up the fantastic jo.

  10. Heya i’m for the first time here. I found this board and I find It truly useful & it helped me out a lot.
    I hope to give something back and help others like you helped me.

Comments are closed.