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. My coder is trying to convince me to move to .net from PHP.
    I have always disliked the idea because of the expenses.

    But he’s tryiong none the less. I’ve been using Movable-type on various websites for about a year
    and am worried about switching to another platform.
    I have heard very good things about blogengine.net.
    Is there a way I can import all my wordpress content into
    it? Any help would be really appreciated!

  2. With havin so much content do you ever run into
    any problems of plagorism or copyright violation? My blog has
    a lot of unique content I’ve either created myself or outsourced
    but it seems a lot of it is popping it up all over the internet without my authorization. Do you know any techniques to
    help reduce content from being stolen? I’d definitely appreciate it.

  3. Asking questions are actually pleasant thing if you are not understanding something
    totally, however this paragraph provides nice understanding
    even.

  4. Whats up this is kind of of off topic but I was wanting to
    know if blogs use WYSIWYG editors or if you have to manually code with HTML.
    I’m starting a blog soon but have no coding skills so I wanted to get guidance
    from someone with experience. Any help would be greatly appreciated!

  5. My partner and I stumbled over here by a different web page and thought I may as
    well check things out. I like what I see so now i am following you.
    Look forward to finding out about your web page yet again.

  6. Wow, wonderful weblog layout! How long have you
    been running a blog for? you make running a blog look easy.
    The total glance of your web site is excellent, let
    alone the content material!

Comments are closed.