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.

10,014 thoughts on “Setting Multiple Domain pada Apache Tomcat

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

  2. It’s awesome to go to see this web site and
    reading the views of all mates concerning this
    article, while I am also keen of getting experience.

  3. I got this site from my buddy who shared with me regarding this site and now this time I am visiting this web site and reading very informative articles at this time.|

  4. Hello would you mind sharing which blog platform you’re working with?

    I’m looking to start my own blog soon but I’m having a difficult time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your layout seems different then most blogs and I’m looking for something completely unique.
    P.S Apologies for getting off-topic but I had to ask!

  5. excellent points altogether, you just won a logo new reader.
    What could you recommend about your submit that you just made a few days ago?

    Any certain?

  6. I’m really enjoying the theme/design of your blog. Do you ever run into any internet browser compatibility problems? A number of my blog readers have complained about my blog not operating correctly in Explorer but looks great in Opera. Do you have any ideas to help fix this problem?|

  7. I will right away clutch your rss as I can not in finding
    your e-mail subscription link or e-newsletter service.

    Do you’ve any? Please permit me recognize so that I could
    subscribe. Thanks.

  8. I will immediately grab your rss as I can not to find
    your email subscription hyperlink or newsletter
    service. Do you’ve any? Please permit me recognize in order that I
    could subscribe. Thanks.

  9. I need to to thank you for this wonderful read!!
    I definitely loved every bit of it. I have you book-marked
    to look at new stuff you post…

  10. Greetings! I know this is somewhat off topic
    but I was wondering which blog platform are you using for this site?
    I’m getting sick and tired of WordPress because I’ve had issues with
    hackers and I’m looking at alternatives for another platform.
    I would be great if you could point me in the direction of a good platform.

  11. I just couldn’t depart your site prior to suggesting that I extremely loved the usual information a person supply to your visitors? Is going to be back ceaselessly in order to inspect new posts|

  12. I enjoy what you guys are usually up too. This kind of clever work and coverage!

    Keep up the superb works guys I’ve added you guys to my blogroll.

  13. When I initially commented I appear to have clicked the -Notify me when new
    comments are added- checkbox and now each time a comment is added I recieve 4
    emails with the same comment. There has to be a means you
    are able to remove me from that service? Many thanks!

Comments are closed.