Linux Assessment - jude-lindale/Wiki GitHub Wiki
Rehearsal tasks:
You will need to network your system with an IP of your choice
- as root run
nmtui
to configure network - Hostname
- 10.0.5.4/24
- Gateway 10.0.5.2
- DNS 10.0.5.6
Named sudo user
- As root
- run
useradd jude
which created a profile, - Then
passwd [password]
which put a password for the user - Then
usermod -aG wheel jude
which added the user to the wheel group.
Secure SSH
- Disable remote root ssh access within the PermitRootLogin no flag in /etc/ssh/sshd_config file
- Run
Sudo Systmd Restart sshd
- logout and login again via SSH, so that your new hostname takes hold in the active session.
Join AD domain
- run
sudo yum install realmd samba samba-common oddjob oddjob-mkhomedir sssd
- run
realm join [email protected] yourdomain.local
- run
realm list
- Make sure that WEB is in Active Directory Users and Computers under Computers
Adjust DNS
- On AD make sure that WEB is in Forward and Reverse Lookup Zone in DNS Manager
Get ready for blog installation (LAMP)
Install HTTP
sudo yum install httpd
- Start HTTPD
sudo systemctl start httpd
- On AD spot check by searching for http://serverip/
- Enable HTTPD
sudo systemctl enable httpd
- Find Server's Public IP
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'
Install MYSQL
sudo yum install mariadb-server mariadb
- Start MariaDB
sudo systemctl start mariadb
- Run MYSQL security script
sudo mysql_secure_installation
- enter password
- Enable MariaDB
sudo systemctl enable mariadb
Install PHP
sudo yum install -y php
sudo yum install php php-mysql
- Restart HTTPD
sudo systemctl restart httpd
Test PHP Processing on your Web Server
sudo vi /var/www/html/info.php
- Put following text
<?php phpinfo(); ?>
- To allow traffic through firewall
sudo firewall-cmd --permanent --zone=public --add-service=http
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
- Visit
http://your_server_IP_address/info.php
- Remove said file
sudo rm /var/www/html/info.php
Install a blog
Create a MySQL Database and User for WordPress
mysql -u root -p
- Create database
CREATE DATABASE wordpress;
- Create A user for word press data base
CREATE USER wordpressuser@localhost IDENTIFIED BY 'password';
- Grand access to the user
GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY 'password';
FLUSH PRIVILEGES
- Then exit root
Install WordPress
-
sudo yum install php-gd
-
sudo service httpd restart
-
Run the following
cd ~ wget http://wordpress.org/latest.tar.gz
-
Extract WordPress file
tar xzvf latest.tar.gz
-
transfer unpacked files
sudo rsync -avP ~/wordpress/ /var/www/html/
-
Create directory for WordPress to store uploaded files
mkdir /var/www/html/wp-content/uploads
-
Assign Onwership and Permissions
sudo chown -R apache:apache /var/www/html/*
Configure WordPress
-
cd /var/www/html
-
Copy config file
cp wp-config-sample.php wp-config.php
-
Open Config file
nano wp-config.php
-
Fill in areas where it says wordpress, wordpressuser, and password
// ** MySQL settings - You can get this info from your web host ** // /** The name of the database for WordPress */ define('DB_NAME', 'wordpress'); /** MySQL database username */ define('DB_USER', 'wordpressuser'); /** MySQL database password */ define('DB_PASSWORD', 'password');
Complete Installation Through the Web Interface
- Search for http://server_domain_name_or_IP are finish installation