SlideShare a Scribd company logo
1 of 8
Download to read offline
bbconcepteur@gmail.com goodluck guy
| 1P a g e
Install tomcat in debian
- Postgres databases (Zzzzz , Tabuchi, Sumitomo heavy, DID, JCU)
- Tomcat Debian GNU/Linux 7.5 x86_64 bit
- root
- Connect : http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html (putty)
Chú ý các config trên debian
1.Cài đặt Tomcat 5
Xoát tất tomcat 7: root@vm007:/usr/share# rm -r tomcat7
1.1 Install
Tạo thư mục toàn bộ tomcat 5
root@vm007:/usr/share# mkdir apache-tomcat-5.5.33
root@vm007:/usr/share# cd apache-tomcat-5.5.33
Copy lên thư mục được tạo:
pscp -r C:UsershungncDownloadsapache-tomcat-5.5.27.tar.gz
root@192.168.40.107:/var/lib/tomcat55download
root@vm007:/var/lib/tomcat55download/apache-tomcat-5.5.27# chown -R
tomcat.tomcat /var/lib/tomcat55download/apache-tomcat-5.5.27
root@vm007:/var/lib/tomcat55download# tar -xvf apache-tomcat-5.5.27.tar.gz
root@vm007:/var# service tomcat7 restart
Chạy startup.sh
root@vm007:/usr/share/apache-tomcat-5.5.33# ls
bin conf logs RELEASE-NOTES server temp work
common LICENSE NOTICE RUNNING.txt shared webapps
root@vm007:/usr/share/apache-tomcat-5.5.33# cd bin
root@vm007:/usr/share/apache-tomcat-5.5.33/bin# sh startup.sh
Cannot find ./catalina.sh
This file is needed to run this program
-> Nguyên nhân là các file thực thi chưa được phân quyền
Kiểm tra
root@vm007:/usr/share/apache-tomcat-5.5.33/bin# ls -la
total 1688
drwxr-xr-x 4 root root 4096 Feb 2 13:54 .
drwxr-xr-x 11 root root 4096 Feb 2 13:54 ..
-rw-r--r-- 1 root root 24384 Feb 2 13:54 bootstrap.jar
-rw-r--r-- 1 root root 9995 Feb 2 13:54 catalina.bat
-rw-r--r-- 1 root root 13131 Feb 2 13:54 catalina.sh
bbconcepteur@gmail.com goodluck guy
| 2P a g e
-rw-r--r-- 1 root root 1927 Feb 2 13:54 catalina-tasks.xml
-rw-r--r-- 1 root root 23546 Feb 2 13:54 commons-daemon.jar
-rw-r--r-- 1 root root 199453 Feb 2 13:54 commons-daemon-native.tar.gz
-rw-r--r-- 1 root root 52313 Feb 2 13:54 commons-logging-api-1.1.1.jar
-rw-r--r-- 1 root root 1334 Feb 2 13:54 cpappend.bat
-rw-r--r-- 1 root root 2107 Feb 2 13:54 digest.bat
-rw-r--r-- 1 root root 1627 Feb 2 13:54 digest.sh
drwxr-xr-x 2 root root 4096 Feb 2 13:54 i64
-rw-r--r-- 1 root root 2167 Feb 2 13:54 jmxaccessor-tasks.xml
-rw-r--r-- 1 root root 5088 Feb 2 13:54 service.bat
-rw-r--r-- 1 root root 3000 Feb 2 13:54 setclasspath.bat
-rw-r--r-- 1 root root 3577 Feb 2 13:54 setclasspath.sh
-rw-r--r-- 1 root root 2099 Feb 2 13:54 shutdown.bat
-rw-r--r-- 1 root root 1566 Feb 2 13:54 shutdown.sh
-rw-r--r-- 1 root root 2100 Feb 2 13:54 startup.bat
-rw-r--r-- 1 root root 1959 Feb 2 13:54 startup.sh
-rw-r--r-- 1 root root 868352 Feb 2 13:54 tcnative-1.dll
-rw-r--r-- 1 root root 74240 Feb 2 13:54 tomcat5.exe
-rw-r--r-- 1 root root 102912 Feb 2 13:54 tomcat5w.exe
-rw-r--r-- 1 root root 13505 Feb 2 13:54 tomcat-juli.jar
-rw-r--r-- 1 root root 241274 Feb 2 13:54 tomcat-native.tar.gz
-rw-r--r-- 1 root root 3471 Feb 2 13:54 tool-wrapper.bat
-rw-r--r-- 1 root root 3508 Feb 2 13:54 tool-wrapper.sh
-rw-r--r-- 1 root root 2104 Feb 2 13:54 version.bat
-rw-r--r-- 1 root root 1570 Feb 2 13:54 version.sh
drwxr-xr-x 2 root root 4096 Feb 2 13:54 x64
Đổi quyền toàn bộ thư mục
root@vm007:/usr/share/apache-tomcat-5.5.33# chmod 755 bin/*
Vẫn không thực thi được, tìm ra config khác để thực thi
root@vm007:/usr/share# mv apache-tomcat-5.5.33 tomcat
root@vm007:/usr/share/tomcat# cd bin
root@vm007:/usr/share/tomcat/bin# sh startup.sh
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
Kiểm tra lại cấu hình
root@vm007:/usr/share/tomcat/bin# vi catalina.sh
Sửa đổi các thông tin về JAVA_HOME, JRE_HOME
Thực thi lại
root@vm007:/usr/share/tomcat/bin# sh startup.sh
Using CATALINA_BASE: /usr/share/tomcat
Using CATALINA_HOME: /usr/share/tomcat
Using CATALINA_TMPDIR: /usr/share/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/java-7-openjdk-amd64/jre/
Using CLASSPATH: /usr/share/tomcat/bin/bootstrap.jar
Kiểm tra log
bbconcepteur@gmail.com goodluck guy
| 3P a g e
root@vm007:/usr/share/tomcat/logs# vi catalina.out
1.2 Add user đăng nhập Tomcat trên debian
Tìm đến thư mục Tomcat : /usr/share/tomcat
File
Nội dung cần chỉnh sửa
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="manager"/>
<role rolename="manager-gui"/>
<role rolename="manager-script"/>
<role rolename="manager-jmx"/>
<user username="tomcat" password="XXX@123"
roles="tomcat,manager,manager-gui,manager-script"/>
</tomcat-users>
<user username="tomcat" password="XXX@123" roles="tomcat,manager,manager-
gui,manager-script"/>
2.Cài đặt java version 1.7
Tìm đến thư mục Java : /usr/lib/jvm/
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)
3.Copy template lên thư mục server debian, ghi nhận path và config
+ Cài đặt: PuTTY
+ Sử dụng cmd window copy
pscp -r C:/Users/hungnc/Downloads/apache-tomcat-
7.0.57/* root@yyy.yyy.yy.yyyy:/usr/share/apache-tomcat-7.0.57
4.Config lại
app.home = /var/lib/tomcat7download/nttdata-zzzzz -template
db.host=yyy.yyy.yy.yyyy
db.port=5499
db.name=central_lgt2_20160129_uat
bbconcepteur@gmail.com goodluck guy
| 4P a g e
db.user=postgres
db.password=postgres
#db.password=zzzzz@vvvvvv
db.report.user=postgres
db.report.password=postgres
5.Biên dịch lại với điều chỉnh cho môi trường chạy trên debian
xxxx
6.Upload and deploy file war bằng web page của tomcat
http://yyy.yyy.yy.yyyy:8081/manager/html
- undeploy bản cũ
- upload bản war cùng tên, deploy
- run khi Running cho trạng thái là Tru và Message báo là OK
7.Test thực hiện UAT
http://yyy.yyy.yy.yyyy:8081/zzzzz /p/logout
bbconcepteur@gmail.com goodluck guy
| 5P a g e
8.Cài đặt Tomcat7
Ref: http://www.mkyong.com/tomcat/how-to-install-apache-tomcat-8-on-debian/
To get the basic package, we can update our package source list and then install the main package:
sudo apt-get update
sudo apt-get install tomcat7
Thực hiện
8.1 Delete version cũ
sudo apt-get remove tomcat7 tomcat7-docs tomcat7-admin tomcat7-examples default-jdk
ant git
-> rm -r all tomcat folder
/usr/share/
/var/lib/
/etc/init.d/
8.2 Reinstall manual
pscp -r C:/Users/hungnc/Downloads/apache-tomcat-7.0.67.tar.gz
root@yyy.yyy.yy.yyyy:/var/lib/tomcat7download
root@vm007:/var/lib/tomcat7download# sudo mkdir /usr/share/tomcat7
root@vm007:/var/lib/tomcat7download# sudo mv apache-tomcat-7.0.67
/usr/share/tomcat7
root@vm007:~# sudo rm -f /usr/share/tomcat
root@vm007:~# sudo ln -s /usr/share/tomcat7/apache-tomcat-7.0.67
/usr/share/tomcat
root@vm007:~# sudo chown -R tomcat:tomcat /usr/share/tomcat7
root@vm007:~# sudo chmod +x /usr/share/tomcat/bin/*.sh
root@vm007:~# cd /usr/share/tomcat/conf/
root@vm007:/usr/share/tomcat/conf# vi server.xml
root@vm007:~# cd /usr/share/tomcat/bin
root@vm007:/usr/share/tomcat/bin# sh startup.sh
Using CATALINA_BASE: /usr/share/tomcat
Using CATALINA_HOME: /usr/share/tomcat
Using CATALINA_TMPDIR: /usr/share/tomcat/temp
Using JRE_HOME: /usr
Using CLASSPATH:
/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar
Tomcat started.
root@vm007:/usr/share/tomcat/conf# vi tomcat-users.xml
root@vm007:/usr/share/tomcat/bin# sh shutdown.sh
root@vm007:/usr/share/tomcat/bin# sh startup.sh
bbconcepteur@gmail.com goodluck guy
| 6P a g e
9.Các câu lệnh trong linux
If your top-level directory is called images, then run
rm -r images/*
This uses the shell glob operator * to run rm -r on every file or directory within images
$ rmdir foo
In this example, move /home/vivek/data/ directory to /nas/home/vivek/archived/ directory:
$ mv /home/vivek/data/ /nas/home/vivek/archived/
OR
$ cd /home/vivek
$ mv data/ /nas/home/vivek/archived/
To get verbose output (explain what is being done), type:
$ mv -v /home/vivek/data/ /nas/home/vivek/archived/
10. Check service
root@vm007:/usr/share# runlevel
N 2
root@vm007:/usr/share# ls /etc/rc2.d/S*
/etc/rc2.d/S01motd /etc/rc2.d/S17atd /etc/rc2.d/S18exim4
/etc/rc2.d/S13rpcbind /etc/rc2.d/S17chrome-remote-desktop
/etc/rc2.d/S18network-manager
/etc/rc2.d/S14nfs-common /etc/rc2.d/S17cron /etc/rc2.d/S19gdm3
/etc/rc2.d/S16binfmt-support /etc/rc2.d/S17dbus
/etc/rc2.d/S19pulseaudio
/etc/rc2.d/S16rsyslog /etc/rc2.d/S17nginx /etc/rc2.d/S19saned
/etc/rc2.d/S16sudo /etc/rc2.d/S17ntp
/etc/rc2.d/S20bootlogs
/etc/rc2.d/S16supervisor /etc/rc2.d/S17postgresql
/etc/rc2.d/S21minissdpd
/etc/rc2.d/S16tomcat5.5 /etc/rc2.d/S17speech-dispatcher
/etc/rc2.d/S21rc.local
/etc/rc2.d/S16tomcat7 /etc/rc2.d/S17ssh
/etc/rc2.d/S21rmnologin
/etc/rc2.d/S17acpid /etc/rc2.d/S18avahi-daemon
/etc/rc2.d/S21teamviewerd
/etc/rc2.d/S17anacron /etc/rc2.d/S18bluetooth
root@vm007:/usr/share#
Install other version PostgreSQL 8.2 to Debian server
Kiểm tra version hiện tại (Postgres installed )
root@vm007:~# ps -ef | grep postgre
bbconcepteur@gmail.com goodluck guy
| 7P a g e
root@vm007:/etc/postgresql/8.2/main# vi postgresql.conf
Sử dụng các lệnh linux để edit
:x
:q!
Restart Postgres
root@vm007:~# /etc/init.d/postgresql restart
Để connect được cần cấu hình user truy cập
[OK !!!] --> all trust
root@vm007:/etc/postgresql/8.2/main# vi pg_hba.conf
# Database administrative login by Unix domain socket
local all postgres trust
# TYPE DATABASE USER CIDR-ADDRESS METHOD
host all all 192.168.1.0/24 trust
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5
Lệnh thay password user mặc định
Tạo user mới
root@vm007:/etc/postgresql/8.2/main# su - -c "useradd devteam devteam"
Cài đặt khác
Debian includes PostgreSQL by default. To install PostgreSQL on Debian,
use the apt-get (or other apt-driving) command:
apt-get install postgresql-9.4
To connect to the database, first you need to switch to the postgres user by issuing the following command while
logged in as root (this will not work with sudo access):
su - postgres
You now should be logged as postgres. To start the PostgreSQL console, type psql:
Psql
postgres=# SELECT * FROM pg_user;
usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig
----------+----------+-------------+----------+-----------+----------+----------+-----------
postgres | 10 | t | t | t | ******** | |
(1 row)
postgres=# SELECT * FROM pg_settings WHERE name = 'port';
name | setting | unit | category | short_desc
| extra_desc | context | vartype | source | min_val | max_val
bbconcepteur@gmail.com goodluck guy
| 8P a g e
------+---------+------+------------------------------------------------------+-----------------------------
-------------+------------+------------+---------+--------------------+---------+---------
port | 5432 | | Connections and Authentication / Connection Settings | Sets the TCP port the server
listens on. | | postmaster | integer | configuration file | 1 | 65535
(1 row)

More Related Content

What's hot

Creating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server HardeningCreating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server Hardeningarchwisp
 
Setting up a HADOOP 2.2 cluster on CentOS 6
Setting up a HADOOP 2.2 cluster on CentOS 6Setting up a HADOOP 2.2 cluster on CentOS 6
Setting up a HADOOP 2.2 cluster on CentOS 6Manish Chopra
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel CrashdumpMarian Marinov
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administratorDinesh jaisankar
 
ch3-pv1-memory-management
ch3-pv1-memory-managementch3-pv1-memory-management
ch3-pv1-memory-managementyushiang fu
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot managerAcácio Oliveira
 
Learning the command line
Learning the command lineLearning the command line
Learning the command lineAdrian Cardenas
 
First there was the command line
First there was the command lineFirst there was the command line
First there was the command lineAdrian Cardenas
 
Conquering the Command Line
Conquering the Command LineConquering the Command Line
Conquering the Command LineAdrian Cardenas
 
Linux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersLinux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersDavide Ciambelli
 
Linux internet server security and configuration tutorial
Linux internet server security and configuration tutorialLinux internet server security and configuration tutorial
Linux internet server security and configuration tutorialannik147
 
2345014 unix-linux-bsd-cheat-sheets-i
2345014 unix-linux-bsd-cheat-sheets-i2345014 unix-linux-bsd-cheat-sheets-i
2345014 unix-linux-bsd-cheat-sheets-iLogesh Kumar Anandhan
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesIO Visor Project
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionJian-Hong Pan
 

What's hot (20)

PHP selber bauen
PHP selber bauenPHP selber bauen
PHP selber bauen
 
Authen Free Bsd6 2
Authen Free Bsd6 2Authen Free Bsd6 2
Authen Free Bsd6 2
 
Creating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server HardeningCreating "Secure" PHP applications, Part 2, Server Hardening
Creating "Secure" PHP applications, Part 2, Server Hardening
 
Setting up a HADOOP 2.2 cluster on CentOS 6
Setting up a HADOOP 2.2 cluster on CentOS 6Setting up a HADOOP 2.2 cluster on CentOS 6
Setting up a HADOOP 2.2 cluster on CentOS 6
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel Crashdump
 
Most frequently used unix commands for database administrator
Most frequently used unix commands for database administratorMost frequently used unix commands for database administrator
Most frequently used unix commands for database administrator
 
101 1.2 boot the system
101 1.2 boot the system101 1.2 boot the system
101 1.2 boot the system
 
Proxy arp
Proxy arpProxy arp
Proxy arp
 
ch3-pv1-memory-management
ch3-pv1-memory-managementch3-pv1-memory-management
ch3-pv1-memory-management
 
101 2.2 install boot manager
101 2.2 install boot manager101 2.2 install boot manager
101 2.2 install boot manager
 
Yum (Linux)
Yum (Linux) Yum (Linux)
Yum (Linux)
 
Learning the command line
Learning the command lineLearning the command line
Learning the command line
 
First there was the command line
First there was the command lineFirst there was the command line
First there was the command line
 
Conquering the Command Line
Conquering the Command LineConquering the Command Line
Conquering the Command Line
 
2.2 install boot manager
2.2 install boot manager2.2 install boot manager
2.2 install boot manager
 
Linux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for BeginnersLinux Bash Shell Cheat Sheet for Beginners
Linux Bash Shell Cheat Sheet for Beginners
 
Linux internet server security and configuration tutorial
Linux internet server security and configuration tutorialLinux internet server security and configuration tutorial
Linux internet server security and configuration tutorial
 
2345014 unix-linux-bsd-cheat-sheets-i
2345014 unix-linux-bsd-cheat-sheets-i2345014 unix-linux-bsd-cheat-sheets-i
2345014 unix-linux-bsd-cheat-sheets-i
 
bcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challengesbcc/BPF tools - Strategy, current tools, future challenges
bcc/BPF tools - Strategy, current tools, future challenges
 
Software Packaging for Cross OS Distribution
Software Packaging for Cross OS DistributionSoftware Packaging for Cross OS Distribution
Software Packaging for Cross OS Distribution
 

Similar to Install and Configure Tomcat on Debian

SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesPhil Hagen
 
EF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdfEF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdfDangGonz
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDocker, Inc.
 
Ef09 installing-alfresco-components-1-by-1
Ef09 installing-alfresco-components-1-by-1Ef09 installing-alfresco-components-1-by-1
Ef09 installing-alfresco-components-1-by-1Angel Borroy López
 
Installing spark 2
Installing spark 2Installing spark 2
Installing spark 2Ahmed Mekawy
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Vincent Batts
 
MariaDB10.7_install_Ubuntu.docx
MariaDB10.7_install_Ubuntu.docxMariaDB10.7_install_Ubuntu.docx
MariaDB10.7_install_Ubuntu.docxNeoClova
 
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...Puppet
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMAlexander Shopov
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With RpmMartin Jackson
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Praguetomasbart
 

Similar to Install and Configure Tomcat on Debian (20)

SANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management DatabasesSANS @Night There's Gold in Them Thar Package Management Databases
SANS @Night There's Gold in Them Thar Package Management Databases
 
Centos config
Centos configCentos config
Centos config
 
Ex200
Ex200Ex200
Ex200
 
EF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdfEF09-Installing-Alfresco-components-1-by-1.pdf
EF09-Installing-Alfresco-components-1-by-1.pdf
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
Rpm Introduction
Rpm IntroductionRpm Introduction
Rpm Introduction
 
Ef09 installing-alfresco-components-1-by-1
Ef09 installing-alfresco-components-1-by-1Ef09 installing-alfresco-components-1-by-1
Ef09 installing-alfresco-components-1-by-1
 
Docker practice
Docker practiceDocker practice
Docker practice
 
Installing spark 2
Installing spark 2Installing spark 2
Installing spark 2
 
Ass hđh
Ass hđhAss hđh
Ass hđh
 
Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]Slackware Demystified [SELF 2011]
Slackware Demystified [SELF 2011]
 
MariaDB10.7_install_Ubuntu.docx
MariaDB10.7_install_Ubuntu.docxMariaDB10.7_install_Ubuntu.docx
MariaDB10.7_install_Ubuntu.docx
 
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
PuppetConf 2017: Use Puppet to Tame the Dockerfile Monster- Bryan Belanger, A...
 
Samba 4 - debian instalacao
Samba 4 - debian instalacaoSamba 4 - debian instalacao
Samba 4 - debian instalacao
 
Bundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPMBundling Packages and Deploying Applications with RPM
Bundling Packages and Deploying Applications with RPM
 
Dev ops
Dev opsDev ops
Dev ops
 
Automated Java Deployments With Rpm
Automated Java Deployments With RpmAutomated Java Deployments With Rpm
Automated Java Deployments With Rpm
 
Influxdb
InfluxdbInfluxdb
Influxdb
 
Docker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in PragueDocker and friends at Linux Days 2014 in Prague
Docker and friends at Linux Days 2014 in Prague
 
Watch Me Install Alfresco
Watch Me Install AlfrescoWatch Me Install Alfresco
Watch Me Install Alfresco
 

Recently uploaded

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfPower Karaoke
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 

Recently uploaded (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
The Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdfThe Evolution of Karaoke From Analog to App.pdf
The Evolution of Karaoke From Analog to App.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 

Install and Configure Tomcat on Debian

  • 1. bbconcepteur@gmail.com goodluck guy | 1P a g e Install tomcat in debian - Postgres databases (Zzzzz , Tabuchi, Sumitomo heavy, DID, JCU) - Tomcat Debian GNU/Linux 7.5 x86_64 bit - root - Connect : http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html (putty) Chú ý các config trên debian 1.Cài đặt Tomcat 5 Xoát tất tomcat 7: root@vm007:/usr/share# rm -r tomcat7 1.1 Install Tạo thư mục toàn bộ tomcat 5 root@vm007:/usr/share# mkdir apache-tomcat-5.5.33 root@vm007:/usr/share# cd apache-tomcat-5.5.33 Copy lên thư mục được tạo: pscp -r C:UsershungncDownloadsapache-tomcat-5.5.27.tar.gz root@192.168.40.107:/var/lib/tomcat55download root@vm007:/var/lib/tomcat55download/apache-tomcat-5.5.27# chown -R tomcat.tomcat /var/lib/tomcat55download/apache-tomcat-5.5.27 root@vm007:/var/lib/tomcat55download# tar -xvf apache-tomcat-5.5.27.tar.gz root@vm007:/var# service tomcat7 restart Chạy startup.sh root@vm007:/usr/share/apache-tomcat-5.5.33# ls bin conf logs RELEASE-NOTES server temp work common LICENSE NOTICE RUNNING.txt shared webapps root@vm007:/usr/share/apache-tomcat-5.5.33# cd bin root@vm007:/usr/share/apache-tomcat-5.5.33/bin# sh startup.sh Cannot find ./catalina.sh This file is needed to run this program -> Nguyên nhân là các file thực thi chưa được phân quyền Kiểm tra root@vm007:/usr/share/apache-tomcat-5.5.33/bin# ls -la total 1688 drwxr-xr-x 4 root root 4096 Feb 2 13:54 . drwxr-xr-x 11 root root 4096 Feb 2 13:54 .. -rw-r--r-- 1 root root 24384 Feb 2 13:54 bootstrap.jar -rw-r--r-- 1 root root 9995 Feb 2 13:54 catalina.bat -rw-r--r-- 1 root root 13131 Feb 2 13:54 catalina.sh
  • 2. bbconcepteur@gmail.com goodluck guy | 2P a g e -rw-r--r-- 1 root root 1927 Feb 2 13:54 catalina-tasks.xml -rw-r--r-- 1 root root 23546 Feb 2 13:54 commons-daemon.jar -rw-r--r-- 1 root root 199453 Feb 2 13:54 commons-daemon-native.tar.gz -rw-r--r-- 1 root root 52313 Feb 2 13:54 commons-logging-api-1.1.1.jar -rw-r--r-- 1 root root 1334 Feb 2 13:54 cpappend.bat -rw-r--r-- 1 root root 2107 Feb 2 13:54 digest.bat -rw-r--r-- 1 root root 1627 Feb 2 13:54 digest.sh drwxr-xr-x 2 root root 4096 Feb 2 13:54 i64 -rw-r--r-- 1 root root 2167 Feb 2 13:54 jmxaccessor-tasks.xml -rw-r--r-- 1 root root 5088 Feb 2 13:54 service.bat -rw-r--r-- 1 root root 3000 Feb 2 13:54 setclasspath.bat -rw-r--r-- 1 root root 3577 Feb 2 13:54 setclasspath.sh -rw-r--r-- 1 root root 2099 Feb 2 13:54 shutdown.bat -rw-r--r-- 1 root root 1566 Feb 2 13:54 shutdown.sh -rw-r--r-- 1 root root 2100 Feb 2 13:54 startup.bat -rw-r--r-- 1 root root 1959 Feb 2 13:54 startup.sh -rw-r--r-- 1 root root 868352 Feb 2 13:54 tcnative-1.dll -rw-r--r-- 1 root root 74240 Feb 2 13:54 tomcat5.exe -rw-r--r-- 1 root root 102912 Feb 2 13:54 tomcat5w.exe -rw-r--r-- 1 root root 13505 Feb 2 13:54 tomcat-juli.jar -rw-r--r-- 1 root root 241274 Feb 2 13:54 tomcat-native.tar.gz -rw-r--r-- 1 root root 3471 Feb 2 13:54 tool-wrapper.bat -rw-r--r-- 1 root root 3508 Feb 2 13:54 tool-wrapper.sh -rw-r--r-- 1 root root 2104 Feb 2 13:54 version.bat -rw-r--r-- 1 root root 1570 Feb 2 13:54 version.sh drwxr-xr-x 2 root root 4096 Feb 2 13:54 x64 Đổi quyền toàn bộ thư mục root@vm007:/usr/share/apache-tomcat-5.5.33# chmod 755 bin/* Vẫn không thực thi được, tìm ra config khác để thực thi root@vm007:/usr/share# mv apache-tomcat-5.5.33 tomcat root@vm007:/usr/share/tomcat# cd bin root@vm007:/usr/share/tomcat/bin# sh startup.sh Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program Kiểm tra lại cấu hình root@vm007:/usr/share/tomcat/bin# vi catalina.sh Sửa đổi các thông tin về JAVA_HOME, JRE_HOME Thực thi lại root@vm007:/usr/share/tomcat/bin# sh startup.sh Using CATALINA_BASE: /usr/share/tomcat Using CATALINA_HOME: /usr/share/tomcat Using CATALINA_TMPDIR: /usr/share/tomcat/temp Using JRE_HOME: /usr/lib/jvm/java-7-openjdk-amd64/jre/ Using CLASSPATH: /usr/share/tomcat/bin/bootstrap.jar Kiểm tra log
  • 3. bbconcepteur@gmail.com goodluck guy | 3P a g e root@vm007:/usr/share/tomcat/logs# vi catalina.out 1.2 Add user đăng nhập Tomcat trên debian Tìm đến thư mục Tomcat : /usr/share/tomcat File Nội dung cần chỉnh sửa <tomcat-users> <role rolename="tomcat"/> <role rolename="manager"/> <role rolename="manager-gui"/> <role rolename="manager-script"/> <role rolename="manager-jmx"/> <user username="tomcat" password="XXX@123" roles="tomcat,manager,manager-gui,manager-script"/> </tomcat-users> <user username="tomcat" password="XXX@123" roles="tomcat,manager,manager- gui,manager-script"/> 2.Cài đặt java version 1.7 Tìm đến thư mục Java : /usr/lib/jvm/ java version "1.7.0_80" Java(TM) SE Runtime Environment (build 1.7.0_80-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode) 3.Copy template lên thư mục server debian, ghi nhận path và config + Cài đặt: PuTTY + Sử dụng cmd window copy pscp -r C:/Users/hungnc/Downloads/apache-tomcat- 7.0.57/* root@yyy.yyy.yy.yyyy:/usr/share/apache-tomcat-7.0.57 4.Config lại app.home = /var/lib/tomcat7download/nttdata-zzzzz -template db.host=yyy.yyy.yy.yyyy db.port=5499 db.name=central_lgt2_20160129_uat
  • 4. bbconcepteur@gmail.com goodluck guy | 4P a g e db.user=postgres db.password=postgres #db.password=zzzzz@vvvvvv db.report.user=postgres db.report.password=postgres 5.Biên dịch lại với điều chỉnh cho môi trường chạy trên debian xxxx 6.Upload and deploy file war bằng web page của tomcat http://yyy.yyy.yy.yyyy:8081/manager/html - undeploy bản cũ - upload bản war cùng tên, deploy - run khi Running cho trạng thái là Tru và Message báo là OK 7.Test thực hiện UAT http://yyy.yyy.yy.yyyy:8081/zzzzz /p/logout
  • 5. bbconcepteur@gmail.com goodluck guy | 5P a g e 8.Cài đặt Tomcat7 Ref: http://www.mkyong.com/tomcat/how-to-install-apache-tomcat-8-on-debian/ To get the basic package, we can update our package source list and then install the main package: sudo apt-get update sudo apt-get install tomcat7 Thực hiện 8.1 Delete version cũ sudo apt-get remove tomcat7 tomcat7-docs tomcat7-admin tomcat7-examples default-jdk ant git -> rm -r all tomcat folder /usr/share/ /var/lib/ /etc/init.d/ 8.2 Reinstall manual pscp -r C:/Users/hungnc/Downloads/apache-tomcat-7.0.67.tar.gz root@yyy.yyy.yy.yyyy:/var/lib/tomcat7download root@vm007:/var/lib/tomcat7download# sudo mkdir /usr/share/tomcat7 root@vm007:/var/lib/tomcat7download# sudo mv apache-tomcat-7.0.67 /usr/share/tomcat7 root@vm007:~# sudo rm -f /usr/share/tomcat root@vm007:~# sudo ln -s /usr/share/tomcat7/apache-tomcat-7.0.67 /usr/share/tomcat root@vm007:~# sudo chown -R tomcat:tomcat /usr/share/tomcat7 root@vm007:~# sudo chmod +x /usr/share/tomcat/bin/*.sh root@vm007:~# cd /usr/share/tomcat/conf/ root@vm007:/usr/share/tomcat/conf# vi server.xml root@vm007:~# cd /usr/share/tomcat/bin root@vm007:/usr/share/tomcat/bin# sh startup.sh Using CATALINA_BASE: /usr/share/tomcat Using CATALINA_HOME: /usr/share/tomcat Using CATALINA_TMPDIR: /usr/share/tomcat/temp Using JRE_HOME: /usr Using CLASSPATH: /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar Tomcat started. root@vm007:/usr/share/tomcat/conf# vi tomcat-users.xml root@vm007:/usr/share/tomcat/bin# sh shutdown.sh root@vm007:/usr/share/tomcat/bin# sh startup.sh
  • 6. bbconcepteur@gmail.com goodluck guy | 6P a g e 9.Các câu lệnh trong linux If your top-level directory is called images, then run rm -r images/* This uses the shell glob operator * to run rm -r on every file or directory within images $ rmdir foo In this example, move /home/vivek/data/ directory to /nas/home/vivek/archived/ directory: $ mv /home/vivek/data/ /nas/home/vivek/archived/ OR $ cd /home/vivek $ mv data/ /nas/home/vivek/archived/ To get verbose output (explain what is being done), type: $ mv -v /home/vivek/data/ /nas/home/vivek/archived/ 10. Check service root@vm007:/usr/share# runlevel N 2 root@vm007:/usr/share# ls /etc/rc2.d/S* /etc/rc2.d/S01motd /etc/rc2.d/S17atd /etc/rc2.d/S18exim4 /etc/rc2.d/S13rpcbind /etc/rc2.d/S17chrome-remote-desktop /etc/rc2.d/S18network-manager /etc/rc2.d/S14nfs-common /etc/rc2.d/S17cron /etc/rc2.d/S19gdm3 /etc/rc2.d/S16binfmt-support /etc/rc2.d/S17dbus /etc/rc2.d/S19pulseaudio /etc/rc2.d/S16rsyslog /etc/rc2.d/S17nginx /etc/rc2.d/S19saned /etc/rc2.d/S16sudo /etc/rc2.d/S17ntp /etc/rc2.d/S20bootlogs /etc/rc2.d/S16supervisor /etc/rc2.d/S17postgresql /etc/rc2.d/S21minissdpd /etc/rc2.d/S16tomcat5.5 /etc/rc2.d/S17speech-dispatcher /etc/rc2.d/S21rc.local /etc/rc2.d/S16tomcat7 /etc/rc2.d/S17ssh /etc/rc2.d/S21rmnologin /etc/rc2.d/S17acpid /etc/rc2.d/S18avahi-daemon /etc/rc2.d/S21teamviewerd /etc/rc2.d/S17anacron /etc/rc2.d/S18bluetooth root@vm007:/usr/share# Install other version PostgreSQL 8.2 to Debian server Kiểm tra version hiện tại (Postgres installed ) root@vm007:~# ps -ef | grep postgre
  • 7. bbconcepteur@gmail.com goodluck guy | 7P a g e root@vm007:/etc/postgresql/8.2/main# vi postgresql.conf Sử dụng các lệnh linux để edit :x :q! Restart Postgres root@vm007:~# /etc/init.d/postgresql restart Để connect được cần cấu hình user truy cập [OK !!!] --> all trust root@vm007:/etc/postgresql/8.2/main# vi pg_hba.conf # Database administrative login by Unix domain socket local all postgres trust # TYPE DATABASE USER CIDR-ADDRESS METHOD host all all 192.168.1.0/24 trust # "local" is for Unix domain socket connections only local all all trust # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 Lệnh thay password user mặc định Tạo user mới root@vm007:/etc/postgresql/8.2/main# su - -c "useradd devteam devteam" Cài đặt khác Debian includes PostgreSQL by default. To install PostgreSQL on Debian, use the apt-get (or other apt-driving) command: apt-get install postgresql-9.4 To connect to the database, first you need to switch to the postgres user by issuing the following command while logged in as root (this will not work with sudo access): su - postgres You now should be logged as postgres. To start the PostgreSQL console, type psql: Psql postgres=# SELECT * FROM pg_user; usename | usesysid | usecreatedb | usesuper | usecatupd | passwd | valuntil | useconfig ----------+----------+-------------+----------+-----------+----------+----------+----------- postgres | 10 | t | t | t | ******** | | (1 row) postgres=# SELECT * FROM pg_settings WHERE name = 'port'; name | setting | unit | category | short_desc | extra_desc | context | vartype | source | min_val | max_val
  • 8. bbconcepteur@gmail.com goodluck guy | 8P a g e ------+---------+------+------------------------------------------------------+----------------------------- -------------+------------+------------+---------+--------------------+---------+--------- port | 5432 | | Connections and Authentication / Connection Settings | Sets the TCP port the server listens on. | | postmaster | integer | configuration file | 1 | 65535 (1 row)