Setting up a Lampp Server

To do all our development, designing and testing we use a server on our local machines, this way you can avoid unnecessary bandwidth and time delays. I am using a linux operating system (Ubuntu 810). To develop locally we use Lampp, which is Xampp for Linux. This will create a localhost for all your server requirements.

The steps

1. Firstly download the latest Lampp program from
here

Save the file to your home folder, I prefer to save the files I download to an "install" folder, as opposed to installing them directly off the net, this way I have them for later needs.

2. If you already have a previous version of Lampp installed, you will need to remove it first by typing this in the Linux Terminal:
sudo rm -rf /opt/lampp

3. Now extract and install your new version of lampp:
sudo tar xvfz xampp-linux-1.6.7.tar.gz -C /opt

The Server should now be working correctly, however, the /opt folder is a system folder, and does not belong to you, so you cannot edit or add any files to your server. To make this as user friendly as possible, we just make a link to the server from an outside folder which we can edit and have full control over.

4. In /opt/lampp copy the htdocs folder, and paste it somewhere safe, the desktop is good enough for now.

5. Delete the htdocs folder in /opt/lampp
sudo rm -rf /opt/lampp/htdocs

6. Create a linked folder in you home folder
sudo ln -s /home/steven/htdocs /opt/lampp/htdocs

7. Now copy the content from your htdocs folder on your desktop to the new folder that was created in the home folder /home/mysystem/htdocs

8. The last thing we need to do is to change the php.ini file to allow larger file uploads, and increase the memory limit. to do this in the terminal type:
sudo chmod a+w /opt/lampp/etc/php.ini

Now you have permission to open php.ini and save changes to the file. Navigate to /opt/lampp/etc and open the php.ini file, here you modify three things:
memory_limit = 16M
post_max_size = 16M
upload_max_filesize = 16M

This will allow you to import bigger files and increase the memory limit should your web site require it. Once the changes have been made, you will need to restart your server by typing
sudo /opt/lampp/lampp restart
(This step is not essential, it is just important to remember, should an error message show on your screen)

9. Finally save the changes and restore the file permissions back to there original status:
sudo chmod a-w /opt/lampp/etc/php.ini

You will now have a working server on your computer, test this by running:
sudo /opt/lampp/lampp start
in your browser type "http://localhost" and you will see the "Xampp for Linux" home page.
To turn your server off:
sudo /opt/lampp/lampp stop

In Conclusion

I hope somebody finds this post useful and makes the web developing experiences on a Linux system more enjoyable, without the hassles I had in figuring this out myself from several different posts on the web.

 
bowman (not verified) wrote 6 weeks 6 days ago

My greetings me very liked

My greetings me very liked your blog


Click here to subscribe to our feed.