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. Spot on with this write-up, I absolutely feel this amazing site needs a great deal more attention. I’ll probably be returning to read more, thanks for the advice!|

  2. It’s the best time to make some plans for the future and it’s time to be happy.

    I have read this post and if I could I desire to suggest you some interesting things or suggestions.
    Perhaps you can write next articles referring
    to this article. I want to read more things about it!

  3. Ahaa, its good dialogue about this post here at this weblog, I have
    read all that, so at this time me also commenting at this place.

  4. I don’t even know how I ended up here, but I thought this post was great. I don’t know who you are but definitely you’re going to a famous blogger if you are not already 😉 Cheers!|

  5. Hi there, simply became alert to your weblog through Google, and located that it is truly informative. I’m going to be careful for brussels. I’ll appreciate in case you proceed this in future. A lot of people will probably be benefited out of your writing. Cheers!|

Comments are closed.