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. First off I want to say awesome blog! I had a quick
    question in which I’d like to ask if you don’t mind.
    I was curious to know how you center yourself and clear your head before writing.

    I’ve had a tough time clearing my mind in getting my thoughts
    out. I truly do enjoy writing but it just seems like the first 10
    to 15 minutes are usually lost simply just trying
    to figure out how to begin. Any suggestions or tips?
    Cheers!

  2. Do you mind if I quote a couple of your posts as long as I
    provide credit and sources back to your website? My blog is in the very same niche as yours and
    my visitors would definitely benefit from a lot of the information you present here.
    Please let me know if this ok with you. Cheers!

  3. What’s up everyone, it’s my first pay a quick visit at this
    website, and article is genuinely fruitful in support of me, keep up posting these types of content.

  4. excellent issues altogether, you just gained a logo new reader.
    What could you suggest about your submit that you made a few days in the past?
    Any sure?

  5. Hi there to every one, the contents present at this site are in fact
    amazing for people knowledge, well, keep up the nice work fellows.

  6. Howdy! This post could not be written any better! Reading this post reminds me of
    my good old room mate! He always kept talking about this.
    I will forward this page to him. Pretty sure he
    will have a good read. Thanks for sharing!

Comments are closed.