Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786

Warning: mysql_real_escape_string() [function.mysql-real-escape-string]: A link to the server could not be established in /home/content/51/12486951/html/kurinchilamp/wp-content/plugins/statpress-reloaded/statpress.php on line 1786
Kurinchi Blogger Scribbles … » Blog Archive » How to configure Tomcat in Ubuntu?

How to configure Tomcat in Ubuntu?

Configuring Tomcat in Ubuntu with Apache server running on it

Login with the root account. Check if java is already installed on the machine. If not, first install java on ubuntu.

Web get the apache-tomcat tar file from the below location

$ cd /tmp
$ wget http://apache.hoxt.com/tomcat/tomcat-6/v6.0.18/bin/apache-tomcat-6.0.18.tar.gz

Untar the file
$ tar xvzf apache-tomcat-6.0.18.tar.gz

Move the tomcat file to a location of your choice
$ mv apache-tomcat-6.0.18 /usr/local/tomcat

Now, edit the profile setting to add JAVA_HOME setting
$ vi ~/.bashrc

Add the below line and save the file

export JAVA_HOME=/usr/lib/jvm/java-6-sun

Now restart tomcat

$ /usr/local/tomcat/./startup.sh

Another way to do this is to setup a shell script in /etc/init.d

$ vi /etc/init.d/tomcat

#Tomcat start, stop, restart

export JAVA_HOME=/usr/lib/jvm/java-6-sun

case $1 in
start)
sh /usr/local/tomcat/bin/startup.sh
;;
stop)
sh /usr/local/tomcat/bin/shutdown.sh
;;
restart)
sh /usr/local/tomcat/bin/shutdown.sh
sh /usr/local/tomcat/bin/startup.sh
;;
esac
exit 0

Save the file and given execute permission for the script. Check your path settings for JAVA_HOME and the tomcat file locations to ensure that the script executes as expected.

$ chmod 755 tomcat

Now you can start, stop, restart tomcat as

$ /etc/init.d/tomcat start
$ /etc/init.d/tomcat stop
$ /etc/init.d/tomcat restart

Test if Tomcat is running smoothly by going to

http://localhost:8080/

It should show the welcome screen from Apache Tomcat.

Note that Tomcat takes up the port 8080 for its applications by default. You can configure Tomcat to run as several instances as well.

Share

Written by kurinchilamp


Website: http://

Leave a Reply

Your email address will not be published. Required fields are marked *

Read previous post:
How to install Java on Ubuntu Linux?

Installing Java on Ubuntu Linux Edit /etc/apt/sources.list and add in the following lines (if they are not present already) $...

Close