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. Woah! I’m really loving the template/theme of this blog.
    It’s simple, yet effective. A lot of times it’s tough to get that “perfect balance” between usability and visual appeal.
    I must say you have done a awesome job with this.
    Also, the blog loads extremely fast for me on Opera.
    Outstanding Blog!

  2. I am sure this piece of writing has touched all the internet people, its really really pleasant
    post on building up new weblog.

  3. It’s perfect time to make a few plans for the future and it is time to
    be happy. I’ve learn this put up and if I may I want to recommend you some attention-grabbing things or advice.

    Maybe you could write subsequent articles referring to this article.
    I wish to learn more things approximately it!

  4. Its like you read my mind! You seem to understand so much
    about this, such as you wrote the e-book in it or something.
    I think that you simply could do with a few p.c. to power the
    message house a bit, but other than that, this is
    excellent blog. A great read. I’ll certainly be back.

  5. It’s the best time to make some plans for the future and it
    is time to be happy. I have read this put up and if I may
    I desire to recommend you few attention-grabbing things or
    advice. Perhaps you can write subsequent articles relating to this
    article. I desire to learn even more things about it!

  6. I seriously love your site.. Very nice colors & theme.
    Did you develop this website yourself? Please reply back as I’m
    hoping to create my own blog and would love to learn where you
    got this from or what the theme is named. Appreciate it!

  7. This is really interesting, You are a very skilled blogger.
    I’ve joined your rss feed and look forward to seeking more of your
    fantastic post. Also, I’ve shared your website in my social networks!

  8. That is really attention-grabbing, You’re an excessively professional blogger. I have joined your rss feed and stay up for in the hunt for extra of your wonderful post. Additionally, I’ve shared your web site in my social networks|

  9. You actually make it seem so easy with your presentation but I find this topic to be actually something which I think I would never understand. It seems too complicated and extremely broad for me. I am looking forward for your next post, I will try to get the hang of it!|

  10. Hi, i read your blog occasionally and i own a similar one and i
    was just curious if you get a lot of spam feedback? If so how do you prevent it, any plugin or
    anything you can advise? I get so much lately it’s driving me
    insane so any help is very much appreciated.

Comments are closed.