I have made a private cloud using ubuntu 12.04 LTS. I have a maas main server. On that server, I want to host my web application written with java, tomcat and mysql. My maas main server ip address is 192.168.43.191 and dns name is ubuntucloud. So, when I call it from browser like (http: ubuntucloud), I can reach and see "It's work. This is the default web page for this server. The web server software is running but no content has been added yet" sentences. I can call my web application like (http: ubuntucloud:8080/IRMultiAgent/) while running tomcat server in eclipse. I want to call my web app like (http://www.ir_multi_agent/). How to do this? ps: I omit some "/" in my post, because of error
You can configure your Apache web server to forward requests to Tomcat using
mod_jk (The Apache Tomcat Connector). Setup an Apache vhost which acts as some kind of proxy to speak to Tomcat and is also able to rewrite the URL. Thus,
ubuntucloud:8080/IRMultiAgent/ can be accessed at e.g.
irmultiagent.ubuntucloud/ (Smart HowTo)
Since you already configured the domain
ubuntucloud to point to your server, you should be able to also setup such a DNS for
ir_multi_agent. Both can point to the same IP. Just make sure to configure the
ServerName of the vhosts directives in the Apache configuration correctly.
The simplest way to do this is to add the name
ir_multi_agent to your
/etc/hosts file. In order to do that, edit that file using
sudo vi /etc/hosts or
sudo nano /etc/hosts and add the line
From then on, you will be able to browse to
http://ir_multi_agent:8080/IRMultiAgent and access your application.
To get rid of the
:8080 in that URL, you have two options:
- Run Tomcat on the default http port (80) by editing the port number
conf/server.xmlfile. Note that this requires you to run Tomcat as root.
- Front the Tomcat server with a reverse proxy, which will require installing and configuring an http server such as apache2 or nginx.
Now, your URL is down to
http://ir_multi_agent/IRMultiAgent. To get rid of the
IRMultiAgent context root, you again have two options:
- Deploy the application as the
ROOTweb application on Tomcat. That is, put it in the folder
- Use rewrite rules on the reverse proxy.
There you have it, your own webapplication at
Before embarking on all this, please consider Shakespeare's wisdom. An URL is but a name.