Date: 03/27/2022 ---------------- ### Check Motherboard Model [root@localhost TEST]# dmidecode -t 2 Manufacturer: Gigabyte Technology Co., Ltd. Product Name: Z77M-D3H-MVP Version: x.x Serial Number: To be filled by O.E.M. Asset Tag: To be filled by O.E.M. Features: Board is a hosting board Board is replaceable Location In Chassis: To be filled by O.E.M. Chassis Handle: 0x0003 Type: Motherboard Contained Object Handles: 0 ### RAM Upgrade Compatible upgrades DRAM Compatible memory for: GA-Z77M-D3H Crucial 8GB DDR3L-1600 UDIMM CT102464BD160B Configuration ID: CT3328288 DDR3-1600 • CL=11 • NON-ECC • UDIMM • 240-pin • 1.35V • 2Rx8 • PC3-12800 ### HARD DISK Last login: Tue Mar 29 08:46:18 2022 from 192.168.1.239 [malex@localhost ~]$ sudo lshw -class disk *-disk:0 description: ATA Disk product: WDC WD20EZAZ-00L vendor: Western Digital physical id: 0 bus info: scsi@0:0.0.0 logical name: /dev/sda version: 0A80 serial: WD-WX72D715ZJ7H size: 1863GiB (2TB) capabilities: gpt-1.00 partitioned partitioned:gpt configuration: ansiversion=5 guid=53cbf7a0-3d1b-47a4-9236-1a4faaa21750 logicalsectorsize=512 sectorsize=4096 *-disk:1 description: ATA Disk product: WDC WD10EZEX-00B vendor: Western Digital physical id: 1 bus info: scsi@1:0.0.0 logical name: /dev/sdb version: 1A01 serial: WD-WCC3F3007000 size: 931GiB (1TB) capabilities: partitioned partitioned:dos configuration: ansiversion=5 logicalsectorsize=512 sectorsize=4096 signature=aa05b1f1 [malex@localhost ~]$ ### INSTALLATION OF OS 1. Download the latest image from URL: https://download.rockylinux.org/pub/rocky/8/isos/x86_64/Rocky-8.5-x86_64-minimal.iso. 2. From Windows 10 or another Linux, create a bootable USB drive. See URL: https://github.com/balena-io/etcher/blob/master/docs/USER-DOCUMENTATION.md 3. Power on the machine and go to system bios to set the primary boot to the USB. 4. Insert bootable USB and and reboot machine. 5. When the booting is done, it should prompt to install Rocky Linux 8. 6. Install the minimal setup. Manually change partition if necessary. [root@localhost .ssh]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 1.8T 0 disk ├─sda1 8:1 0 600M 0 part /boot/efi ├─sda2 8:2 0 1G 0 part /boot └─sda3 8:3 0 1.8T 0 part ├─rl-root 253:0 0 70G 0 lvm / ├─rl-swap 253:1 0 7.8G 0 lvm [SWAP] ├─rl-usr 253:2 0 300G 0 lvm /usr ├─rl-var 253:6 0 432.1G 0 lvm /var ├─rl-tmp 253:7 0 46.6G 0 lvm /tmp ├─rl-opt 253:8 0 279.4G 0 lvm /opt ├─rl-usr_local 253:9 0 468M 0 lvm /usr/local ├─rl-home 253:10 0 433.7G 0 lvm /home ├─rl-var_lib_docker 253:11 0 291G 0 lvm /var/lib/docker └─rl-apps 253:12 0 468M 0 lvm /apps sdb 8:16 0 931.5G 0 disk ├─sdb1 8:17 0 1G 0 part └─sdb2 8:18 0 930.5G 0 part ├─cl-swap 253:3 0 7.8G 0 lvm ├─cl-home 253:4 0 872.7G 0 lvm /home/thermalite └─cl-root 253:5 0 50G 0 lvm /home/theroot [root@localhost .ssh]# 7. After installation is complete, you can login as root. ### SETUP SUDO FOR malex # sudo su - vi /etc/sudoers cat /etc/sudoers | grep malex malex ALL=(ALL) NOPASSWD:ALL ### SETUP BASH PROFILE vi ~/.bash_profile cat ~/.bash_profile # User specific environment and startup programs export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\[\e[97;104m\] \u@\h \[\e[30;43m\]\w\[\e[97;45m\]\$(parse_git_branch)\[\e[0m\] $ " ### CONFIGURATION OF ETHERNET 1. Then first, try to check the state of the network interface and details using nmcli. The nmcli is a command-line tool for controlling the NetworkManager service. Use the following command to check. # nmcli device status 2. Run the tool nmtui to configure the network interface. The nmtui is part of the NetworkManager tool which gives you a nice UI to configure the network. This is part of the package NetworkManager-tui and should be installed by default when you have completed the installation of the minimal server. # nmtui 3. Click on Edit a connection in the nmtui window. 4. Select the interface name: ensp02 5. In the Edit Connection window, choose Automatic for IPv4 and IPv6. And select Automatically Connect. Press ok once done. [root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-enp2s0 TYPE=Ethernet PROXY_METHOD=none BROWSER_ONLY=no BOOTPROTO=none DEFROUTE=yes IPV4_FAILURE_FATAL=no IPV6INIT=yes IPV6_AUTOCONF=yes IPV6_DEFROUTE=yes IPV6_FAILURE_FATAL=no IPV6_ADDR_GEN_MODE=stable-privacy NAME=enp2s0 UUID=64d0bc95-c8bd-45c7-8274-00ef8c74d6f7 DEVICE=enp2s0 ONBOOT=yes IPADDR=192.168.1.80 PREFIX=24 GATEWAY=192.168.1.1 DNS1=8.8.8.8 DNS2=192.168.1.1 USRCTL=no 6. Restart the NetworkManager service via the systemd systemctl using the following command. # systemctl restart NetworkManager 7. If all goes well, you should be connected to the network and internet in the minimal installation of CentOS, RHEL, Rocky Linux server. Provided your network has internet connectivity. You can use ping to verify whether it is working. # ping google.com ### SETUP SSH Enable ssh service on Rocky Linux step by step instructions # sudo su - { dnf install openssh-server systemctl start sshd systemctl status sshd systemctl enable sshd firewall-cmd --zone=public --permanent --add-service=ssh ssh malex@192.168.1.100 ssh-keygen -t rsa -b 4096 -C "malex@thermalite" ## REFERENCE: https://linuxize.com/post/how-to-setup-passwordless-ssh-login/ ## BACKUP: /home/malex/.ssh/authorized_keys dnf install nmap -y nmap localhost -vv } ### SETUP git as root dnf install git -y ### SETUP curl as root dnf install curl -y ### SETUP xRDP ## URL: https://javalinpilipinas.blogspot.com/search?q=xrdp ### INSTALL CHROME BROWSER sudo su - { dnf install wget -y wget https://dl.google.com/linux/linux_signing_key.pub rpm --import linux_signing_key.pub wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm dnf install google-chrome-stable_current_x86_64.rpm -y } ### INSTALL DOCKER sudo su - { dnf update -y dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo dnf repolist -v dnf list docker-ce --showduplicates | sort -r dnf install -y docker-ce systemctl start docker systemctl enable docker systemctl status docker } malex@localhost ~ $ sudo usermod -aG docker $USER malex@localhost ~ $ id $USER malex@localhost ~ $ rpm -qa | grep docker malex@localhost ~ $ docker --version malex@localhost ~ $ docker info malex@localhost ~ $ sudo docker info malex@localhost ~ $ docker images ls malex@localhost ~ $ sudo chmod 666 /var/run/docker.sock malex@localhost ~ $ docker images ls malex@localhost ~ $ docker --version malex@localhost ~ $ docker info malex@localhost ~ $ docker run hello-world malex@localhost ~ $ docker pull alpine malex@localhost ~ $ docker images malex@localhost ~ $ docker run -it --rm alpine /bin/sh sudo su - { dnf install -y curl curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose chmod +x /usr/local/bin/docker-compose docker-compose --version } ### SETUP DOCKER CONTAINERS ## Dockerhub Account: azmadriaga@gmail.com / (Z878=nvJ2$czx? / 5feb708a-51f7-4181-983d-7ccaebd93d84 1. HTTP docker pull httpd $ mkdir www-httpd $ echo "Hello, world.httpd" > www-httpd/index.html $ chmod -R 755 www-httpd/ docker run -dit --name httpd -p 8080:80 -v /home/malex/www-httpd/:/usr/local/apache2/htdocs/ httpd $ curl http://localhost:8080 2. nginx docker pull nginx $ mkdir www-nginx $ echo "Hello, world.nginx" > www-nginx/index.html $ chmod -R 755 www-nginx/ docker run -dit --name nginx -p 80:80 -v /home/malex/www-nginx/:/usr/share/nginx/html:ro -d nginx $ curl http://localhost 3. Jenkins docker pull jenkins/jenkins:lts-jdk11 $ mkdir www-jenkins $ chmod -R 755 www-jenkins/ docker run -dit --name jenkins -v /home/malex/www-jenkins:/var/jenkins_home -p 9090:8080 -p 50000:50000 jenkins/jenkins:lts-jdk11 $ cat www-jenkins/secrets/initialAdminPassword Admin user: Username: jenkins Password: docker7691! $ Open Chrome browser URL http://192.168.1.100:9090/ 4. MS-SQL Server docker pull mcr.microsoft.com/mssql/server docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=docker7691!" -e "MSSQL_PID=Express" -p 1435:1433 -d mcr.microsoft.com/mssql/server:2019-latest docker exec -it 3bb987b6ae39 /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P docker7691! On your Windows 10, open SQL Server Management Studio Server type: Database Engine Server name: 192.168.1.80,1435 Authentication: SQL Server Authentication Login: sa Password: docker7691! jTDS - SQL Server and Sybase JDBC driver: https://sourceforge.net/projects/jtds/ ## In SQL Developer, Tools->Preferences->Database-> Third Party JDBC Drivers ->Add Entry...C:\Program Files\jdbc\jtds-1.2.8.jar -> OK ## Restart SQL Developer ## Create new connection On your Windows 10, open SQL Developer Name: MS-SQL Server Connection Database Type: SQLServer Username: sa Password: docker7691! Hostname: 192.168.1.100 Port: 1435 5. Postgresql docker pull postgres docker run --name postgres -e POSTGRES_PASSWORD=docker7691! -p 5432:5432 -d postgres ## In SQL Developer, Tools->Preferences->Database-> Third Party JDBC Drivers ->Add Entry...C:\Program Files\jdbc\postgresql-42.3.3.jar -> OK ## Restart SQL Developer ## Create new connection On your Windows 10, open SQL Developer Name: Postgresql Connection Database Type: Postgresql Username: postgres Password: docker7691! Hostname: 192.168.1.80/postgres? Port: 5432 6. MySQL docker pull mysql docker run --name mysql -e MYSQL_ROOT_PASSWORD=docker7691! -p 3306:3306 -d mysql sudo firewall-cmd --add-service=mysql --permanent sudo firewall-cmd --reload #docker run -it --network some-network --rm mysql mysql -hsome-mysql -uexample-user -p #docker run -it --rm mysql mysql -hsome.mysql.host -usome-mysql-user -p ## In SQL Developer, Tools->Preferences->Database-> Third Party JDBC Drivers ->Add Entry...C:\Program Files\jdbc\mysql-connector-java-8.0.28.jar -> OK ## Restart SQL Developer ## Create new connection On your Windows 10, open SQL Developer Name: MySQL Connection Database Type: MySQL Username: root Password: docker7691! Hostname: 192.168.1.100 Port: 3306 7. Oracle docker login container-registry.oracle.com Username: Password: Login Succeeded $ git clone https://github.com/oracle/docker-images.git $ cd /home/malex/docker-images/OracleDatabase/SingleInstance/dockerfiles $ ./buildContainerImage.sh -v 19.3.0 -s $ mkdir -p /home/malex/www-oracle $ chmod -R a+rxw /home/malex/www-oracle $ sudo firewall-cmd --add-port=1521/tcp --permanent $ sudo sudo firewall-cmd --reload docker run -d --name oracle -p 1521:1521 -p 5500:5500 -e ORACLE_SID=test -e ORACLE_PWD=docker7691! -v /home/malex/www-oracle:/opt/oracle/oradata oracle/database:19.3.0-se2 docker container ls CONTAINER ID IMAGE fbe1c71ca604 oracle/database:19.3.0-se2 docker container commit fbe1c71ca604 azmadriaga/oracle-19.3.0-se2:latest docker images REPOSITORY TAG IMAGE ID CREATED SIZE azmadriaga/oracle-19.3.0-se2 latest 2c603a2b0324 19 seconds ago 6.96GB docker login Username: Password: docker push azmadriaga/oracle-19.3.0-se2:latest docker logs fbe1c71ca604 -f ORACLE EDITION: STANDARD LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 27-MAR-2022 18:25:39 Copyright (c) 1991, 2019, Oracle. All rights reserved. Starting /opt/oracle/product/19c/dbhome_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 19.0.0.0.0 - Production System parameter file is /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora Log messages written to /opt/oracle/diag/tnslsnr/fbe1c71ca604/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 19.0.0.0.0 - Production Start Date 27-MAR-2022 18:25:41 Uptime 0 days 0 hr. 0 min. 2 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /opt/oracle/product/19c/dbhome_1/network/admin/listener.ora Listener Log File /opt/oracle/diag/tnslsnr/fbe1c71ca604/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521))) The listener supports no services The command completed successfully [WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards. CAUSE: a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines. [WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards. CAUSE: a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines. [WARNING] [DBT-06208] The 'PDBADMIN' password entered does not conform to the Oracle recommended standards. CAUSE: a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9]. b.The password entered is a keyword that Oracle does not recommend to be used as password ACTION: Specify a strong password. If required refer Oracle documentation for guidelines. Prepare for db operation 8% complete Copying database files 31% complete Creating and starting Oracle instance $ sqlplus SYS/docker7691!@//192.168.1.100:1521/test as SYSDBA ## On Windows where SQL Developer will run, create a c:\oracle\tnsnames.ora. thermalite = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.100)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = test) ) ) ) ## In SQL Developer, Tools->Preferences->Database-> + ->Advanced -> Tnsnames Directory: c:\oracle\tnsnames.ora. -> OK ## In SQL Developer, Tools->Preferences->Database-> Third Party JDBC Drivers ->Add Entry...C:\Program Files\jdbc\mysql-connector-java-8.0.28.jar -> OK ## Restart SQL Developer ## Create new connection On your Windows 10, open SQL Developer Name: Oracle Connection Database Type: Oracle Username: SYS Role: SYSDBA Password: docker7691! Connection Type: TNS Network Alias: thermalite 8. Portainer docker pull portainer/portainer-ce docker volume ls docker volume create portainer_data docker run -d -p 8007:8000 -p 9007:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data/portainer/portainer
Sunday, March 27, 2022
Setting Up your Linux Server (Rocky Linux 8) from Scratch.
Subscribe to:
Posts (Atom)