[Howto]Setup test "LAMP" Server [Linux]

Find How to do something.

[Howto]Setup test "LAMP" Server [Linux]

Postby StaticExtasy » Mon Jun 27, 2011 1:13 pm

The easiest way I know for setting up a LAMP server is to use XAMPP by Apache friends.

What is LAMP?
Linux (operating system), Apache HTTP Server, MySQL (database software) and Perl/PHP/Python.

What is XAMPP?

XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.


XAMPP is not meant for production use but only for developers in a development environment. The way XAMPP is configured is to be open as possible and allowing the developer anything he/she wants. For development environments this is great but in a production environment it could be fatal.

XAMPP is also available for windows users the concept is the same just without the terminal commands visit apachefriends[dot]org
Lets get started!

First we need to download the XAMPP software:
Open up terminal and copypasta this in.
Code: Select all
wget http://iweb.dl.sourceforge.net/project/xampp/XAMPP%20Linux/1.7.4/xampp-linux-1.7.4.tar.gz

Let that finish downloading and then...........another terminal command

Code: Select all
sudo tar xvfz xampp-linux-1.7.4.tar.gz -C /opt

    tar: short for tarball it is the archiving/packaging program used to make tarball files also is the fileformat in which the archive is created.
      x; extract files from an archive
      v; verbosely list files processed (basicly tells tar to use a lot of words)
      f; tells tar to use an archive file or device
      z; filter the archive through gzip(decompression)
    -C: change to directory DIR which is next to it as /opt

you'll see some more blah blah blah stuff and then bam, guess what. You've downloaded and "installed" your LAMP server!

In order to start XAMPP we need to execute another command in terminal

Code: Select all
sudo /opt/lampp/lampp start

Note this will start everything included with XAMPP, if you just want apache or mysql see bottom for advanced parameters.

You'll see that everything is started and you should be ready to go! Open up your browser and type in http://localhost You should see your new XAMPP page hit English for English or whatever you want for your desired language. This page will give you a rundown. Go ahead and explore. Note that you will want to setup the security features because XAMPP by default has not setup your passwords for everything

Here a list of missing security in XAMPP:

The MySQL administrator (root) has no password.
The MySQL daemon is accessible via network.
ProFTPD uses the password "lampp" for user "nobody".
PhpMyAdmin is accessible via network.
Examples are accessible via network.
MySQL and Apache running under the same user (nobody).

To fix most of the security weaknesses simply call the following command:

Code: Select all
sudo /opt/lampp/lampp security

Once you have done all that there is another matter to attend to. The permissions for the folder in which you place your html, php whatever files is set to read only for your standard user, unless of course you are root by default in that case you can ignore this section, otherwise follow along.

The folder you place all your stuff is called HTDOCS, its located at /opt/lampp/htdocs, so we need to give us permissions, the easiest way is to set it to 777 since this is just a local server for testing, if you desire different permissions look up chmod permissions or change the folder owner to your user, If you want to go with my setup lets get permission!

execute in terminal:
Code: Select all
sudo chmod -R 777 /opt/lampp/htdocs

    sudo: gives temporary root privileges to execute commands as root
    chmod: command used to modify permissions
    -R: change files and directories recursively / meaning folder and sub folders / files and files in sub folders all gets changed
    777: sets all permissions to read and write

You should be able to modify anything in that directory now, also if you use razorCMS software it will automatically set anything used by razorCMS to "safe" mode so you will have to hit "make files unsafe" in razorCMS admin panel to modify any file later. Just remember to make them safe after you are done modifications.

That wraps everything up, hope it helps for you and good luck with razorCMS.

Advanced Parameters
Code: Select all
start      Starts XAMPP.

stop            Stops XAMPP.

restart    Stops and starts XAMPP.

startapache    Starts only the Apache.

startssl    Starts the Apache SSL support. This command activates the SSL support permanently, e.g. if you restarts XAMPP in the future SSL will stay activated.

startmysql    Starts only the MySQL database.

startftp    Starts the ProFTPD server. Via FTP you can upload files for your web server (user "nobody", password "lampp"). This command activates the ProFTPD permanently, e.g. if you restarts XAMPP in the future FTP will stay activated.

stopapache    Stops the Apache.

stopssl    Stops the Apache SSL support. This command deactivates the SSL support permanently, e.g. if you restarts XAMPP in the future SSL will stay deactivated.

stopmysql    Stops the MySQL database.

stopftp    Stops the ProFTPD server. This command deactivates the ProFTPD permanently, e.g. if you restarts XAMPP in the future FTP will stay deactivated.

security    Starts a small security check programm.
Michael P.
DMH Computers
Posts: 71
Joined: Thu Jul 01, 2010 2:24 pm
Location: Maryland, USA

Re: [Howto]Setup test "LAMP" Server [Linux]

Postby smiffy6969 » Mon Jun 27, 2011 9:59 pm

Nice guide ......

Just to add, xampp is where razor is built, with full error checking switched on....

Posts: 1866
Joined: Sat May 24, 2008 8:18 am
Location: Loughborough, UK

Re: [Howto]Setup test "LAMP" Server [Linux]

Postby StaticExtasy » Tue Jun 28, 2011 7:00 am

I will probably repack xampp without the extra stuff like the ftp and such so its smaller and add a preinstalled razorcms setup and then pack it alltogether as a razorcms dev pack for people just getting started
Michael P.
DMH Computers
Posts: 71
Joined: Thu Jul 01, 2010 2:24 pm
Location: Maryland, USA

Return to How-To's

Who is online

Users browsing this forum: No registered users and 1 guest