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
- [base]
- name=CentOS-$releasever - Base
- # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra
- # baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
- baseurl=https://vault.centos.org/6.10/os/$basearch/
- gpgcheck=1
-
- # released updates
- [updates]
- name=CentOS-$releasever - Updates
- # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra
- # baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
- baseurl=https://vault.centos.org/6.10/updates/$basearch/
- gpgcheck=1
-
- # additional packages that may be useful
- [extras]
- name=CentOS-$releasever - Extras
- # mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra
- # baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
- baseurl=https://vault.centos.org/6.10/extras/$basearch/
- gpgcheck=1
Chạy Command line
- 1 yum clean all
- 2 yum update
- 3 cat /etc/centos-release
- 4 yum install php-5.2.17
- 5 yum install php-5.2
- 6 yum install php-52
- 7 yum install php-5.3.3-14
- 8 yum install php
- 9 yum install php52
- 10 yum install php5.2
- 11 yum install php
- 12 # yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo
- 14 yum install php-fpm
- 15 yum install nginx
- 16 cd /tmp
- 17 wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
- 18 yum install wget
- 19 wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
- 20 rpm -ivh nginx-release-centos-6-0.el6.ngx.noarch.rpm
- 21 yum install nginx
- 22 nginx -v
- 23 service nginx start
- 24 firewall-cmd --zone=public --add-port=80/tcp --permanent
- 25 service
- 26 service firewalld status
- 27 service iptable status
- 28 service iptables status
- 29 setenforce 0
- 30 service iptable status
- 31 service nginx statú
- 32 service nginx status
- 33 iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
- 34 iptables-save > /etc/sysconfig/iptables
- 35 ngĩn -t
- 36 nginx -t
- 37 service nginx restart
- 38 ip a
- 39 service nginx restart
- 40 service php-fpm start
- 41 wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
- 42 chmod +x mariadb_repo_setup
- 43 sudo ./mariadb_repo_setup
- 44 yum install mariadb-server
- 45 cat <<EOF >> /etc/yum.repos.d/mariadb.repo
- [mariadb]
- name = MariaDB
- baseurl = http://yum.mariadb.org/10.3/centos6-amd64
- gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
- gpgcheck=1
- EOF
-
- 46 yum install mariadb-server
- 47 yum install mariadbcat <<EOF >> /etc/yum.repos.d/mariadb.repo-server
- [mariadb]
- name = MariaDB
- baseurl = http://yum.mariadb.org/10.3/centos6-amd64
- gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
- gpgcheck=1
-
- 48 yum install MariaDB-server
- 49 service mysql start
- 50 mysql_secure_installation
DucTN -
Chạy ssh git
ssh-keygen -t rsa -b 4096 -C “email@example.com”