Setting-up Apache Web Server with Ansible
- Installing our webservers & loadbalancers
- Lets install apache & php on our web-server
- Go to playbooks directory on ansible host and create install-services.yml
vim install-services.yml
- Content of install-services.yml, Click Here!
- Now run your playbook with:
ansible-playbook install-services.yml
- Configuring our webservers
- Before we start using ansible for setting-up webser. lets create a index.php which will our sample website, create in /home/ec2-user/ansible
vim index.php
Content of index.php
<? echo "<h1>Hello, World! This is my Ansible page.</h1>"; ?>
- Go to playbooks directory on ansible host and create setup-app.yml
vim setup-app.yml
- Content of setup-app.yml, Click Here!
- Now run your playbook with:
ansible-playbook setup-app.yml
- Before we start using ansible for setting-up webser. lets create a index.php which will our sample website, create in /home/ec2-user/ansible