Cài đặt Centos 6, nginx, php 5.3, mariadb 10.3, yum update

Để chạy đc YUM, thay đổi file /etc/yum.repos.d/CentOS-Base.repo

  1. [base]
  2. name=CentOS-$releasever - Base
  3. # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
  4. # baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
  5. baseurl=https://vault.centos.org/6.10/os/$basearch/
  6. gpgcheck=1
  7. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  8.  
  9. # released updates
  10. [updates]
  11. name=CentOS-$releasever - Updates
  12. # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
  13. # baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
  14. baseurl=https://vault.centos.org/6.10/updates/$basearch/
  15. gpgcheck=1
  16. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
  17.  
  18. # additional packages that may be useful
  19. [extras]
  20. name=CentOS-$releasever - Extras
  21. # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
  22. # baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
  23. baseurl=https://vault.centos.org/6.10/extras/$basearch/
  24. gpgcheck=1
  25. gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

Chạy Command line

  1. 1 yum clean all
  2. 2 yum update
  3. 3 cat /etc/centos-release
  4. 4 yum install php-5.2.17
  5. 5 yum install php-5.2
  6. 6 yum install php-52
  7. 7 yum install php-5.3.3-14
  8. 8 yum install php
  9. 9 yum install php52
  10. 10 yum install php5.2
  11. 11 yum install php
  12. 12 # yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
  13. 13 yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
  14. 14 yum install php-fpm
  15. 15 yum install nginx
  16. 16 cd /tmp
  17. 17 wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
  18. 18 yum install wget
  19. 19 wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
  20. 20 rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
  21. 21 yum install nginx
  22. 22 nginx -v
  23. 23 service nginx start
  24. 24 firewall-cmd --zone=public --add-port=80/tcp --permanent
  25. 25 service
  26. 26 service firewalld status
  27. 27 service iptable status
  28. 28 service iptables status
  29. 29 setenforce 0
  30. 30 service iptable status
  31. 31 service nginx statú
  32. 32 service nginx status
  33. 33 iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
  34. 34 iptables-save > /etc/sysconfig/iptables
  35. 35 ngĩn -t
  36. 36 nginx -t
  37. 37 service nginx restart
  38. 38 ip a
  39. 39 service nginx restart
  40. 40 service php-fpm start
  41. 41 wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
  42. 42 chmod +x mariadb_repo_setup
  43. 43 sudo ./mariadb_repo_setup
  44. 44 yum install mariadb-server
  45. 45 cat <<EOF >> /etc/yum.repos.d/mariadb.repo
  46. [mariadb]
  47. name = MariaDB
  48. baseurl = http://yum.mariadb.org/10.3/centos6-amd64
  49. gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  50. gpgcheck=1
  51. EOF
  52.  
  53. 46 yum install mariadb-server
  54. 47 yum install mariadbcat <<EOF >> /etc/yum.repos.d/mariadb.repo-server
  55. [mariadb]
  56. name = MariaDB
  57. baseurl = http://yum.mariadb.org/10.3/centos6-amd64
  58. gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  59. gpgcheck=1
  60.  
  61. 48 yum install MariaDB-server
  62. 49 service mysql start
  63. 50 mysql_secure_installation

 

One Comment

Leave a Reply

You must be logged in to post a comment.