Posts

Showing posts from August, 2022

OS Migration Across Local Disks - Oracle Linux 8

Image
  Host has 1 disk with 2 partitions (/boot and / of type xfs). Adding another disk of same size. [root@oraclevm ~]# fdisk -l  | grep -i disk  | grep -i dev Disk /dev/nvme0n1: 20 GiB, 21474836480 bytes, 41943040 sectors Disk /dev/nvme0n2: 20 GiB, 21474836480 bytes, 41943040 sectors Disk /dev/mapper/ol-root: 17 GiB, 18249416704 bytes, 35643392 sectors Disk /dev/mapper/ol-swap: 2 GiB, 2147483648 bytes, 4194304 sectors [root@oraclevm ~]# Existing OS: [root@oraclevm ~]# df -TH | grep -i xfs /dev/mapper/ol-root xfs        19G  5.6G   13G  31% / /dev/nvme0n1p1      xfs       1.1G  311M  754M  30% /boot [root@oraclevm ~]# Format the new disk in the same layout as 1st disk: /dev/nvme0n1: [root@oraclevm ~]# fdisk -l /dev/nvme0n1 Disk /dev/nvme0n1: 20 GiB, 21474836480 bytes, 41943040 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (mi...

Maven - Simple Project Build

Image
  Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information. You need somewhere for your project to reside. Create a directory somewhere and start a shell in that directory. On your command line, execute the following Maven goal: mvn archetype:generate -DgroupId=com.mycompany.app -DartifactId=my-app -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false Executing this command for first time will take time to complete as it downloads dependents .jar file. [INFO] ---------------------------------------------------------------------------- [INFO] Using following parameters for creating project from Archetype: maven-archetype-quickstart:1.4 [INFO] ---------------------------------------------------------------------------- [INFO] Parameter: groupId, Value: com.mycompany.app [INFO] P...

Tomcat Installation - Ubuntu

Image
  Post shows steps to install Tomcat. I am using Apache Tomcat for deploying Java WAR files. Java need to be installed as a pre request. For security purposes, Tomcat should run under a separate, unprivileged user.  root@tomcat:~# useradd -m -d /opt/tomcat -U -s /bin/false tomcat root@tomcat:~# By supplying /bin/false as the user’s default shell, you ensure that it’s not possible to log in as tomcat. Installing Java: root@tomcat:~# apt install default-jdk root@tomcat:~# java -version openjdk version "11.0.16" 2022-07-19 OpenJDK Runtime Environment (build 11.0.16+8-post-Ubuntu-0ubuntu120.04) OpenJDK 64-Bit Server VM (build 11.0.16+8-post-Ubuntu-0ubuntu120.04, mixed mode, sharing) root@tomcat:~#  Downloading Tomcat 10. root@tomcat:~# cd /tmp root@tomcat:/tmp# wget https://dlcdn.apache.org/tomcat/tomcat-10/v10.0.23/bin/apache-tomcat-10.0.23.tar.gz Then, extract the archive you downloaded by running: root@tomcat:/tmp# tar xzvf apache-tomcat-10*tar.gz -C /opt/tomcat --strip-co...