LAMP stands for Linux, Apache, MySQL, and PHP, which represents a very common configuration for Linux-based web servers. If you’re interested in testing websites, particularly those that involve a server-side scripting language like PHP, you can install a local LAMP server on your own computer. This tutorial will show you some tricks for setting up a local LAMP server.
Most of this tutorial will apply to any Linux distribution, however the first trick only applies to Debian-based distributions using Synaptic (including Ubuntu).
Open Synaptic and choose Edit > Mark packages by task… Then check the box next to LAMP Server, click OK, and click Apply. That’s it!
By defualt, the directory that stores all the files for your new server (/var/www/) can only be written to by root. This gets to be a real pain, since you have to use sudo any time you want to put something in /var/www/. You can fix this using the following command:
sudo chmod o+w /var/www/
This allows anyone to write to /var/www/. I am sure many people will argue that this is a bad policy; however, I generally feel that there is minimal risk in opening up one non-essential directory to write access by anyone on a personal computer.
What if your new website involves interactions between different users or you need to see how it looks on a different operating system? You don’t need to buy hosting space just to do these tests. If you have another computer on the same network, you can actually access the website from that computer.
On your server computer, type this command:
Find the IP address after inet addr and enter this in the address bar on a different computer that is on the same network. You should see the Apache “It works!” page or whatever else you have in the root of your /var/ww/ directory.
I hope this helps you create some cool websites without paying for hosting until you really need it.