Install Apache 2.2, MySQL 5, PHP 5, phpMyAdmin for Linux Ubuntu 9.04
This tutorial shows you how to install Apache 2.2, MySQL 5, PHP5, and phpMyAdmin for Linux using the Synaptic Package Manager in Ubuntu 9.04. You may also use Synaptic on some other versions of Linux, but I don't know the differences, so therefore you're on your own.
* A NOTE ABOUT USING SYNAPTIC PACKAGE MANAGER *
I will inform you that the Synaptic Package Manager is configured to install the most stable versions of apps and they may not be the newest releases because of that. However, you can change the settings to be able to install the latest versions. Here's a quote from the Ubuntu IRC channel:
" Packages in Ubuntu may not be the latest. Ubuntu aims for stability, "latest" may not be a good idea. Post-release updates are only considered if they are: fixes for security vulnerabilities, high impact bug fixes, or unintrusive bug fixes with substantial benefit. "
You can read more about it's sources from HERE.
You can also install them manually by downloading and compiling them yourself, but that is beyond this tutorial and requires more work.
Ubuntu's update manager will notify you when new updates are available for installation.
What does this mean?
Nothing major, I'll assure you of that. It's probably better to use the versions Synaptic Package Manager installs because they work well together. And as stated, they will be updated if they are needed. But if you insist on having the very latest versions, you can get them. I will later test them to see if I run into any complications, but for this tutorial, I will be using the versions presented in the Synaptic Package Manager. They are Apache 2.2.11, MySQL 5.1.30, PHP 5.2.6, and phpMyAdmin 3.1.2.
LET'S BEGIN!
HOW TO FIX RAPACHE 0.7 FOR UBUNTU 9.04 JAUNTY 9.10
The developers for Rapache (GUI for Apache 2) haven't released an updated version of Rapache since the release of Ubuntu 9.04 and there's a small error that makes it freeze up. Luckily, there's an easy fix that takes only a couple of minutes.
04/16/2010 - UPDATE
The fix that was here doesn't work with Ubuntu 9.10. I've managed to figure it out with the help of generous visitors on my other blog.
You can find it at http://mydumbthoughts.wordpress.com/2009/07/30/rapache-keeps-freezing-up-in-ubuntu-9-04/, which is where I've posted the new fix for 9.10.
ADDITIONAL NOTES
The most difficult part after installing everything for me was finding the file locations and figuring out what the commands were to start/stop/restart apache and mysql. So I'm going to help you out.
Configuration Files
| /etc/php5/apache2/php.ini | This is the PHP configuration file. |
| /etc/apache2/apache2.conf | This is the default configuration file for Apache. Settings here will be overridden by anything added to the httpd.conf file. More notes on this located below. |
| /etc/mysql/my.cnf | Your mysql server configuration file. |
| /etc/phpmyadmin/config.inc.php | This is your phpmyadmin settings file. Changes here will override the settings already in place, which are stored in your MySQL server database. |
| /etc/phpmyadmin/apache.conf | This file sets the Alias for phpmyadmin and the permissions and etc. for phpmyadmin. |
| /var/www | The default website folder for Apache. |
Commands
You most likely will need to use "root" permissions (sudo) to use these.
| apache2ctl start | This command starts Apache. |
| apache2ctl stop | This command stops Apache. |
| apache2ctl restart | This command restarts Apache. |
| apache2ctl | This will show you a list of other command options. |
| /etc/init.d/mysql start | This starts your MySQL server. |
| /etc/init.d/mysql stop | This stops your MySQL server. |
| /etc/init.d/mysql status | This shows the status of your MySQL server. |
| /etc/init.d/mysql | This will show you a list of other command options. |
Permissions
This can be a major headache in Linux, especially if you don't know how to deal with them. Here's a few commands that will help you out.
chmod - I try to avoid using chmod (change mode) because I don't like to change the permissions on the files for security reasons. I recommend using chown instead.
You can find more information on chmod by going to https://wiki.ubuntu.com/FilePermissions.
chown - I personally prefer this command. It changes the ownership of a file or directory to the user you specify. If you change the ownership to your user, you will have full permissions to the specified file(s) or folder(s) without changing the permission mode making it vulerable. I'll give you an example. Let's say you want to use the folder /var/www to put your website's files in by dragging and dropping files to it. If you try it, you will probably encounter a permissions problem. So we'll pretend your username that you log in with is jack.
sudo chown jack:jack -R /var/www
This line says you want to change ownership (chown) to user jack (jack) group name jack (:jack) and do this for all the files and sub directories in the folder (-R) for the folder www (/var/www). -R stands for recursively. You do not have to specify the group name and if you don't want to change everything recursively, you don't have to.
gedit - Gedit is a text editor, but to edit configuration files with read/write permissions, you can use it in the terminal session. You will need to use the "sudo" command to edit/save files owned by root. Here's an example:
sudo gedit /etc/apache2/apache2.conf
This will open the apache2 configuration file with gedit and allow you to make changes and save it.
Apache's Configuration
This is one thing I don't quite understand about this installation of Linux. You will learn the configuration is spread out in different areas instead of all in one file such as httpd.conf. As a matter of fact, the httpd.conf file is empty and everything by default is set in apache2.conf. However anything added to httpd.conf will override the settings in apache2.conf.
Virtual Hosts
The VirtualHosts are configured seperately instead of in one single vhost file. You can change this if you like. It is set to include any files in the /etc/apache2/sites-enabled/ directory. There should be a file named 000-default which defines the default website localhost located in directory /var/www. If you want ot add a new website, you can create a new file here and name it whatever you like, then put the virtual host settings in it accordingly. If you want to create yet another site, keep repeating this step for each new site. As long as the files are in sites-enabled directory, then they will be included.
Aliases
The aliases are defined in the /etc/apache2/conf.d/ directory. You will see the phpmyadmin alias in here. There are also some other configuration settings defined here as well.
Apache Modules
These are defined in the /etc/apache2/mods-enabled folder. You can paste whichever modules you would like to enable from the mods-available folder to this folder to enable additional modules for Apache.
PHP Extensions
You may need to add or disable PHP extensions. To add them, use your Synaptic Package Manager and locate the extensions you need. This should automatically enable them as well. The extensions are added to your Apache configuration in the /etc/php5/apache2/conf.d/ folder. You can comment them out if you wish to disable a particular extension. Each extension is in it's own text file.
If I left something out, please leave a comment and I will update this guide.
| Comments |
|
|
|
|
|
|
|
|
|
|
|
|
!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."
Last Updated (Friday, 16 April 2010 10:13)






