NOTE: This guide does not cover the actual installation of Ubuntu. Use at your own risk. Basic configuration is applied here - DYOR.
Basic configuration commands to have your Ubuntu Server up and running on production.
- Update And Upgrade
- Enable Firewall
- Install Further Tools
- Install Further Applications
- Update The Operating System
sudo rebootRestart and wait for some time and the Linux server will reboot itselfsudo apt-get updatesudo apt-get upgrade
And sometimes:
sudo apt-get dist-upgrade
If there is a new release upgrade:
do-release-upgrade
UFW (Uncomplicated Firewall) is installed by default on Ubuntu. If it has been uninstalled for some reason, you can install it with sudo apt install ufw.
sudo vi /etc/default/ufw. CheckIPV6=yessudo ufw resetsudo ufw status verbose. Should show inactivesudo ufw default deny incomingsudo ufw default allow outgoingsudo ufw allow sshorsudo ufw allow 22. Allowing Secure Shell (SSH)sudo ufw enablesudo ufw status verbose. Should show active
sudo ufw allow httporsudo ufw allow 80. HTTP on port 80, which is what unencrypted web servers use.sudo ufw allow httpsorsudo ufw allow 443. HTTPS on port 443, which is what encrypted web servers use
Reference: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-20-04
sudo timedatectl set-timezone UTC. Set Timezone UTC/GMT+0sudo apt-get install net-toolsto install tools for commands likeifconfig -a(network interface) andnetstatsudo apt install openssh-server. You should already have this installed so this command won't do anything
curl -fsSL https://deb.nodesource.com/setup_17.x | sudo -E bash -. Download Node.jssudo apt-get install -y nodejs. Install Node.jssudo npm install -g @angular/cli. Install Angular CLI
Reference: https://github.com/nodesource/distributions/blob/master/README.md
sudo apt install -y build-essential libaio1Install the required packages: build-essential & libaio1sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'Add the repository that provides PostgreSQL 14 on Ubuntuwget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -Import the GPG signing key for the repositorysudo apt -y updateUpdate your APT package listsudo apt install -y postgresql-14 postgresql-server-dev-14Installing Postgres 14
sudo mkdir /opt/oracleCreate a directory for the installation and go to the directorysudo wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-basic-linux.x64-21.7.0.0.0dbru.zipDownload Oracle Client filessudo wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-sqlplus-linux.x64-21.7.0.0.0dbru.zipDownload Oracle SQLPLUS filessudo wget https://download.oracle.com/otn_software/linux/instantclient/217000/instantclient-sdk-linux.x64-21.7.0.0.0dbru.zipDownload Oracle SDK file. (Optional)sudo apt-get install unzipInstalling unzipsudo unzip instantclient-basic-linux.x64-21.7.0.0.0dbru.zip -d /opt/oracleUnziping clientsudo unzip instantclient-sqlplus-linux.x64-21.7.0.0.0dbru.zip -d /opt/oracle/Unziping sqlplussudo unzip instantclient-sdk-linux.x64-21.7.0.0.0dbru.zip -d /opt/oracleUnzipping Oracle SDKnano ~/.profileConfigure SQLPlusexport PATH="$PATH:/opt/oracle/instantclient_21_7"Copy and paste this line to the end of the fileexport LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/oracle/instantclient_21_7"And then copy and paste this line too to the end of the filesource ~/.profileExecutesudo sh -c "echo /opt/oracle/instantclient_21_7 > /etc/ld.so.conf.d/oracle-instantclient.conf"Add Oracle shared libraries to the system's shared library cachesudo ldconfigIndexing the library cacheexport ORACLE_HOME=/opt/oracle/instantclient_21_7Set ORACLE_HOME as /opt/oracle/instantclient_21_7sqlplus [USER]/[PASSWORD]@[IP:PORT]/[SERVICE_NAME]Test the connection to Oracle
sudo apt updateAccess the package servers and check to see if any of your installed packages have new versions available.sudo apt dist-upgradeInstall the updates. This will show you the list of packages that are about to be updated, and if the total installation size is large enough, it will show you the size and prompt you to confirm that you accept.yEnsure that you have enough space available to do this, then press y and Enter to begin the update process.sudo apt autoremoveClean up any old versions of packages that were just replacedcat /var/run/reboot-requiredCheck if your system needs to be rebooted. If the command printsNo such file or directory, then reboot is not required and you can skip the reboot. However if the command prints*** System restart required ***, then you should restart your machine to finish applying the updates when you are able:sudo reboot
Reference: https://manjaro.site/how-to-install-oracle-instant-client-on-ubuntu-20-04/