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.

1,719 thoughts on “Setting Multiple Domain pada Apache Tomcat

  1. It’s a pity you don’t have a donate button! I’d
    without a doubt donate to this superb blog!
    I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account.

    I look forward to new updates and will share this site with my Facebook group.
    Talk soon!

  2. Admiring the dedication you put into your blog and detailed information you offer. It’s good to come across a blog every once in a while that isn’t the same unwanted rehashed information. Fantastic read! I’ve saved your site and I’m adding your RSS feeds to my Google account.|

  3. Amazing! This blog looks just like my old one!
    It’s on a totally different subject but it has pretty much the same page layout and design. Great choice of colors!

  4. I don’t even understand how I finished up right here, but I assumed this publish was good. I don’t understand who you are but certainly you are going to a famous blogger in case you aren’t already. Cheers!|

  5. Hey! I just wanted to ask if you ever have any issues with hackers? My last blog (wordpress) was hacked and I ended up losing several weeks of hard work due to no backup. Do you have any methods to protect against hackers?|

  6. I’m gone to inform my little brother, that he should also visit this weblog on regular basis
    to take updated from latest news update.

Comments are closed.