Custom Search

Tuesday, April 30, 2019

How to install Java on Ubuntu 19.04 18.04

How to install Java on Ubuntu

sudo add-apt-repository ppa:linuxuprising/java

sudo apt update

sudo apt install oracle-java12-installer

java -version

sudo update-alternatives --config java

sudo vim /etc/environment
JAVA_HOME=/usr/lib/jvm/java-12-oracle

source /etc/environment

echo $JAVA_HOME

How to Install Oracle Java JDK 12 on Ubuntu 19.04 18.04

How to Install Oracle Java JDK 12 on Ubuntu

sudo add-apt-repository ppa:linuxuprising/java

sudo apt update

sudo apt install oracle-java12-installer

java -version

sudo update-alternatives --config java

sudo vim /etc/environment
JAVA_HOME=/usr/lib/jvm/java-12-oracle

source /etc/environment

echo $JAVA_HOME

How to Install Oracle Java 12 in Ubuntu 19.04 18.04

How to Install Oracle Java 12 easy steps

sudo add-apt-repository ppa:linuxuprising/java

sudo apt update

sudo apt install oracle-java12-installer

java -version

sudo update-alternatives --config java

sudo vim /etc/environment
JAVA_HOME=/usr/lib/jvm/java-12-oracle

source /etc/environment

echo $JAVA_HOME

Friday, April 26, 2019

How to build and deploy an Ionic App for Browser

1)
ionic start myApp sidemenu

2)
cd myApp
ionic build
ls www

3)
sudo vim /etc/nginx/sites-available/myapp

server {
  listen 8008 default_server;

  root /home/puser/myApp/www;

  index index.html;

}

4)
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/myapp

sudo service nginx configtest

sudo netstat -tuplen

sudo systemctl  restart nginx
or
sudo systemctl  reload nginx

sudo netstat -tuplen

5)
http://127.0.0.:8008

6)
sudo rm -rf /etc/nginx/sites-available/myapp
sudo rm -rf /etc/nginx/sites-enabled/myapp
sudo systemctl  restart nginx

How to Setup Nginx as a Reverse Proxy in front of your Node.js Ionic application

1)
sudo vim /etc/nginx/sites-available/myapp

server {
    listen 80;

    server_name exmaple;

    location / {
        proxy_pass http://127.0.0.1:8100;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

2)
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/myapp

3)
sudo service nginx configtest

sudo netstat -tuplen

sudo systemctl  restart nginx
or
sudo systemctl  reload nginx

sudo netstat -tuplen

4)
ionic serve
serve ionic app in port 8100

5)
http://127.0.0.1

How to Setup Reverse Proxy Using Nginx Web Server

1)
sudo vim /etc/nginx/sites-available/myapp

server {
    listen 80;

    server_name exmaple;

    location / {
        proxy_pass http://127.0.0.1:8100;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

2)
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/myapp

3)
sudo service nginx configtest

sudo netstat -tuplen

sudo systemctl  restart nginx
or
sudo systemctl  reload nginx

sudo netstat -tuplen

4)
ionic serve
serve ionic app in port 8100

5)
http://127.0.0.1

How to Create Simple Web Server with Node.js

1)
ionic build browser --prod

2)
cd www

3)
npm install connect serve-static

4)
vim server.js
var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(8080)

5)
node server.js

6)
http://127.0.0.1:8080

How to Deploy Ionic App as Website using node.js Web Server

1)
ionic build browser --prod

2)
cd www

3)
npm install connect serve-static

4)
vim server.js
var connect = require('connect');
var serveStatic = require('serve-static');
connect().use(serveStatic(__dirname)).listen(8080)

5)
node server.js

6)
http://127.0.0.1:8080

Thursday, April 25, 2019

How to Install Nodejs and NPM in Ubuntu 19.04 18.04 Debian Linux Mint

sudo apt update

sudo apt install nodejs

sudo apt install npm

nodejs -v

npm -v

curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

How to Install Oracle Java JDK 12 in Ubuntu 19.04 18.04, Debian, Linux Mint

$ wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn-pub/java/jdk/12.0.1+12/69cfe15208a647278a19ef0990eea691/jdk-12.0.1_linux-x64_bin.tar.gz

$ sudo mkdir /opt/jdk

$ sudo tar -xzf jdk-12.0.1_linux-x64_bin.tar.gz -C /opt/jdk/

$ sudo update-alternatives --install /usr/bin/java java /opt/jdk/jdk-12.0.1/bin/java 100

$ sudo update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk-12.0.1/bin/javac 100

$ update-alternatives --display java

$ update-alternatives --display javac

$ java -version
java version "12.0.1" 2019-04-16
Java(TM) SE Runtime Environment (build 12.0.1+12)
Java HotSpot(TM) 64-Bit Server VM (build 12.0.1+12, mixed mode, sharing)

How to Install Nginx Web Server in Ubuntu 19.04 18.04 Debian Linux Mint

sudo apt update

sudo apt install nginx

sudo ufw status

sudo systemctl status nginx

curl -4 http//127.0.0.1