Configuring static content web server

In this post I will be presenting setup of a web server hosting example .html webpage.

For this exercise I’ve chosen Apache Tomcat to be an HTML server serving the content, however any of popular HTTP server solutions on the market would work as well.

The playbook consists of installation of Tomcat, making sure that TCP port 80 is open, starting/enabling httpd service as well as copying .html webpage file to /var/www/html directory. You can see it’s content below:

In order to run it execute following command:

ansible-playbook ./simple-webapp.yml 

After completing execution you should see output similar to one below:

To confirm that server works as intended, type address of your application server on host computer web browser. Content of webpage will be displayed:

That’s it for today’s post. In following one I will present deployment of dockerized sample web application.

Leave a Reply

Your email address will not be published. Required fields are marked *