centos 7 yum命令安装 Nginx、PHP 7、MySQL 57 、redis
修改yum源
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
rpm -Uvh http://dev.mysql.com/get/mysql57-community-release-el7-9.noarch.rpm
安装nginx
yum -y install nginx
安装php
yum -y install php70w-devel php70w.x86_64 php70w-pecl-redis php70w-cli.x86_64 php70w-common.x86_64 php70w-gd.x86_64 php70w-ldap.x86_64 php70w-mbstring.x86_64 php70w-mcrypt.x86_64 php70w-pdo.x86_64 php70w-mysqlnd php70w-fpm php70w-opcache
安装mysql
yum -y install mysql-community-server
安装redis
yum -y install redis
修改nginx配置文件
vi etc/nginx/nginx.conf
去掉原有的的
server {
}配置
新建nginx配置文件
vi /etc/nginx/conf.d/user.conf
server {
listen 80;#端口
server_name admin.com www.admin.com; # 域名
root /home/www/web/newomcat/admin; # 网站根目录
index index.php index.html index.htm;#默认的index
# 建议放内网
# allow 192.168.0.0/24;
# deny all;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?$1 last;#去除url中的index.php 不需要可以不写
}
}
location ~ \.php$ {
try_files $uri = 404;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
mysql 配置
vi /etc/my.cnf
在[client] 下面添加
default-character-set=utf8
在 [mysqld] 下面添加
character_set_server=utf8
init_connect='SET NAMES utf8'
collation-server=utf8_general_ci
获取mysql初始密码
grep 'temporary password' /var/log/mysqld.log
修改初始密码
alter user root@localhost identified by 'testTest!'
添加一个可以在外部登陆的mysql用户
grant all privileges on *.* to 创建的用户名 @"%" identified by "密码";
相关的启动命令
systemctl restart php-fpm #启动php
systemctl restart nginx #启动nginx
systemctl restart mysqld #启动mysql
sudo redis-server /etc/redis.conf #启动redis
转载于:https://www.cnblogs.com/xulie/p/8550000.html
centos 7 yum命令安装 Nginx、PHP 7、MySQL 57 、redis相关推荐
- linux安装中文语言命令,Centos使用yum命令安装中文语言包(fonts-chinese.noarch,m17n-db-common-cjk)...
Centos使用yum命令安装中文语言包(fonts-chinese.noarch,m17n-db-common-cjk) 执行以下命令 [root@f5ha.com ~]# yum install ...
- Centos 利用yum源安装 nginx stream模块
环境 CentOS 7.9 (腾讯云服务器) nginx 1.20.1 配置stream参考这里. nginx 动态模块 nginx 1.9.11 开始增加加载动态模块支持,从此不再需要替换nginx ...
- 【转】CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org ***”...
源自:http://www.cnblogs.com/yangbingqi/p/3328610.html 刚安装完CentOS,使用yum命令安装一些常用的软件,使用如下命令:yum grouplist ...
- centos使用yum命令安装报错 File /usr/bin/yum, line 30 except KeyboardInterrupt, e:
原因 centos7使用yum命令安装报错如下: File "/usr/bin/yum", line 30except KeyboardInterrupt, e:^ SyntaxE ...
- CentOS 7 yum源安装Nginx
2019独角兽企业重金招聘Python工程师标准>>> 教程中的步骤需要root用户权限或者sudo 1.添加Nginx Repository yum install epel-re ...
- Centos 利用yum源安装 nginx 1.20.1
环境 CentOS 7.9 (腾讯云服务器) nginx 1.20.1 yum源说明 腾讯云的 CentOS 服务器,用的是腾讯的yum源镜像. 感兴趣的可以去/etc/yum.repos.d中看看. ...
- CentOS使用yum命令安装软件失败,报错“Couldn‘t open file /data/ceph/ceph/repodata/repomd.xml“
问题 CentOS服务器中使用yum install -y sshpass命令安装sshpass失败,显示错误: 解决 /etc/yum.repos.d中查看yum源的配置文件,发现是使用本地的yum ...
- CentOS下用yum命令安装jdk
一.使用yum命令安装 1.查看是否已安装JDK,卸载 [plain] view plain copy [root@192 ~]# yum list installed |grep java [pla ...
- 使用yum命令安装mysql_Linux Centos 下使用yum 命令安装mysql实现步骤
linux centos 下使用yum 命令安装mysql实现步骤 1. 查看服务器中有没有安装过mysql 1. 查看有没有安装包: yum list mysql* #移除已经安装的mysql yu ...
- CentOS 下使用yum 命令安装MySQL
CentOS Linux下使用yum 命令安装MySQL过程记录. 1. 查看服务器中有没有安装过MySQL 1. 查看有没有安装包: yum list mysql* #移除已经安装的 ...
最新文章
- 如何完全卸载VS2010
- STL源代码分析(ch2 内存分配)destroy
- 东京奥运会的官网的最上面是广告栏
- Soa和Wcf(转)
- django08: 视图与路由(旧笔记)
- html js倒计时不准确,js倒计时代码:第2个倒计时为什么会不正常?
- Java中上转型对象数组
- 服务器延迟和时间偏移怎么设置,服务器时间经常不对如何处理
- matlab simulink光伏发电系统MPPT算法
- 佳能微单R6断电DAT文件MP4视频完美修复不卡顿
- 清明时节雨纷纷路-清明节习俗、诗词欣赏
- 打造可用的梅花6硬键盘
- 程序员必备狂拽炫酷吊炸天的动效神器
- 【春秋云境】CVE-2015-1427靶场wp
- DELPHI的BPL使用
- 怎么看C盘里隐藏的文件
- Easy Save 3
- bat 命令返回结果_初探PowerShell命令入门级
- 三极管非门电路原理(反相器)
- 爱奇艺龚宇:从开源节流到冷静增长,将适当加大内容和市场投入