## Task 11 The Nautilus application development team recently finished the beta version of one of their Java-based applications, which they are planning to deploy on one of the app servers in Stratos DC. After an internal team meeting, they have decided to use the tomcat application server. Based on the requirements mentioned below complete the task: a. Install tomcat server on App Server 3. b. Configure it to run on port 8088. c. There is a ROOT.war file on Jump host at location /tmp. ```bash # from jump-host scp /tmp/ROOT.war steve@stapp02:/tmp/ sudo yum install -y tomcat tomcat-webapps tomcat-admin-webapps sudo sed -i 's/port="8080"/port="6300"/' /etc/tomcat/server.xml # verify sudo grep -n '6300' /etc/tomcat/server.xml sudo cp /tmp/ROOT.war /var/lib/tomcat/webapps/ sudo chown tomcat:tomcat /var/lib/tomcat/webapps/ROOT.war sudo systemctl enable --now tomcat sudo systemctl restart tomcat # ensure it picks up server.xml change if already running # give it a few seconds to explode the WAR, then: curl -I http://localhost:8088/ # possible problem # Stock ROOT collision. If tomcat-webapps installed its own ROOT/ dir, and your ROOT.war sits beside it, tomcat may not redeploy over an # existing exploded dir. Nuke the stock one first: sudo rm -rf /var/lib/tomcat/webapps/ROOT then drop the war and restart. ``` ## Task 12 Our monitoring tool has reported an issue in Stratos Datacenter. One of our app servers has an issue, as its Apache service is not reachable on port 8089 (which is the Apache port). The service itself could be down, the firewall could be at fault, or something else could be causing the issue. Use tools like telnet, netstat, etc. to find and fix the issue. Also make sure Apache is reachable from the jump host without compromising any security settings. Once fixed, you can test the same using command curl http://stapp02:8089 command from jump host. ```bash ss -tulnp # kill semndmail sitting on the port # start httpd # remove reject rule from iptables iptables -D INPUT 5 ``` ## Task 13 We have one of our websites up and running on our Nautilus infrastructure in Stratos DC. Our security team has raised a concern that right now Apache’s port i.e 8084 is open for all since there is no firewall installed on these hosts. So we have decided to add some security layer for these hosts and after discussions and recommendations we have come up with the following requirements: 1. Install iptables and all its dependencies on each app host. 2. Block incoming port 8084 on all apps for everyone except for LBR host. 3. Make sure the rules remain, even after system reboot. ```bash # --- resolve LBR host IP (script runs from jump-host) --- LBR_IP=$(getent hosts stlb01 | awk '{print $1}') echo "LBR IP resolved to: $LBR_IP" [ -z "$LBR_IP" ] && { echo "ERROR: could not resolve stlb01"; exit 1; } # --- creds (app servers only — the three targets) --- cat > creds.txt <<'EOF' stapp01 tony Ir0nM@n stapp02 steve Am3ric@ stapp03 banner BigGr33n EOF chmod 600 creds.txt # --- firewall script --- cat > fw_8084.sh <