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. Have you ever considered publishing an ebook or guest authoring on other websites? I have a blog based on the same ideas you discuss and would really like to have you share some stories/information. I know my subscribers would enjoy your work. If you are even remotely interested, feel free to shoot me an e-mail.|

  2. hello there and thank you for your info – I have certainly picked up something new from right here. I did however expertise several technical issues using this web site, as I experienced to reload the web site a lot of times previous to I could get it to load properly. I had been wondering if your hosting is OK? Not that I am complaining, but slow loading instances times will very frequently affect your placement in google and could damage your high-quality score if ads and marketing with Adwords. Well I am adding this RSS to my email and could look out for much more of your respective fascinating content. Ensure that you update this again soon.|

  3. These are in fact enormous ideas in concerning blogging. You have touched some good factors here. Any way keep up wrinting.|

  4. My brother recommended I might like this blog. He was entirely right. This post actually made my day. You cann’t imagine just how much time I had spent for this information! Thanks!|

  5. Ahaa, its pleasant conversation about this article at this place at this website, I have read all that, so now me also commenting at this place.|

  6. I am not sure where you are getting your info, but great topic.
    I needs to spend some time learning much more or understanding more.

    Thanks for excellent info I was looking for this info for my
    mission.

Comments are closed.