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. What’s up, I desire to subscribe for this weblog to get most up-to-date updates, therefore where can i do
    it please help.

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

  3. Hey! This is my first visit to your blog! We are a team of volunteers
    and starting a new project in a community in the same niche.
    Your blog provided us useful information to
    work on. You have done a wonderful job!

  4. Useful information. Lucky me I discovered your website by
    chance, and I am stunned why this coincidence did not happened earlier!
    I bookmarked it.

  5. You really make it seem so easy with your presentation but I find this
    matter to be actually something which I think I would never understand.
    It seems too complex and very broad for me. I’m looking forward for your next post, I’ll try to get the hang of it!

  6. Do you mind if I quote a few of your articles as
    long as I provide credit and sources back to your webpage?
    My blog is in the very same niche as yours and my visitors
    would genuinely benefit from some of the information you provide here.
    Please let me know if this okay with you. Thanks!

  7. 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 certainly you are going to a famous blogger
    if you aren’t already 😉 Cheers!

  8. My partner and I stumbled over here from a different web address and
    thought I might as well check things out. I like what
    I see so i am just following you. Look forward to exploring your web page for a second time.

Comments are closed.