How To Create A LAMP Setup (Apache2, PHP, MySQL) On CentOS 5.x In An Amazon Linux AMI 32bits Or 64bits - Page 2

Want to support HowtoForge? Become a subscriber!
Submitted by retros (Contact Author) (Forums) on Fri, 2011-02-04 16:10. ::

Install MySQL

To install MySQL we need to have an open console and put in the next instructions.

Get  root privileges:

sudo -i

Install MySQL:

yum install mysql mysql-server mysql-libs

Start the service and configure it to start automatically at boot time:

/sbin/service mysqld start

chkconfig --levels 235 mysqld on

Set a MySQL root password:

mysqladmin -u root password 'new-password'


Install Apache And PHP

In the console type:

yum install httpd php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc
/etc/init.d/httpd restart
chkconfig --levels 235 httpd on

Now open a browser and go to:



Install PhpMyAdmin

To install PhpMyAdmin we need a console again; please make sure that you have root privileges!

First we need to enable the RPMforge repository:

On Linux Amazon 32-bit:

rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm

On Linux Amazon 64-bit:

rpm -Uvh rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Then we install PhpMyAdmin:

yum install phpmyadmin

Now we modify the file /etc/httpd/conf.d/phpmyadmin.conf with nano:

nano /etc/httpd/conf.d/phpmyadmin.conf

#  Web application to manage MySQL  
#  #<Directory "/usr/share/phpmyadmin">  
#  Order Deny,Allow  
#  Deny from all  
#  Allow from  
Alias /phpmyadmin /usr/share/phpmyadmin  
Alias /phpMyAdmin /usr/share/phpmyadmin  
Alias /mysqladmin /usr/share/phpmyadmin

Then we change /usr/share/phpmyadmin/ and change the line $cfg['Servers'][$i]['auth_type'] from cookies to http:

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

Then we restart Apache:

/etc/init.d/httpd restart

... and go to PhpMyAdmin in the browser:


And that's all.



Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Mahesh V (not registered) on Mon, 2012-07-02 10:14.
I am not able to see the amazon ami linux test page after installing the apache and php using " yum install httpd php php-mysql php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc

/etc/init.d/httpd restart

chkconfig --levels 235 httpd on"

 Can you please tell me why it's not showing the page ? Is it any problem with the installation ?

Submitted by nei (not registered) on Sat, 2012-04-21 08:12.
Thank you, it helped me!
Submitted by Peter (not registered) on Sun, 2012-01-08 16:44.
So useful, thankyou so much.
Submitted by MadMatt (not registered) on Fri, 2011-05-20 13:57.

Thank you very much for this tutorial, it works perfectly !

 Annirudh is right though, your code box for 32bits and 64bits one are inverted

 Thanks again !

Submitted by Skullnubien (not registered) on Sat, 2011-04-30 20:33.
Great Tutorial.Special Thanks.
Submitted by Aniruddh (not registered) on Wed, 2011-02-09 15:29.


Nice documentation but I think the Linux Amazon 32-bit & Linux Amazon 64-bit RPM links are misplaced.