Lab 07: Apache - squatchulator/Tech-Journal GitHub Wiki

This lab covers the installation and configuration of an Apache web server, and joining it to our domain. Apache is a web server software that is free and open source using both UNIX and Windows.

Apache Installation

  • You'll likely want to disable remote root ssh access first. This will be located in the PermitRootLogin no flag in /etc/ssh/sshd_config.
  • Start by installing the httpd package on the Apache system. This can be done using yum.
  • Afterwards add the 80/tcp & 443/tcp ports to the firewall permanently firewall-cmd --permanent --add-port 80/tcp. To check ports, use firewall-cmd --list-all to display firewall information.
  • Remove the welcome.conf file using rm /var/www/html/welcome.conf. Add a new file here called index.html. The contents of this file will be displayed on your server's website.
  • Install PHP using yum install -y php. The -y tag will automatically answer yes to any question prompt during the operation.
  • In the directory outlined in steps above, you can add PHP files to make more complicated webpages. Join Domain (Linux)
  • Install the required tools using sudo yum install -y realmd samba samba-common oddjob oddjob-mkhomedir sssd
  • Ensure time zones are consistent across Windows and Linux systems. You can use tzutil /g to check on Windows, and you can use timezonectl to check in Linux.
    • To edit timezone in Linux, use timedatectl set-timezone
  • If timezones are the same, enter realm join [email protected] firstname.local to join the domain. The firstname-adm is the name of the domain's admin username, followed by your domain name, then local realm list.
    • You can verify this worked with realm list
  • You can now log out of the SSH session, and enter a new one as an AD domain named user with ssh [email protected]@web01-firstname to test it out.