I'm having trouble establishing a Ubuntu-LAMP environment with continuous integration - I feel lost from the different solutions out there and time and again I fear that my vanilla-Bash Ubuntu-LAMP establishment-program of four different scripts (aimed for maximally-self-managed hosting platforms like DigitalOcean or Linode) will quickly become outdated:

That some or all of the entire system getting vulnerable/unsupported and then I'll have to create another environment with a newer operating system with newer server environment (web/email) and moving manually all web applications and their data to this new environment, which is hard and consuming when I work alone maintaining my own personal web applications.

VAD (Vagrant-Ansible-Docker)

From all my reading so far I get the impression that a VAD stack (Vagrant-Ansible-Docker) is the only way for me to avoid the problematic state I described above (if I want a VPS environment and not just shared-server hosting platform):

  1. Release updates and upgrades for my OS (Ubuntu 16.04 to 18.04 to 20.04 - to whatever version; and ufw but without changing my ufw directives like ufw --force enable && ufw allow 22,25,80,443).
  2. Updates and upgrades for all my packages (Apache 2.4-3.4 and so forth; unattended-upgrades curl wget zip unzip mysql php php-{cli,curl,mbstring,mcrypt,gd} python-certbot-apache ssmtp, Composer).
  3. Docker images will help me automate creation of bare-metal web applications that I would then change credentially to create new web applications.

This way, for example, Ubuntu will go from 16.04 to 18.04 directly and the Apache package will go from 2 to 3 and all my Apache virtual hosts for Apache 2.4 virtual-host files will automatically transduce into 3.x.x format.

This sounds like a sweet dream with the only disadvantage of performance (I'm not sure a 5$ or even 20$ cloud-partition could handle such stack).

My question

Is my description accurate and if so - what is the common solution that combines these three that I should use (assuming there is some combo which is an industry-standard)?

On the top of such VAD solution, I'll execute much less vanilla-Bash directives (about 25 lines instead 150-200 lines) which will be much easier for me to maintain myself, at least by means of package-management.

  • 1
    just in regards to your edit. There are modules for many things in ansible, so it acts as an abstraction for some parts of the system. In regards to ufw, you would just define your wanted state and Ansible would bring it to that state (if necessary) docs.ansible.com/ansible/2.7/modules/ufw_module.html – jdog Nov 18 '18 at 5:26
  • Hmm, thank you ! – JohnDoea Nov 18 '18 at 5:51

I think your research is leading you in the right direction, but I cannot see the value of Docker in here.

I found managing LAMP environments with Ansible completely unproblematic and the scripts I have used for 16.04 only needed a single line changes for upgrade to 18.04. I have also used them on a local development environment and there is no need to have the additional layer and security can be established easily with standard Linux permissions.

I can see the use of Docker, if you need to run the same vhost twice with different configurations on the same bare metal.

With Vagrant, this is a good tool to manage a different technology stack on the same bare metal, for example upgrading to MySQL 8 when at the same time you need to have MySQL 5.7 running on your dev machine at all times for regressions. I have not had this need so far, but can imagine situations where it is useful.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.