Avkash Chauhan's Blog

Windows Azure, Windows 8, Cloud Computing, Big Data and Hadoop: All together at one place.. One problem, One solution at One time...

Running Tomcat7 in Ubuntu Linux Virtual Machine at Windows Azure

Running Tomcat7 in Ubuntu Linux Virtual Machine at Windows Azure

Rate This
  • Comments 1
First create a Ubuntu Virtual Machine on Windows Azure and be sure it is running. Be sure to have SSH connection enabled working with your VM.
Once you can remote into your Ubuntu Linux VM over SSH try the following steps:

1. Installing Oracle Java SDK 

# sudo apt-get install openjdk-7-jre

2. Installing Tomcat 7:

#sudo apt-get install tomcat7

Creating config file /etc/default/tomcat7 with new version
Adding system user `tomcat7' (UID 106) ...
Adding new user `tomcat7' (UID 106) with group `tomcat7' ...
Not creating home directory `/usr/share/tomcat7'.
* Starting Tomcat servlet engine tomcat7 [ OK ]
Setting up authbind (1.2.0build3) ...

3. Adding new Endpoint to your VM for Tomcat:
After that you can add a new Endpoint at port 8080 in your Ubuntu VM 


4. Test Tomcat:
Once endpoint is configured you can test your Tomcat installation as just by opening the VM URL at port 8080 as below:


5. Install other Tomcat components:

# sudo apt-get install tomcat7-admin
# sudo apt-get install tomcat7-docs
# sudo apt-get install tomcat-examples
# sudo apt-get install tomcat-user



6. Setting Tomcat specific environment variables into setenv.sh @ /usr/share/tomcat7/bin/setenv.sh
root@ubuntu12test:~# vi /usr/share/tomcat7/bin/setenv.sh
export CATALINA_BASE=/var/lib/tomcat7
export CATALINA_HOME=/usr/share/tomcat7

Verifying setenv.sh

root@ubuntu12test:~# cat /usr/share/tomcat7/bin/setenv.sh
export CATALINA_BASE=/var/lib/tomcat7
export CATALINA_HOME=/usr/share/tomcat7

7. Shutdown Tomcat:

 root@ubuntu12test:~# /usr/share/tomcat7/bin/shutdown.sh
Using CATALINA_BASE: /var/lib/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /var/lib/tomcat7/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar

8. Start Tomcat:

root@ubuntu12test:~# /usr/share/tomcat7/bin/startup.sh
Using CATALINA_BASE: /var/lib/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using CATALINA_TMPDIR: /var/lib/tomcat7/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar


9. Tomcat Administration:

Edit /etc/tomcat7/tomcat-users.xml to setup your admin credentials
root@ubuntu12test:~# vi /etc/tomcat7/tomcat-users.xml

10. My Tomcat configuration looks likes as below:

root@ubuntu12test:~# cat /etc/tomcat7/tomcat-users.xml
<tomcat-users>
<role rolename="manager"/>
<role rolename="admin"/>
<role rolename="manager-gui"/>
<role rolename="manager-status"/>
<user username="tomcat_user" password="tomcat_password" roles="manager,admin,manager-gui,manager-status"/>
</tomcat-users>

Verifying Tomcat Administration:




Leave a Comment
  • Please add 7 and 6 and type the answer here:
  • Post
  • hi!

    yesterday i create new ubuntu machine in azure. then connect  via SSH

    login with my user credentials

    try run sudo apt-get install

    and see the message "kirilenko is not in the sudoers file.  This incident will be reported."

    what the default password on root in this machine?

Page 1 of 1 (1 items)