Friday, October 16, 2009

Install LAMP on ubuntu

its 1st time use ubuntu = tension

Install LAMP in ubuntu = haih...

I have moved the latest update to here http://asipi.blogspot.com/2011/03/install-lamp-on-ubuntu.html


1

Install apache & mysql & phpmyadmin : here

*Update 23 Jan 2010
My Software source was from Malaysia and it has problem!. So it set my source to "Main Server" (Software source download from Main Server)


2

Enable the www folder
This will make your be able to add new folder into the localhost
using terminal : sudo chmod 777 '/var/www'
Please note that /var/www is your root for the website
/var/www/smellynomore means http://localhost/smellynomore


3

You will realize that u cant open the phpmyadmin on http://localhost/phpmyadmin
This is because when you see inside /var/www there is no "phpmyadmin" folder
I solve the problem by referring here
Solve by doing this in terminal : sudo ln -s '/usr/share/phpmyadmin' '/var/www'


4

Additional configuration for the mysql
When you first time install the mySQL, everything is working fine.
But then, after you reboot the PC, the mySQL server cant start.
The mySQL configuration file will be missing after boot
After some haih...checking, you will realize that file inside "/var/run/mysqld" is missing
I solve by referring here at try to chown to "mysql.mysql" if owned by root, and give it a 755
Its because of the folder write permission

How to chown and chmod, please note that I dont know what happen to security issue when I done this, just want to 'make it work!'
sudo chown -R asipo '/var/run/mysqld'
sudo chmod -R 777 '/var/run/mysqld'



5

Load the mod_rewrite module
I google here to solve...
Using terminal :
1) sudo a2enmod rewrite
2) sudo gedit /etc/apache2/sites-enabled/000-default
3) Change AllowOverride None to AllowOverride All
4) Restart Apache: sudo /etc/init.d/apache2 force-reload


6

Additional

Command to mySQL server (check, start, restart and stop)


Setting up the cakePHP 1.2.5
There will be 2 problem
1. Warning (512): /var/www/cakemake/app/tmp/cache/ is not writable [CORE/cake/libs/cache/file.php, line 262]
2. Your tmp directory is NOT writable.

Solve by : Once again chmod 777 is not secure, yeah!
sudo chown -R asipo '/var/www/smellynomore/app/tmp'
sudo chmod -R 777 '/var/www/smellynomore/app/tmp'



7

Install x-debug
http://ubuntuforums.org/showthread.php?t=525257

EDITED #2 (Feb 2011)
I dont know why lately my xdebug does not working. So I edit the php.ini file
I make the all to be "Deleopment mode" because its defaulted to "Production mode"
So I guess that is the reson, plus use this on ERROR Report
error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE


8

After that, it will read index.html
I dont know how to change it for the thing to refer into index.php

However, this is the index.php code (simple version of mine)

<p><b>Localhost</b></p>
<p>Select folder or file to navigate</p>

<?php

echo "<ul>";
if ($handle = opendir('.')) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            echo "<li><a href='$file'>$file<a></li>";
        }
    }
    closedir($handle);
}
echo "</ul>";
?>

If you have been wandering how I put this code into this blog. This is the place http://asipi.blogspot.com/2011/01/write-blog-post-using-tinymce.html

Thus when you open your http://localhost/index.php will get something like this

Thats all
good luck, kupo!