The LAMP stack; Linux, Apache, Mysql and PHP changed the web — forever. These four musketeers empowered hobbyist, novice and pro launch their ideas to the world with so much ease that the stack has over the years endured an onslaught of new shinny frameworks and tools.
These days, you might hear the cool kids talking about the MEAN stack (MongoDB, Express JS, Angular JS and NodeJS) but don’t fall for it yet. These technologies are still in their infancy, stick to what has worked.
But installing the LAMP stack is no easy feat if you are not an advanced Linux user. Most users especially my Windows brothers usually just install xampp or wamp on their local machines and it usually does the job at least for local development. In production, you don’t want to use these.
So here’s a script that installs Apache, PHP and the most important extensions, Mysql and the awesome Phpmyadmin. This will install your distros default package version. For instance if installing on Ubuntu 16.04 LTS, it’ll install php7.0 and php 5.6 on 14.04 LTS.
#!/bin/bash #update packages sudo apt-get update #install apache sudo apt-get -y install apache2 #install mysql my_mysql_password="strong_password" sudo debconf-set-selections
You can save this somewhere on your Linux machine as lamp.sh and make it executable using sudo chmod +x lamp.sh. Run it as ./lamp.sh or bash lamp.sh.