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,033 thoughts on “Setting Multiple Domain pada Apache Tomcat

  1. Hello there! Do you use Twitter? I’d like to follow you if that would be ok. I’m absolutely enjoying your blog and look forward to new posts.|

  2. Heya i am for the primary time here. I came across this board and I in finding It really helpful & it helped me out a lot. I’m hoping to give something back and aid others such as you aided me.|

  3. I got this web site from my pal who shared with me concerning this website and at
    the moment this time I am browsing this web page and reading very informative posts at this time.

  4. I’m not sure exactly why but this web site is loading very slow for
    me. Is anyone else having this problem or is it a
    issue on my end? I’ll check back later on and see if the problem still exists.

  5. Unquestionably believe that that you stated. Your favorite reason appeared to be on the net the easiest factor to take
    into accout of. I say to you, I certainly get annoyed even as other folks consider
    worries that they just don’t understand about.

    You controlled to hit the nail upon the top and defined out the entire thing with no need side effect , people
    could take a signal. Will likely be back to get more. Thanks

  6. Cool blog! Is your theme custom made or did you download it from somewhere?
    A theme like yours with a few simple adjustements
    would really make my blog stand out. Please let me know where you got your design. Many thanks

Comments are closed.