Category Archives: Sysadmin

Latest tutorials and tips for system administrators

Install Keycloak in ubuntu behind nginx reverse proxy using postgresql database

Below we show how to install Keycloak in ubuntu behind Nginx proxy and also use PostgreSQL as its database. //download keycloadk and unzip wget //create admin user cd keycloak-legacy-19.0.1/ ./bin/ -r master -u admin -p mypassword //start keycloak ./bin/ //enable proxy for keycloak by adding proxy-address-forwarding=”true” vim standalone/configuration/standalone.xml <http-listener name=”default” socket-binding=”http” redirect-socket=”https” enable-http2=”true” proxy-address-forwarding=”true”/> […]

Install R Shiny Server in Ubuntu behind Nginx Proxy

For installing and serving R Shiny Server behind Nginx reverse proxy we first install it by: sudo apt-get install r-base sudo su – \ -c “R -e \”install.packages(‘shiny’, repos=’’)\”” sudo apt-get install gdebi-core sudo gdebi shiny-server- Before installing some R Shiney packages we should install: sudo apt-get install libssl-dev libcurl4-openssl-dev Then we can install R […]

Install and Serve Konga-Kong Admin UI Behind Nginx Reverse Proxy

For installing and serving Konga behind Nginx reverse proxy we first clone the project and install npm modules and run :   git clone   cd konga   npm i   npm run start   It is time to add the reverse proxy in Nginx as below:   sudo vim /etc/nginx/nginx.conf server { location […]

Serve Create React app behind Reverse Proxy Nginx or Apache and Pm2

For serving React app behind reverse proxy such as Nginx or Apache We first create an application using create-react-app Create a react app using npx like: npx create-react-app portal Then install serve node package like: npm install -g serve Then you need to update the package.json and add two lines below (assume we want to […]

Install SSL Certificate for NGINX in Ubuntu

For installing SSL certificate for Nginx in Ubuntu you need to have two files: SSL crt file and SSL private key file and then put inside the server section in nginx.conf like the example below:   sudo vim /etc/nginx/nginx.conf server { listen 443 ssl; ssl_certificate /PATH_TO_SSL_CRT_FILE.crt; ssl_certificate_key /PATH_TO_SSL_PRIVATE.key; server_tokens off; root /var/www; server_name; client_max_body_size […]

How to run Ubuntu Tomcat in Port 80 HTTPS & install SSL for Tomcat

First you need to run below commands:     sudo touch /etc/authbind/byport/80   sudo chmod 500 /etc/authbind/byport/80   sudo chown tomcat8 /etc/authbind/byport/80   Then you need to add AUTHBIND=yes in /etc/default/tomcat8   Here you can change the JAVA_HOME & JAVA_OPTS: JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64   JAVA_OPTS=”-Djava.awt.headless=true -XX:+UseConcMarkSweepGC -Xms512m -Xmx4G -XX:PermSize=512M -Dorg.owasp.esapi.resources=/var/lib/tomcat8/webapps/ROOT/WEB-INF/classes/” AUTHBIND=yes   Then you need to change […]

Geoserver in tomcat behind NGINX Reverse Proxy and SSL

Assuming the Geoserver war file is running inside tomcat in port 7000 like: localhost:7000/geoserver Also a valid SSL certificate has configured in NGINX. First you need to change Tomcat port and add proxyPort in server.xml  :   sudo vim /etc/tomcat8/server.xml   Then search for “Connector port” and change the port number and also proxyPort to […]

Change Tomcat Port from 8080

For changing Tomcat port you need to change the connection port in server.xml  :   sudo vim /etc/tomcat8/server.xml   Then search for “Connector port” and change the port number (example 8080 to 7000):   Connector port=”7000″ protocol=”HTTP/1.1″ connectionTimeout=”20000″ redirectPort=”8443″ />   In example above we change the port from 8080 to 7000    Then you […]

List of Useful Docker Commands – Docker run

List of all docker containers which we created including stopped containers: docker ps –all   List all the containers which are running: docker ps   Create container (example: pull hello-world image from docker hub and create a new container from the image). It returns a container id. docker create hello-world   Docker run command,  which […]

How to copy a file into or from a running docker container

In this post, we show how to copy a file to a running docker container.  Also we show how to copy an existing file inside a running docker container to your local folder.   For copying a file inside a running docker container the command is:   docker cp yourfile container-id://path-inside-docker   For example to […]