Ubuntu 7.04 : Apache-PHP-MySQL Server

Submitted by str on Sun, 06/10/2007 - 12:13

Here are the packages you need to install to make your Ubuntu 7.04 as webserver with PHP and MySQL support.

Install Apache:
sudo apt-get install apache2
Install PHP5:
sudo apt-get install php5-common php5 libapache2-mod-php5
Install MySQL:
sudo apt-get install mysql-server mysql-client
To use MySQL with PHP:
sudo apt-get install php5-mysql

Related Items

Comments

Mohd. Ansi (not verified)

Sun, 06/10/2007 - 15:44

How to test if PHP is working?
Thanks. Nice and informative site.

str

Sun, 06/10/2007 - 16:42

In reply to by Mohd. Ansi (not verified)

The best place for you to start is here.

Martin (not verified)

Fri, 07/27/2007 - 10:47

In reply to by str

Hi!

I'm kinda new at using linux and stuff, and I just installed apache php-MySql with your tutorial... (Thanks for that!). Now, where do I put the *.php files to see, if this thing works?

Anonymous (not verified)

Thu, 08/09/2007 - 10:30

In reply to by str

For some reason I am unable to put any files in my /var/www directory, even after doing
sudo chmod 777 /var/www
any ideas?

You might not be running as root and root is most likely owner - which disallows you the right to change permissions. execute the following
cd /var
su
"enter password for root"
chown -R john www or /www
now maybe after successful
chmod -R 775 www or /www
A little info:
chown allows for changing the owner - you must be root to change the ownership if root is the owner :)
chmod 775 does this U+G+O User+Group+Others 7 = read write execute 5 = read and execute
change john to YOUR username (the one you log in as)
-R tells the commands to make the internal files of the directory "owned" by John as well.
read =1 write=2 execute=4 for a total of 7 for all permissions granted to UGO would be 777 (NOT recommended)
Hope this helps

Conrad

I'm new to all this (ie. Linux :"] ), and when I tried switching to root via 'su' it wouldn't accept my pasword.

So instead I put 'sudo' in front of the 'chown' command. This will prompt you for your password before it runs the command (you have to 'sudo' every time you want to run as root).

Hopefully this will help fellow Linux n00bs like me :D

Back to the point of my post, why can't I use 'su'?

I was on Ubuntu 6.06 - I've updated to 7.10 and it works fine.

Hit Alt+F2 and enter "gksudo nautilus" (obviously don't type the quotes) - this opens the file browser as root

Navigate to /var/ and right-click on the www directory. Choose Properties > Permissions.

Click the box next to 'Group' to bring up the list of users, and select the user you usually log in as.

Then change 'Folder Access' to 'Create and delete files'.

You should then have full access to the www directory from a regular file browser window as well as from applications such as your PHP editor.

Before I forget -- thanks str for the tutorial on setting up PHP! Just what I wanted - the facts and no fluff :)

You might not be running as root and root is most likely owner - which disallows you the right to change permissions. execute the following
cd /var
su
"enter password for root"
chown -R john www or /www
now maybe after successful
chmod -R 775 www or /www
A little info:
chown allows for changing the owner - you must be root to change the ownership if root is the owner :)
chmod 775 does this U+G+O User+Group+Others 7 = read write execute 5 = read and execute
change john to YOUR username (the one you log in as)
-R tells the commands to make the internal files of the directory "owned" by John as well.
read =1 write=2 execute=4 for a total of 7 for all permissions granted to UGO would be 777 (NOT recommended)
Hope this helps

Conrad