Saturday, June 6, 2009

Setup LAMP in Ubuntu

1. Install Apache2
  1. Start the package manager by going to the menu: "System>Administration>Synaptic Package Manager"
  2. Enter your password to allow the program to run.
  3. Search for the package named "apache2" by clicking the search button on the menu bar.
  4. Find the package named exactly "apache2"
  5. Click the check box next to the package and choose "Mark for installation" from the pop up menu.
  6. A window will appear asking if additional changes should be made. These are other packages that apache2 requires to function properly. Choose the button that says "Mark".
  7. Apply the changes by clicking the "Apply" button from the menu
  8. Note: You can select as many packages as you want before applying changes. For example you could install Apache2 at the same time as you install MySQL.
2. Install MySQL and PHP

Search for and install these packages from the package manager:
  • php5-mysql
  • mysql-server
  • mysql-client
  • phpmyadmin (installer will ask what server to connect to. Choose apache2.)
  • libapache2-mod-auth-mysql
3. Configure phpmyadmin

To set up under Apache all you need to do is include the following line in /etc/apache2/apache2.conf, first type the following command to open up this file:

sudo gedit /etc/apache2/apache2.conf

Add the following line of code inside apache2.conf:
Include /etc/phpmyadmin/apache.conf

Now restart Apache:
sudo /etc/init.d/apache2 restart

4. Test it out...
Open up a browser and type "http://127.0.1.1/" into the address bar. If a page comes up that says "It works!" your Apache server is running and configured. Now point to "http://127.0.1.1/phpmyadmin" and verify that the phpmyadmin page comes up.

No comments:

Post a Comment