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. Tremendous issues here. I am very satisfied to peer your article.
    Thank you so much and I am having a look forward to contact you.
    Will you please drop me a e-mail?

  2. Wow, incredible weblog format! How long have you been running a blog for?
    you made blogging glance easy. The overall look of your site is magnificent, let alone the content material!

  3. Excellent post. I was checking continuously this blog and I
    am impressed! Very useful info specifically the last part :
    ) I care for such info a lot. I was seeking this particular info for a very long time.
    Thank you and good luck.

  4. We stumbled over here different website and thought I may as well check things out.
    I like what I see so now i am following you.
    Look forward to checking out your web page repeatedly.

  5. Hello! Quick question that’s entirely off topic.
    Do you know how to make your site mobile friendly?
    My weblog looks weird when browsing from my apple
    iphone. I’m trying to find a template or plugin that might be able to resolve this problem.
    If you have any recommendations, please share. Thanks!

  6. Hi there i am kavin, its my first occasion to commenting anyplace, when i read this
    article i thought i could also make comment due to this good piece
    of writing.

  7. I visited many web sites but the audio quality for audio songs
    current at this web page is really fabulous.

  8. Hey! I just wanted to ask if you ever have any issues with hackers?
    My last blog (wordpress) was hacked and I ended up losing many months
    of hard work due to no back up. Do you have any solutions to stop hackers?

  9. I would like to thank you for the efforts
    you have put in writing this site. I’m hoping to view the
    same high-grade blog posts from you later on as well.
    In truth, your creative writing abilities has inspired me
    to get my own blog now 😉

  10. An interesting discussion is definitely worth comment.
    There’s no doubt that that you need to publish more about this
    issue, it may not be a taboo subject but generally people do not speak about such issues.
    To the next! Many thanks!!

  11. Attractive section of content. I just stumbled upon your
    blog and in accession capital to assert that I acquire actually enjoyed account your blog posts.
    Any way I will be subscribing to your augment and even I achievement you access consistently fast.

  12. Thank you for some other informative web site. Where else may just I am getting that kind of info written in such an ideal method? I’ve a mission that I’m simply now working on, and I have been on the glance out for such information.|

Comments are closed.