Super Fast LAMP Install on CMD Line Linux

Introduction: Super Fast LAMP Install on CMD Line Linux

This is the fastest command line method I use for installing the LAMP stack. I use server1 as a hostname and for and IP, use what you are using on your machine if you have a static or DHCP.

Login to your installed Linux workstation.

Install MYSQL

prompt-> yum install mysql mysql-server

Create system startup links for MySql

prompt-> chkconfig --levels 235 mysqld on

prompt-> /etc/init.d/mysqld start

Lets setup the passwords for MySql root account.

prompt-> mysql_secure_installation

To login you need the current password for root user, if just installed (we just did it) it will be blank for the account, press enter.

Setting the root password ensures no bad things can happen.

"Set root password -

New password -

Re-enter new password -

Password updated!

Reloading priviledge tables...


By default MySql comes with an anonymous user, lets remove it.

"Remove anonymous users? -


"Disallow root login remotely -


"Remove test database and access to it -

- Dropping test database... ... Success! - Removing privileges on test database... ... Success!"

'Reload privieldge tables now -


All done!

Now lets install Apache2

prompt-> yum install httpd

Set the startup

prompt-> chkconfig --levels 235 https on

and start it

prompt-> /etc/init.d/httpd start

Point your local browser to local IP or whatever you are using.

You should get default installation page, success!

Now lets install PHP5

prompt-> yum install php

Restart apache

prompt-> /etc/init.d/httpd restart

Test php5

prompt-> vi /var/www/html/info.php

phpinfo(); ?>

Save file,

Now we call that file in a browser (e.g.


Now lets install MySql PHP5 Support

prompt-> yum search php

Pick the items you need and install them like this:

prompt-> yum install php-mysql php-gd php-imap php-ldap php-mbstring

php-odbc php-pear php-xml php-xmlrpc

Now lets restart Apache2:

prompt-> /etc/init.d/httpd restart

Now reload in your browser and scroll down

to the modules section again.

You should now find lots of new modules there, including the MySQL module:

phpMyAdmin phpMyAdmin is a web interface through which you can manage your MySQL databases.

First we enable the RPMforge repository on our CentOS system as phpMyAdmin is not available in the official CentOS 6.2 repositories:

Import the RPMforge GPG key:

prompt-> rpm --import

On x86_64 systems:

prompt-> yum install

On i386 systems:

prompt-> yum install

phpMyAdmin can now be installed as follows:

prompt-> yum install phpmyadmin

Now we configure phpMyAdmin. We change the Apache configuration so that phpMyAdmin allows connections not just from localhost (by commenting out the stanza):

prompt-> vi /etc/httpd/conf.d/phpmyadmin.conf

# # Web application to manage MySQL #

# # Order Deny,Allow # Deny from all # Allow from #

Alias /phpmyadmin /usr/share/phpmyadmin Alias /phpMyAdmin /usr/share/phpmyadmin Alias /mysqladmin /usr/share/phpmyadmin

Next we change the authentication in phpMyAdmin from cookie to http:

prompt-> vi /usr/share/phpmyadmin/

[...] /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'http'; [...]

Now we restart Apache:

prompt-> /etc/init.d/httpd restart

Afterwards, you can access phpMyAdmin under

To allow external connections to your machine you will probably have to adjust your firewall and allow external connections to the service.

Now you are ready for any other items like wordpress, cubet board, joomla, or any other mysql php driven softwares.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1:

Be the First to Share


    • LED Strip Speed Challenge

      LED Strip Speed Challenge
    • Sculpting Challenge

      Sculpting Challenge
    • Clocks Contest

      Clocks Contest