Install LAMP and phpMyAdmin on Ubuntu 11.10
Page 1 Page 2
LAMP stands for Linux, Apache, MySQL, and php, (or Perl). It's one of the most popular web hosting platforms. If you're developing websites, it's good to have your own private development environment to use while you build and test your websites. This post will show you how to install and configure a LAMP web development environment on Ubuntu 11.10 Oneiric Ocelot to use for testing. It can also be used to set up LAMP on a Virtual Private Server (VPS) or a Dedicated Server, but please note that this post does not cover setting up proper security for serving content to the internet.
The Ubuntu development team has made it very easy to install and configure a LAMP web server. Open a terminal window and enter the following command.
Please enter the command exactly as it's shown above. The carat (^) is not a typo and the command will not work without it.
If prompted, enter your password.
The package manager will now display a list of packages to be installed. Hit <Enter> to confirm that you want to go ahead with the install.
Apt will now start downloading and installing the packages on your computer.
After a short wait, you will be prompted to set a password for MySQL's administrative user. Enter a password at the prompt and make sure it's something you will remember or make a note of it.
You will then be prompted to confirm your password.
Type in the same password and hit <Enter>. The package manager will now continue downloading and installing packages. After a short wait the installation will complete.
Now we'll run a quick test to make sure that the Apache web server is working. Open a web browser and enter the address http://localhost/. You should see a page that says "It Works!"
Now that we've verified that Apache works, we need to verify that php is working properly. We're going to create a file in the /var/www directory called testing.php. Enter the following command in the terminal to create the file.
Enter your password if prompted.
Now you'll need to restart the Apache web server. Enter into the terminal:
Now open your web browser and enter the following address: http://localhost/testing.php
You should see a web page that displays a bunch of information about your php and Apache environment.
Since this is for a local development environment, the MySQL database needs to be bound to the localhost IP address. This should be 127.0.0.1 by default. You can verify your localhost address with the following terminal command.
You should see output something like this:
127.0.0.1 localhost ::1 ip6-localhost ip6-loopback
Now you need to verify that this address is the bind address MySQL's my.cnf file. Use the following terminal command.
You should see output like this.
bind-address = 127.0.0.1
If it's not correct you'll need to edit /etc/mysql/my.cnf as root to fix it.
Page 1 Page 2