feat: add PgAdmin setup
This commit is contained in:
parent
401429a838
commit
fa5e75fe00
|
@ -75,7 +75,101 @@ ss -tpln
|
|||
|
||||
* open Tomcat in Browser using the address ```http://localhost:8080```
|
||||
|
||||
* install MySQL
|
||||
```
|
||||
wget https://dev.mysql.com/get/mysql-apt-config_0.8.22-1_all.deb
|
||||
sudo dpkg -i mysql-apt-config_0.8.22-1_all.deb
|
||||
sudo apt update
|
||||
sudo apt install mysql-server
|
||||
sudo systemctl status mysql
|
||||
mysql_secure_installation
|
||||
mysql -u root -p
|
||||
```
|
||||
|
||||
* define Tomcat memory using OBA Config and Deploy guide and [this](https://mkyong.com/tomcat/tomcat-javalangoutofmemoryerror-permgen-space/) guide
|
||||
```
|
||||
sudo find / -name "catalina.sh"
|
||||
sudo vi /opt/tomcat/bin/catalina.sh
|
||||
sudo -u tomcat vi /opt/tomcat/bin/setenv.sh
|
||||
sudo sh -c 'chmod +x /opt/tomcat/bin/*.sh'
|
||||
export JAVA_OPTS="-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m"
|
||||
sudo systemctl restart tomcat
|
||||
sudo systemctl status tomcat
|
||||
```
|
||||
|
||||
* download the binaries
|
||||
```
|
||||
mkdir ~/oba
|
||||
mkdir oba
|
||||
cd oba
|
||||
wget https://repo.camsys-apps.com/releases/org/onebusaway/onebusaway-transit-data-federation-builder/2.0.0/onebusaway-transit-data-federation-builder-2.0.0-withAllDependencies.jar
|
||||
wget https://repo.camsys-apps.com/releases/org/onebusaway/onebusaway-transit-data-federation-webapp/2.0.0/onebusaway-transit-data-federation-webapp-2.0.0.war
|
||||
wget https://repo.camsys-apps.com/releases/org/onebusaway/onebusaway-api-webapp/2.0.0/onebusaway-api-webapp-2.0.0.war
|
||||
wget https://repo.camsys-apps.com/releases/org/onebusaway/onebusaway-enterprise-acta-webapp/2.0.0/onebusaway-enterprise-acta-webapp-2.0.0.war
|
||||
```
|
||||
|
||||
* Download the Transit GTFS Data From the Transit Agency
|
||||
```
|
||||
mkdir -p oba/gtfs
|
||||
cd oba/gtfs/
|
||||
wget http://data.ndovloket.nl/flixbus/flixbus-eu.zip
|
||||
```
|
||||
|
||||
* Build the Transit Data Bundle
|
||||
```
|
||||
cd oba/gtfs
|
||||
java -version
|
||||
java -jar -Xss4m -Xmx1g ~/oba/onebusaway-transit-data-federation-builder-<enter version>.jar ~/oba/gtfs/<enter file name>.zip ~/oba/gtfs
|
||||
```
|
||||
|
||||
* Download the MySQL Connector Java Library
|
||||
```
|
||||
cd ~/oba
|
||||
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.28.tar.gz
|
||||
tar -zxvf mysql-connector-java-8.0.28.tar.gz
|
||||
mv mysql-connector-java-8.0.28/mysql-connector-java-8.0.28.jar .
|
||||
rm -rf mysql-connector-java-8.0.28.tar.gz
|
||||
rm -rf mysql-connector-java_8.0.28-1debian11_all.deb
|
||||
rm -rf mysql-connector-java-8.0.28
|
||||
```
|
||||
|
||||
* Create the MySQL Database
|
||||
```
|
||||
sudo -u root mysql -p -e "CREATE DATABASE oba; GRANT ALL PRIVILEGES ON oba.* TO 'oba'@'localhost' IDENTIFIED BY '<enter key for obu db user';"
|
||||
```
|
||||
|
||||
* Stop the Tomcat 8 Service
|
||||
```
|
||||
sudo systemctl status tomcat
|
||||
sudo systemctl stop tomcat
|
||||
sudo systemctl status tomcat
|
||||
```
|
||||
|
||||
* Deploy and Configure the OneBusAway Transit Data Federation Webapp
|
||||
```
|
||||
cd /var/lib
|
||||
sudo mkdir -p /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp
|
||||
cd /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp
|
||||
sudo mv ~/oba/onebusaway-transit-data-federation-webapp-2.0.0.war /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp/
|
||||
sudo jar xvf /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp/onebusaway-transit-data-federation-webapp-2.0.0.war
|
||||
sudo rm -rf /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp/onebusaway-transit-data-federation-webapp-2.0.0.war
|
||||
```
|
||||
|
||||
* Copy the MySQL Driver
|
||||
```
|
||||
cd /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp/WEB-INF/lib
|
||||
sudo cp ~/oba/mysql-connector-java-8.0.28.jar .
|
||||
```
|
||||
|
||||
* Configure the OneBusAway Transit Data Federation Webapp
|
||||
```
|
||||
sudo cp /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp/WEB-INF/classes/data-sources.xml /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp/WEB-INF/classes/data-sources.xml.backup
|
||||
sudo vi /var/lib/tomcat8/webapps/onebusaway-transit-data-federation-webapp/WEB-INF/classes/data-sources.xml
|
||||
```
|
||||
|
||||
## Links
|
||||
|
||||
[How to Install Apache Tomcat on Debian 11](https://www.linuxtechi.com/how-to-install-apache-tomcat-on-debian/)
|
||||
[How to Install Apache Tomcat on Debian 11](https://www.itzgeek.com/how-tos/linux/debian/how-to-install-apache-tomcat-on-debian-11.html)
|
||||
* [OneBusAway/onebusaway:Configuration and Deployment Guide for v2.x](https://github.com/OneBusAway/onebusaway/wiki/Configuration-and-Deployment-Guide-for-v2.x)
|
||||
* [How to Install Apache Tomcat on Debian 11](https://www.linuxtechi.com/how-to-install-apache-tomcat-on-debian/)
|
||||
* [How to Install Apache Tomcat on Debian 11](https://www.itzgeek.com/how-tos/linux/debian/how-to-install-apache-tomcat-on-debian-11.html)
|
||||
* [How to install MySQL on Debian 11](https://codepre.com/en/como-instalar-mysql-en-debian-11.html)
|
|
@ -0,0 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2022 Software Ingenieur Begerad <swingbe.de>
|
||||
*
|
||||
* SPDX-License-Identifier: CC0-1.0
|
||||
*/
|
|
@ -0,0 +1,53 @@
|
|||
# Setup Pgamin
|
||||
|
||||
* get the latest version of installed packages and refresh the repo cache
|
||||
```
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
* make sure the CLI tool curl is installed
|
||||
```
|
||||
sudo apt install curl --no-install-recommends
|
||||
```
|
||||
|
||||
* validate that postgres server is running
|
||||
```
|
||||
systemctl status postgresql
|
||||
```
|
||||
|
||||
* add the official pgAdmin repository to the system
|
||||
```
|
||||
echo "deb https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/$(lsb_release -cs) pgadmin4 main" | sudo tee /etc/apt/sources.list.d/pgadmin4.list
|
||||
```
|
||||
|
||||
* import GPG key from the pgAdmin respsitory
|
||||
```
|
||||
curl https://www.pgadmin.org/static/packages_pgadmin_org.pub | sudo apt-key add
|
||||
```
|
||||
|
||||
* update apt repository cache and install pgAdmin
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install pgadmin4-web --no-install-recommends
|
||||
```
|
||||
|
||||
* configure pgAdmin
|
||||
```
|
||||
sudo /usr/pgadmin4/bin/setup-web.sh
|
||||
```
|
||||
|
||||
* update firewall if necessary
|
||||
```
|
||||
sudo ufw status
|
||||
sudo ufw allow 80
|
||||
sudo ufw reload
|
||||
sudo ufw enable
|
||||
sudo ufw status
|
||||
```
|
||||
|
||||
* access the PgAdmin web interace by opening a web browser and typing the URL ```https://your-server-ip/pgadmin4``` to reach the web interface
|
||||
|
||||
# Links
|
||||
|
||||
* [How to install pgAdmin on Debian 11](https://codepre.com/en/como-instalar-pgadmin-en-debian-11.html)
|
||||
* [How To Install pgAdmin 4 on Debian 11|10|9](https://computingforgeeks.com/how-to-install-pgadmin4-on-debian/)
|
Loading…
Reference in New Issue