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.
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
To shutdown postgres,
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.
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:
To Shutdown Tomcat:
In case you have installed Tomcat from the Ubuntu Repositories or through the binary execution file, the startup and shutdown commands are as follows:
For Windows Users:
You have to basically go into the bin folder of tomcat and run the Catalina batch file.