loading

This is the fastest command line method I use for installing the LAMP stack. I use server1 as a hostname and 192.168.0.100 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...

…Success!”

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

"Remove anonymous users? -

....Success!"

"Disallow root login remotely -

...Success!"

"Remove test database and access to it -

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

'Reload privieldge tables now -

...Success!"

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 http://192.168.0.100 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. http://192.168.0.100/info.php)

Success!

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 http://192.168.0.100/info.php 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 http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

On x86_64 systems:

prompt-> yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm

On i386 systems:

prompt-> yum install http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm

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 127.0.0.1 #

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/config.inc.php

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

Now we restart Apache:

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

Afterwards, you can access phpMyAdmin under http://192.168.0.100/phpmyadmin/:

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.

Step 1:

About This Instructable

1,014views

11favorites

License:

More by BoxOfSugar:Some Simple OS X Command Line Tools For Everyone Install and Configure HADOOP on OsX Using Netinstall OS X 10.9 and Others 
Add instructable to: