Setting up LAMP (Linux, Apache, MySql, Python)
I’m learning Web Development with Django and a LAMP software stack. Here’s how I set up a LAMP software installation on my computer.
First I installed Void LInux on the computer.
Here’s how to install Void Linux, for the curious: https://docs.voidlinux.org/installation/index.html
With Linux installed, open a command prompt and install Apache, Mysql, and Python. Make sure that you install Python 3 — There are two versions of Python being used and maintained today, 2 and 3, and we need number 3. To Install this software, type this into the terminal ‘sudo xbps-install -S apache mysql python3’ (on Void, It will differ if you are using a different distro).
Once it’s installed, we want to enable and start apache and mysql. There’s three more things to check in the terminal:
‘sudo ln -s /etc/sv/apache /var/service/apache’
‘sudo ln -s /etc/sv/mysqld /var/service/mysqld’
These two commands put mysql and apache in a list of programs that the computer runs when it starts up.
Last command: ‘sudo sv start apache’ This starts the apache server now. I could have restarted the computer instead, but it’s easier to run this command.
And now, the fruits of labor. Let’s look at what happens when we visit the server in a web browser. Just put the computer’s ip address into a web browser, and we get this page:
This doesn’t do anything interesting yet, but it shows that the web server is up and running, and ready to have a website built on it. It provides the foundation for what I want to do with my project.
Next, I’ll look at building webpages to host on this server, then start on the website itself.
Have a look at the other parts of my project here: I built a website.