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. I for all time emailed this web site post page to all my contacts, for
    the reason that if like to read it after that my friends
    will too.

  2. Wonderful goods from you, man. I’ve take note your stuff prior to and you are simply extremely fantastic.
    I actually like what you have got here, really like what you’re
    stating and the best way during which you assert it.

    You make it enjoyable and you still take care of to keep it smart.
    I cant wait to read far more from you. That is really a terrific site. https://cialis.studiowestinc.com/tadalafil

  3. hello!,I like your writing so a lot! percentage we keep up a correspondence
    extra about your article on AOL? I need a specialist on this area to resolve my
    problem. Maybe that is you! Taking a look forward to look
    you.

  4. I am actually glad to read this weblog posts which includes plenty of helpful data, thanks for providing these statistics.

  5. I have to thank you for the efforts you have put in writing this site.
    I am hoping to view the same high-grade blog posts from you later on as well.
    In fact, your creative writing abilities has encouraged me
    to get my very own site now 😉

Comments are closed.