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.

3,300 thoughts on “Setting Multiple Domain pada Apache Tomcat

  1. Hi there! Do you know if they make any plugins to safeguard against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any tips?|

  2. Excellent blog you have here.. It’s difficult to find high-quality writing like yours nowadays. I truly appreciate people like you! Take care!!|

  3. Hey there! I just wanted to ask if you ever have any trouble
    with hackers? My last blog (wordpress) was hacked and I ended up losing several
    weeks of hard work due to no back up. Do you have any solutions to protect against
    hackers?

  4. For the reason that the admin of this web site is working, no hesitation very quickly it will be well-known, due to its quality contents.|

  5. Have you ever thought about creating an e-book or guest authoring
    on other blogs? I have a blog centered on the same subjects you discuss and would love to have you share
    some stories/information. I know my viewers
    would value your work. If you’re even remotely interested, feel free to shoot me an e-mail.

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

  7. Hi my friend! I wish to say that this post is amazing, nice written and include almost all significant infos. I would like to see extra posts like this .|

  8. Howdy! I just wish to offer you a big thumbs up for your excellent information you’ve got here on this post. I am coming back to your web site for more soon.|

Comments are closed.