Live Chat Software by Kayako
Working with PostgreSql (postgres) and Apache Tomcat in ubuntu
Posted by Thang Le Toan on 07 July 2018 05:29 AM

For users who have been through Ubuntu, executing applications in ubuntu via terminal might sound easy but its not the same case for the windows users. Assuming PostgreSql and Tomcat is already installed in your system, (if not refer here) lets see how to execute them.
1. PostgreSql (Postgres):

PostgreSql by default resides in the port 5432 and unless and until you have modified that, the command remains the same everywhere. So open the terminal and use the following command for Staring Postgres

1
sudo /etc/init.d/postgresql-8.4 start

To shutdown postgres,

1
sudo /etc/init.d/postgresql-8.4 stop

Note : The version 8.4 might not be the version that you installed. so use the version number, and first try without giving sudo. If an error “permission denied” comes up, then use sudo. Sudo command is to upgrade yourself to the root user or admin for that operation alone. To check your postgres version, open the terminal and give the following command.

1
psql -U postgres

It will prompt for the password (which should be either syspass or postgres depending upon how we configure it) and once its provided, it will show the version ( shown as psql(8.4.8) )  and psql prompt as shown in the screenshot.

2. Apache Tomcat :

Tomcat server, usually the  folder reside in the usr/local folder if u install through the synoptic package manager, but I download the source from tomcat and then put it in my convenient folder. this is because I ve to either write a shell script or go to the source folder to execute commands. So lets execute it by the folder way. I assume its in /home in a folder called tomcat6. Use the following commands for startup and shutdown.

For Staring Tomcat:
1
sudo /home/tomcat6/bin/startup.sh

To Shutdown Tomcat:

1
sudo /home/tomcat6/bin/shutdown.sh<br />

In case you have installed Tomcat from the Ubuntu Repositories or through the binary execution file, the startup and shutdown commands are as follows:

1
<br /><br />For Starting Tomcat:<br /><br />sudo /etc/init.d/tomcat6 start<br /><br />For Stopping Tomcat:<br /><br />sudo /etc/init.d/tomcat6 stop<br /><br />

Note :

For Windows Users:

You have to basically go into the bin folder of tomcat and run the Catalina batch file.

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).

Help Desk Software by Kayako