Apache Lab - InaFricke/SYS-255 GitHub Wiki

Setting Up Web01

Required  Fill in
IP Address and Netmask 10.0.5.4/24
Gateway 10.0.5.2
DNS 10.0.5.6
Search Domain ina.local
Hostname web01-ina
  1. ifconfig to check for assigned IP

  2. nmtui to then edit the connection

  3. locate the device name

  4. use the tab key to navigate

  5. change IPV4 configuration to manual

  6. show the configuration

  7. enter address including / notation subnet 10.0.5.4/24

  8. enter the gateway (upstream) 10.0.5.2

  9. enter DNS 10.0.5.6

  10. enter domain controller ina.local

  11. make sure there is an X next to automatically connect

  12. select ok

  1. set system hostname web01-ina

  2. quit

  3. exit

  4. systemctl restart network

Named sudo user

  1. useradd ina

  2. passwd ina

  3. usermod -aG wheel ina

Dissable Root login for SSH

  1. enter sudo and PW

  2. vi /etc/ssh/sshd_config

  3. press I to type

switch yes to no

  1. delete the # to uncomment it

  2. esc

  3. : wq

w= writes it q= quits vi

  1. run sudo systemctl restart sshd

  2. systemctl restart sshd

AD SSH

  1. ssh ina@web01-ina

  2. used my web01 password

Running Apache

  1. sudo yum install httpd

  2. wait for it to say complete

  3. Add ports 80/tcp & 443/tcp or HTTP and HTTPS defined services to your firewall permanently

firewall-cmd --zone=public --add-port=80/tcp --permanent

firewall-cmd --zone=public --add-port=443/tcp --permanent

sudo firewall-cmd --reload

Helpfull link: https://docs.rackspace.com/docs/allow-web-traffic-in-a-firewalld-software-firewall

systemctl enable httpd

systemctl start httpd

https://www.layerstack.com/resources/tutorials/Installing-Apache-server-on-Linux-Cloud-Servers

  1. on WKS enter web01-ina/ into google

sudo -i cd /etc/httpd/conf.d rm welcome.conf

a. i to incert text

b. welcome to Ina's First Attempt

c. esc to exit incert

d. :wq to save and quit

PHP

  1. yum install -y php

systemctl restart httpd

systemctl status httpd

from the HTML directory vi index.php

  1. i to insert

  2. enter the following

  1. on google enter web01-ina/index.php

Install realmd

  1. date to check they will merge well

  2. sudo yum install -y realmd samba samba-common oddjob oddjob-mkhomedir sssd

Join the domain

realm join [email protected] ina.local image

realm list

image

  1. Test by checking if a domain-joined user can SSH into web01

image