PDA

View Full Version : Basic LAMP install tutorial + Webmin - any CentOS version



Fli
04-11-2014, 11:17 AM
Quick & basic tutorial on how to install LAMP (Apache, PHP, MySQL, PHPMyAdmin) and optionally Webmin control panel on any CentOS in just ~6 commands

Date: April 2014

Hi, this tutorial should work good on any CentOS version (including "minimal" which i used). But ofcourse follow any instruction provided on your own risk.

1. CHECK NETWORKING:

Login your server via SSH, Does server connect into the internet?


ping google.com -c 3

If it succeeded you can continue step 2.. If it fails, check


vi /etc/resolv.conf

and add google public nameservers:


search google.com
nameserver 8.8.8.8
nameserver 8.8.4.4


("a" - editting mode, Ctrl+C - exit edditing mode; ":wq" - save & quit, ":q" - quit without saving)

save & test ping again or try command "service network restart"

2. INSTALL CENTOS REPOSITORY

Additional repository which includes many usefull packages for future installations.

Go to: http://download.fedoraproject.org/pub/epel/

select your centos version (http://internetlifeforum.com/beginners/1770-linux-os-version-check) (5,6 ..), then 32 or 64 bit and find "epel" file. Example i have CentOS 6.5 64 bit so i used this command:


rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

3. INSTALL APACHE, MYSQL, PHP, PHPMYADMIN


yum install mysql mysql-server mysql-devel httpd php-common php-gd php-mcrypt php-pear php-pecl-memcache php-mysql php-xml php php-mcrypt php-mbstring php-devel gcc pcre-devel curl wget phpmyadmin -y;

IF you want to access PHPMyAdmin directly from http://YourServerIP/phpMyAdmin , then you may need to edit vi /etc/httpd/conf.d/phpmyadmin.conf
and comment out "Deny from All" lines to become "#Deny from All" or add "Allow from YourHomeComputerIP". Then restart apache: service httpd restart

4. CONFIGURE MYSQL:


/usr/bin/mysql_secure_installation

1. 2x Enter
2. write your new mysql root password
3. 4x Enter

5. SET APACHE AND MYSQL TO START AT BOOT AND START THEM


chkconfig httpd on;chkconfig mysqld on;service httpd start;service mysqld start

6. INSTALL (http://www.webmin.com/rpm.html) WEBMIN (http://www.webmin.com/) (OPTIONAL)


wget http://prdownloads.sourceforge.net/webadmin/webmin-1.680-1.noarch.rpm
rpm -U webmin-1.680-1.noarch.rpm

Then You should be able to access webmin thru http://YourServerIP:10000 using login "root" and your server root password.

==========

That is basic AMP setup.