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. whoah this weblog is magnificent i really like reading your articles.
    Keep up the good work! You understand, lots of persons are hunting
    around for this information, you could help them greatly.

  2. Go here to see 1how to get diamonds on cooking fever

    k23lartds11
    This game is more fun when you have as many gems as you could ever want.If you love phone games like this you ought to check out this site

  3. excellent submit, very informative. I’m wondering why the other
    specialists of this sector don’t understand this.

    You must continue your writing. I am confident, you’ve a great readers’ base already!

  4. Hi there! Quick question that’s completely off topic.
    Do you know how to make your site mobile friendly?

    My site looks weird when viewing from my iphone 4.
    I’m trying to find a template or plugin that might be able to correct this
    problem. If you have any recommendations, please share.
    With thanks!

  5. I do not even know the way I ended up here, however I thought this post used to be good. I do not realize who you might be however definitely you are going to a well-known blogger in case you are not already. Cheers!|

Comments are closed.