Monday 23 January 2012

Configure LAMP server (Linux + Apache + MySQL + PHP/Perl) on Linux

Configure LAMP server (Linux + Apache + MySQL + PHP/Perl) on Linux

1) Install Apache
# yum install httpd httpd­devel

start the apache service
# /etc/init.d/httpd start


2) Install MySQL Database Server

# yum install mysql mysql­server mysql­devel
# /etc/init.d/mysqld start
# mysql

Changing MySQL Root Password

# mysql> USE mysql;
# mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
# mysql> FLUSH PRIVILEGES;

Once done, check by logging in:

# mysql ­u root ­p
Enter Password:

To Create A New MySQL User

# mysql > create database demo
# mysql >GRANT ALL PRIVILEGES ON demo.* TO 'guest'@'localhost' IDENTIFIED BY 'guest'
WITH GRANT OPTION;
# mysql> UPDATE user SET Password=PASSWORD('guest') WHERE user='guest';

3) Install PHP5
# yum install php php­mysql php­common php­gd php­mbstring php­mcrypt php­devel php­xml

Test If PHP Is Working Or Not:
Create a file named /var/www/html/test.php with the following phpinfo() function inside php
quotes.
// test.php
phpinfo();
?>
Then point your browser to http://ip.address/test.php.


4) Install phpMyAdmin
phpMyAdmin is a free web based MySQL database Administration Tool

# yum install phpmyadmin
Point your browser to: http://ip.address/phpmyadmin.

5) Install Webmin
wget
rpm ­ i webmin­1.410­1.noarch.rpm

Point your browser to: http://ip.address:10000

You should see a webmin login. But we don't know the login and password yet! To set up the
webmin password run the script below...

# /usr/libexec/webmin/changepass.pl /etc/webmin admin

Log in with the admin username and new webmin password!
To uninstall webmin, just run:

# /etc/webmin/uninstall.sh

6) Final Steps
We want the Apache and mysql to be loaded at every boot so we switch them on using chkconfig:
# chkconfig httpd on
# chkconfig mysqld on

No comments:

Could not start a new session. Response code 500. Message: Failed to read marionette port

There is bug in firefox binary installed using apt/snap, I faced same issue when I installed firefox from apt package respository. I solved ...