AbdulR3hman
4/16/2017 - 10:48 PM

Ubuntu Related Notes;

# Setting up new Account & adding it to the sudors;
  1- adduser username
  2- usermod -aG sudo username
  30 sudo command_to_run
  
# How To Install Java with Apt-Get on 
  sudo apt-get update
  sudo apt-get install default-jre
  
# To install Specific JDK
  sudo add-apt-repository ppa:webupd8team/java
  sudo apt-get update
  
  sudo apt-get install oracle-java6-installer
  Or
  sudo apt-get install oracle-java7-installer
  Or
  sudo apt-get install oracle-java8-installer
  Ref;https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04
  
  
#Spring-boot app forward 8080 to 80:
  Using Linux iptables for port 80 -> 8080
  This enables port forwarding of traffic between ports 80 and 8080. You can keep Jenkins on the default port 8080 and access it with a normal url without installing anything extra.
  sudo nano /etc/rc.local
  Then add the following just before the exit 0
    -Requests from outside
    iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 8080
    -Requests from localhost
    iptables -t nat -I OUTPUT -p tcp -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080