Install Nginx 1.10 MySQL 5.7.17 PHP7.1.3 on Oracle Linux 7.3

Install Nginx, MySQL, PHP On Oracle Linux 7.3

Install Nginx

Add Nginx Repo to Repo filesphp

touch /etc/yum.repos.d/nginx.repo
[nginx]
	name=nginx repo
	baseurl=http://nginx.org/packages/rhel/7/$basearch/
	gpgcheck=0
	enabled=1

更新 Repomysql

yum update

Install Nginxnginx

yum install nginx

設定開機啓動:web

sudo systemctl enable nginx

Install MySQL Server 5.7

MySQL must be installed from the community repository.redis

Download and add the repository, then update.sql

wget https://repo.mysql.com/mysql57-community-release-el7-9.noarch.rpm
    sudo rpm -ivh mysql57-community-release-el7-9.noarch.rpm
    yum update

Install MySQL as usual and start the service. During installation, you will be asked if you want to accept the results from the .rpm file’s GPG verification. If no error or mismatch occurs, enter y.php7

sudo yum install mysql-server

設定開機啓動:tcp

sudo systemctl start mysqld

安裝完找到臨時密碼:測試

sudo grep 'temporary password' /var/log/mysqld.log

設定新密碼: (PS. 新版本修改密碼也是用這個了, update mysql.user set password=xxx 已不起做用)url

set password=password('Your@Pwd123')

打開 Firewall 3306 Port

iptables -A INPUT -i eth1 -p tcp -m tcp --dport 3306 -j ACCEPT

讓其它機器能夠連 MySQL

update mysql.user set host = '%' where user='root';
   flush privilieges;

Install Redis

yum install -y redis
    systemctl start redis

測試是否安裝成功

redis-cli

若是出現如下提示表示成功:

127.0.0.1:6379>

加到開機啓動

systemctl enable redis

Install PHP 7.1.3

yum install epel-release
    rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    yum update
yum install php71w-common php71w-pear php71w-pecl-imagick php71w-gd php71w-process php71w-mcrypt php71w-intl php71w-mbstring php71w-recode php71w-tidy php71w-xml php71w-soap php71w-xmlrpc php71w-mysqlnd php71w-pdo php71w-pecl-redis

加到開機啓動

systemctl enable php71-fpm

Ps. Linux Version: Oracle Linux Server release 7.3 (GNU/Linux 4.1.12-61.1.28.el7uek.x86_64)

相關文章
相關標籤/搜索