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
Add New Search RSS
myphpadmin error
Anthony Y-m-d H:i:s

Code:
*** WARNING: ucf was run from a maintainer script that uses debconf, but
the script did not pass --debconf-ok to ucf. The maintainer
script should be fixed to not stop debconf before calling ucf,
and pass it this parameter. For now, ucf will revert to using
old-style, non-debconf prompting. Ugh!

Please inform the package maintainer about this problem.


i keep getting this error, when installing myphpadmin.

when i go to http://localhost/myphpadmin

i get a 404 page not found :unsure:

try this...
gustavo Y-m-d H:i:s

the error is I try http://localhost/myphpadmin


and the right is. <img src=ide:' title=':side:' class='postemoticon' />

http://localhost/phpmyadmin/
Brian Y-m-d H:i:s

Thanks for this tutorial! It was very helpful and EXACTLY what I needed to
install the big three on my new test server.
gustavo Y-m-d H:i:s

I saw your video when you tried to paste in the terminal with CTRL + V.
that does not work in Terminal, you will need to work
ctrl + shift and then V

I'm trying to have a server in my house your videos are helping me
muito.Obrigado

I want
have a website in Joomla on my server at home.
So a tip ....
you should have a PDF version of the tutorials help MUITO.Videos ALSO ...
gustavo Y-m-d H:i:s

i keep getting this error, when installing myphpadmin.
i get a 404 page not found
when i go to http://localhost/myphpadmin
i get the same error...how fix this?
gustavo Y-m-d H:i:s

what you think about webmin?
I saw this on internet but I never try ,is better then rampache .Rampache is to
small ,I can not do to much on it...
webmin work on ubuntu karmic ?
when i go to http://localhost/myphpadmin
i get a 404 page not found
this show for me on karmic but on jaunty works fine .an you help me?
gustavo Y-m-d H:i:s

sorry for my mistake , I found the error

the error is I try http://localhost/myphpadmin


and the right is.

http://localhost/phpmyadmin/
Thanks
Darrell Feltmate Y-m-d H:i:s

your tutorial was great. I thought I was going to have to reinstall Ibex. Thanks
a lot.
rapache
jim Y-m-d H:i:s

I wasn't able to get the rapache fix to work on Ubuntu 9.1 . The RaApachGtk.py
config is in a different location. The hack works in that it nows prompts for a
password , but still unable to save an edit - it still hangs
rapache
jim Y-m-d H:i:s

rapache is working now with the applied hack in Ubuntu 9.1. Previously, for what
ever reason it was still hanging when saving an edit. I don't know what i did,
it must have been rebooting .
Rapache
jim Y-m-d H:i:s

I needed to change the default password for the root superuser to get rapache to
work in Ubuntu 9.1.The default is no password , which allowed me to logon after
applying the hack, but I was unable to save changes,or stop and restart apache.
Only when, I logged on with the root account and the new password was I able to
save changes in rapache.
Change root password with 'sudo password'
command.
In Ubuntu 9.1 the RapacheGui.py file is at
/usr/share/pyshared/RapacheGtk/RapacheGui.py

Leave feedback
Name:
Your email:
 
Website:
Message Title:
Formatting:
[b] [i] [u] [url] [quote] [code] [img] 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
Enter the text as you see it in the image.

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

Last Updated (Friday, 16 April 2010 10:13)

 

!!REMEMBER: Support Forums!!

I still keep getting requests for support in the comments of posts and unfortunately I cannot give adequate responses due to the fact there's limited space and it just isn't the right place for support.
I therefore am encouraging visitors to PLEASE go to http://forum.myownserver.info for any support related questions. You will NOT receive any spam or anything you don't specifically subscribe to! I'm very meticulous about this myself and if at any time you need help stopping notifications from posts you previously subscribed to, contact me and I will promptly fix the issue.

Thank you for your participation in this!

Open SourceApache HTTP Server ProjectMySQLPHP
Twitter Feed
Make a Donation
This site does not run ads nor does anyone fund it. The owner and author is unemployed and pays for it himself, so if you're feeling generous, please make a donation of any amount to help out. Thank you very much.

Powered by easy paypal donation

Survey
Which is better?
 
Search
User Login



Visitors


Countries

30.1%United States United States
8.4%United Kingdom United Kingdom
7.7%India India
4.7%Australia Australia
4.5%Canada Canada

Visitors

Today: 108
Yesterday: 215
This Week: 724
Last Week: 1232
This Month: 1574
Last Month: 4992
Total: 52743


JoomlaWatch Stats 1.2.9 by Matej Koval