Nginx && PHP 搭建配置管理

来源:互联网 发布:黄金白银行情软件 编辑:程序博客网 时间:2024/06/02 03:00
centos 7mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 备份源镜像wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 拉取新源文件 yum install 安装程序nginxsudo rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 添加源sudo yum install -y nginx 安装sudo systemctl start nginx.service 启动sudo systemctl enable nginx.service 开机启动 sudo systemctl list-dependencies | grep nginx 检查开机自动是否设置成功sudo systemctl disable nginx.service 取消开机启动 sudo systemctl status nginx.service 查看当前服务/usr/share/nginx/html 初使根目录/etc/nginx/nginx.conf 配置文件/etc/nginx/conf.d/ 配置文件目录nginx -c nginx.conf 启动指定配置文件ps ax|grep nginx 查看进程cat /proc/cpuinfo 查看 cpu核数,用于nginx配置  systemctl restart nginx.service systemctl status nginx.servicephprpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpmyum repolist enabled | grep "webtatic*" 检查源是否安装成功安装php71和对应的扩展(上面工具和原料的地址对扩展都有详细的说明)yum -y install php71w php71w-fpmyum -y install php71w-mbstring php71w-common php71w-gd php71w-mcryptyum -y install php71w-mysql php71w-xml php71w-cli php71w-develyum -y install php71w-pecl-memcached php71w-pecl-redis php71w-opcachephp -v 验证php是否安装成功php -m 验证对应的扩展是否安装成功service php-fpm start 启动ps -ef | grep php-fpm 查看进程service php-fpm status  检查启动是否成功systemctl enable php-fpm.service 设置开机自启动systemctl list-dependencies | grep php-fpm 检查开机自启动是否设置成功
原创粉丝点击