Showing posts with label ubuntu 7. Show all posts
Showing posts with label ubuntu 7. Show all posts

Wednesday, February 27, 2008

Installing and Configuring Lampp (the simple guide)

It may not surprise you if you read the posts around here, but I am a very lazy person when it comes to configuring and installing stuff on anything other than Windows OS. I will avoid anything that involves popping open terminal and putting commands in myself, unless I’ve found them on a forum somewhere.

So, when I was searching the Ubuntu forums for how to make lampp start with Linux, I just wished that someone would post with a clear step by step guide about how to do basic stuff with lampp.

I’ve decided to create this post in the hope that anyone else trying to configure lampp on Ubuntu Linux doesn’t have to look in completely different places to find the answers they are looking for. Note: I’m installing on a clean copy of Ubuntu Linux release 7.10 “Gutsy Gibbon”, with lampp version 1.6.4.

(By the way - non Ubuntu users: you should really give Gutsy Gibbon a spin, even if you are a Windows person like me.)

Step One - Get Lampp

Get lampp. So, you’ll need a direct link to the Sourceforge.net lampp download page.
Make sure that file is downloaded to your Ubuntu desktop, or at least move it there when it’s done, or the commands I’m telling you to paste into terminal won’t find the file.

Step Two - Install It

Yes, I know there’s a perfectly good guide on the lampp site, but it isn’t exactly the same for installing it on Ubuntu. So, I’ll include the (very slightly) modified version for you to paste into terminal below.

sudo tar xvfz Desktop/xampp-linux-1.6.4.tar.gz -C /opt

That’s it. Lampp installed. (Might take a minute or two to extract it all, but it will get there)

Step Three - Starting and Testing

Still in terminal, paste:

sudo /opt/lampp/lampp start

Now you can pop open firefox, and type “localhost” into the address bar.

Note: It should most definately work, but in some cases it doesn’t. I’m afraid this article just assumes that the install went fine, you’ll have to scour the Apache Friends Network Lampp Documentation for help. Sorry :-(

Step Four - Running Lampp At Boot

Sure, if you don’t want to make it run at start-up skip to step five by all means.

So, to make lampp auto run when you boot up your computer, firstly paste the below into terminal:

sudo gedit /etc/init.d/rc.local

When the text editor opens, paste the following just below the “#! /bin/sh” line:

/opt/lampp/lampp start

After you have inserted this line, hit the “Save” button, and close the text editor.

So, now lampp will start when you boot your linux box up. At this point I would recommend trying it out, by restarting your computer.

Step Five - Security

For one thing, it is outlined in the Lamp install instructions that your installation should be secure. So, either follow the instructions on the page above, or just paste the following into terminal:

sudo /opt/lampp/lampp security

The steps are pretty straightforward, and mostly all you have to do is enter a password and hit enter.

Step Six - Fixing Stuff

I did find some problems with the normal use of lampp, mainly with the configuration of ProFTPD. For one thing connecting via FTP over my LAN took absolutely ages to connect, hanging before it had even processed my credentials. So, after looking on numerous forums, I found that it was trying to do a reverse lookup on the client’s IP address (or something like that). The way to disable it is to get on gedit and change the proftpd.conf file. So, get on terminal and paste:

sudo gedit /opt/lampp/etc/proftpd.conf

Now, paste these two lines anywhere in the document, and click save:

IdentLookups off

UseReverseDNS off

I messed about with the settings to let me have read access to the whole server, which is obviously not advised. I also changed the ftp username from “nobody” to “alan”.

Well, that’s basically it. The lampp server is now ready to be used, so have a play around with it.

Below are the screenshots that I was going to use for this post, then decided against them. (They’re showing stuff like running terminal etc)

Oh, and if you’re wondering why all of the screenshots are in 1024×768, I took them all over the VNC server (post), and I have it at that resolution so I can see both my Windows and Ubuntu desktop at the same time, so VNC doesn’t fill the whole screen.

Source

Sunday, January 27, 2008

LAMP

Lately I’ve been using ubuntu 7.10 for all my projects/daily work.
As a web developer i should have LAMP on my machine and now i would guide you through installing it on yours.

This guide is divided into 3 steps: installing/tesing Apache, PHP and finally MySQL.

Lets start with Apache:
1. Open the terminal (we will be using it through most of my guide) from Applications > Accessories > Terminal
2. Install apache2 using apt-get by typing the following

sudo apt-get install apache2

Note that you should know the root password.
Now everything should be downloaded and installed automatically.
To start/stop apache2 write:

sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 stop

Your www folder should be in: /var/www/

If everything is OK you should see an ordinary HTML page when you type: http://localhost in your firefox browser

Finished with Apache ? lets conquer PHP:

1. Also in terminal write:

sudo apt-get install php5 libapache2-mod-php5

or any php version you like
2. restart apache

sudo /etc/init.d/apache2 restart

This is it for PHP :D
Wanna test it ? Just create an ordinary PHP page in /var/www/ and run it.
Example:

sudo gedit /var/www/test.php

and write in it: < ?php echo "Hello World"; ?>

Now run it by typing http://localhost/test.php in firefox… You should see your ” Hello World ”

66 % is over, lets continue to installing MySQL:
1. Again and again in terminal execute:

sudo apt-get install mysql-server

2. (optional) If you are running a server you should probably bind your address by editing bind-address in /etc/mysql/my.cnf and replacing its value (127.0.0.1) by your IP address
3. set your root password (although mysql should ask you about that when installing)

mysql> SET PASSWORD FOR ‘root’@'localhost’ = PASSWORD(’xxxxxx’);

4. Try running it

mysql -uroot -pxxx

where xxx is your password.
Note: You can install PHPMyAdmin for a graphical user interface of MySQL by executing

sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin

5. restart apache for the last time

sudo /etc/init.d/apache2 restart

Congratulions your LAMP system is installed and running :D
Happy Coding

//Jo

UPDATE:
Due to the large number of people emailing about installing/running phpmyadmin.
Do the following:

sudo apt-get install phpmyadmin

The phpmyadmin configuration file will be installed in: /etc/phpmyadmin
Now you will have to edit the apache config file by typing

sudo vi /etc/apache2/apache2.conf

and include the following line:

Include /etc/phpmyadmin/apache.conf

Restart Apache

sudo /etc/init.d/apache2 restart

Another issue was making mysql run with php5
First install these packages:

sudo apt-get install php5-mysql mysql-client

then edit php.ini and add to it this line : ” extensions=mysql.so” if it isnt already there

sudo vi /etc/php5/apache2/php.ini

Restart Apache

sudo /etc/init.d/apache2 restart

Hope this helps :)