Ovim tutorijalom ćemo pokazati kako možete instalirati LAMP i phpMyAdmin na CentOS 5.11 i CentOS 6.7, 32 i 64 Bit verzija.
Najpre ćemo ažurirati server:
1 |
yum update -y |
Instalirajte EPEL repozitorijum za vašu verziju Linux sistema.
Ako koristite CentOS 5:
1 |
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-5.noarch.rpm && rpm -Uvh epel-release-latest-5.noarch.rpm |
Ako koristite CentOS 6:
1 |
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm |
Sada ćemo instalirati Apache, MySQL, PHP and phpMyAdmin:
1 |
yum install httpd mysql mysql-server php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml phpmyadmin -y |
Izmenite /etc/httpd/conf.d/phpMyAdmin.conf fajl. Upotrebite # i komentarišite sve linije u <Directory „/usr/share/phpMyAdmin/“> … </Directory> sekciji:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#<Directory /usr/share/phpMyAdmin/> # <IfModule mod_authz_core.c> # # Apache 2.4 # <RequireAny> # Require ip 127.0.0.1 # Require ip ::1 # </RequireAny> # </IfModule> # <IfModule !mod_authz_core.c> # # Apache 2.2 # Order Deny,Allow # Deny from All # Allow from 127.0.0.1 # Allow from ::1 # </IfModule> #</Directory> |
Izmenite /usr/share/phpmyadmin/config.inc.php fajl i zamenite ‘cookie’ sa ‘http’:
1 |
$cfg['Servers'][$i]['auth_type'] = 'http'; |
Restartujte Apache i MySQL servise:
1 2 |
service httpd start service mysqld start |
Unapredite bezbednost MySQL instalacije:
1 |
mysql_secure_installation |
I pratite sledeće korake:
1 2 3 4 5 6 7 8 |
Enter current password for root (enter for none): # pritisnite Enter Set root password? [Y/n] # pritisnite Enter New password: # Ukucajte lozinku Re-enter new password: # Potvrdite lozinku Remove anonymous users? [Y/n] # pritisnite Enter Disallow root login remotely? [Y/n] # pritisnite Enter Remove test database and access to it? [Y/n] # pritisnite Enter Reload privilege tables now? [Y/n] # pritisnite Enter |
Ukucajte sledeće komande kako bi postavili da se Apache i MySQL pokrene posle svakog restarta:
1 2 |
chkconfig httpd on chkconfig mysqld on |
Sada možete pristupiti phpMyAdmin-u tako što će te u browseru ukucati sledeću adresu: http://serverIP/phpmyadmin (zamenite serverIP sa IP adresom servera).