LAMP là sự kết hợp giữa hệ điều hành Linux và phần mềm mã nguồn mở. LAMP được viết tắt của Linux , Apache , Mysql và PHP. Sau đây VNTINEWS sẽ hướng dẫn các bạn cách cài đặt gói phần mềm này
Làm thế nào cài đặt LAMP trên CENTOS 6.X
BƯỚC 1 : Cài APACHE
Tiến hành tải httpd :
#yum install httpd –y
Khởi động apache , chkconfig apache :
#service httpd start
#chkconfig httpd on
Mở port 80 trên iptables cho phép truy cập web :
#vi /etc/sysconfig/iptablesThêm dòng sau :
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT
Reset iptables :
Lúc này, tiến hành test dịch vụ bằng cách truy cập địa chỉ IP của máy chủ
Bước 2 : Cài MYSQL
Tiến hành tải mysql , mysql-server :
#yum install mysql mysql-server –y
Khởi động mysql , chkconfig mysql :
#service mysqld start
#chkconfig mysqld on
Thiết lập mật khẩu root cho mysql :
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none): ENTER
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.
Set root password? [Y/n] Y Chọn Y
New password: Nhập Pass
Re-enter new password: Nhập lại Pass
Password updated successfully!
Reloading privilege tables..
… Success!
Lúc này , bạn cứ việc Enter nốt là được
Bước 3 : Cài PHP
Tiến hành tải PHP :
Test PHP vừa mới cài đặt :
#echo -e ‘<?php \nphpinfo(); \n?>’ > /var/www/html/testphp.php
#service httpd restart
Truy cập web bằng đường dẫn : http://IP_ADDRESS/testphp.php
Bước 4 : Cài phpMyAdmin
Tiến hành cài Repo
32bit :
#wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm
64bit :
#wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
#rpm -ivh epel-release-6-8.noarch.rpm
Tiến hành tải phpMyAdmin
Sửa file phpMyAdmin.conf
#vi /etc/httpd/conf.d/phpMyAdmin.conf
Khởi động lại httpd :
#service httpd restart
Lúc này tiến hành truy cập : http://IP_ADDRESS/phpmyadmin
Username : root
Password : Pass đã đặt ở Bước 2 : Cài Mysql
Vậy là quá trình cài đặt đã xong.
>> Advanced SystemCare Ultimate 13 miễn phí license bản quyền
>> Iobit Driver Booster Pro 7 miễn phí license bản quyền
[Giveaway] BeeCut Video Editor – miễn phí license 1 năm
"Easy Video Editing Software to Make Your Story Come Alive", với BeeCut Video Editor việc chỉnh sửa video chưa bao giờ dễ như vậy. >> […]