Install Nginx, MySQL, PHP On Oracle Linux 7.3Install NginxAdd Nginx Repo to Repo filestouch /etc/yum
Install Nginx, MySQL, PHP On Oracle Linux 7.3
Install Nginx
Add Nginx Repo to Repo files
touch /etc/yum.repos.d/nginx.repo
[nginx] name=nginx repo baseurl=http://nginx.org/packages/rhel/7/$basearch/ gpgcheck=0 enabled=1
更新 Repo
yum update
Install Nginx
yum install nginx
设定开机启动:
sudo systemctl enable nginx
Install MySQL Server 5.7
MySQL must be installed from the community repository.
Download and add the repository, then update.
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.
sudo yum install mysql-server
设定开机启动:
sudo systemctl start mysqld
安装完找到临时密码:
sudo grep 'temporary password' /var/log/mysqld.log
设定新密码: (PS. 新版本修改密码也是用这个了, update mysql.user set password=xxx 已不起作用)
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)