Saturday, October 4, 2008

Installing LAMP on Ubuntu

Installing LAMP. If you want to use apt-get install the LAMP layer,

$ sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

Or you can use one taskseltry command:

$ sudo tasksel install lamp-server

Configuring MySQL. Set password for MySQL. tasksel will ask you for root password during installation.

$ mysql -u root mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('lamepassword');

Creating database and user

mysql> CREATE DATABASE lamedatabase; mysql> GRANT ALL PRIVILEGES ON lamedatabase.* TO 'lameuser'@'localhost' IDENTIFIED BY 'anotherlamepassword'; mysql> FLUSH PRIVILEGES;

Configuring Apache. If you get following error when you start apache2 server,

apache2: Could not determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName

you need to add ServerName localhost in apache2 configuration file.

No comments: