centos7之yum安装lnmp

安装LNMP之前要安装EPEL,以便安装源以外的软件,如Nginx,phpMyAdmin等

yum install epel-release -y

安装nginx

yum install nginx -y
systemctl start nginx
systemctl enable nginx

安装php

yum install -y php php-devel php-fpm php-mysql php-common php-devel php-gd libjpeg* php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-mcrypt php-bcmath php-mhash libmcrypt libmcrypt-devel
systemctl start php-fpm
systemctl enable php-fpm

安装mysql

这里不介绍了,可以参考我的源码安装,或者yum安装在“系统监控”的zabbix教程里面有

添加nginx配置

[[email protected] ~]# cat /etc/nginx/conf.d/default.conf
server {
    listen       80;
    server_name  10.0.40.245;

    root   /usr/share/nginx/html;

        location / {
            root   /usr/share/nginx/html;
            index index.php index.html index.htm;
        }

    error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    location ~ \.php$ {
        root           /usr/share/nginx/html;
        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;
    }

}

重启nginx即可

测试php是否正常运行

[[email protected] ~]# cat /usr/share/nginx/html/index.php
<?php

// Show all information, defaults to INFO_ALL
phpinfo();

// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);

?>

php官方文档

web访问index.php

10.0.40.245/index.php

原文地址:http://blog.51cto.com/yanconggod/2089950

时间: 2024-08-01 05:13:19

centos7之yum安装lnmp的相关文章

阿里云Centos7使用yum安装MySQL5.6.24的正确姿势

阿里云Centos7使用yum安装MySQL5.6.24 阿里云Centos7使用yum安装MySQL5.6.24 前言:由于某些不可抗力,我要在自己的阿里云服务器上搭建hadoop+hive+mysql+tomcat环境,下为mysql的安装记录 →_→大家都知道,centos自带的repo是不会自动更新每个软件的最新版本,所以无法通过yum方式安装MySQL的高级版本.所以,即使我使劲用yum -y install mysql mysql-server mysql-devel,也是没有人会鸟

centos 6.5 yum安装lnmp

转自:http://blog.csdn.net/lane_l/article/details/20235909 准备篇: 1.配置防火墙,开启80端口.3306端口vi /etc/sysconfig/iptables-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT(允许80端口通过防火墙)-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEP

使用yum安装LNMP步骤

使用yum安装LNMP步骤 输入命令cat /etc/redhat-release,查看当前Linux系统版本# cat /etc/redhat-release CentOS release 6.5 (Final)关闭防火墙自启动 # /etc/init.d/iptables stop# chkconfig iptables off 在部署LNMP环境之前,首先,用户需要安装Nignx服务器,MySQL数据库,以及PHP环境相关的开发包和库文件,若缺少开发包或库文件,会导致后续LNMP环境部署失

centos7通过yum安装nginx

centos7通过yum安装nginx nginx不支持centos7通过yum直接安装~~~ 1.查看操作系统位数[[email protected] ~]# rpm -aq|grep centos-releasecentos-release-7-4.1708.el7.centos.x86_64/ 2.创建nginx的yum源[[email protected] ~]# cat  /etc/yum.repos.d/nginx.repo[nginx]name=nginx repobaseurl=

centos7.0 yum 安装php服务器

https://blog.csdn.net/jiaoshenmo/article/details/50923900 首先收一下:centos7.0用yum直接安装apache.php他们的默认版本是apache2.4和php5.4 1.安装之前先检查一下系统是否有默认安装的apache或者php rpm -qa | grep httpd rpm -qa | frep php 2.把上面指令列出来的包删除 rpm -e * * * *(包名) 3.在安装前 ,更新一下系统 yum update 4

Centos7下yum安装mongodb

https://www.cnblogs.com/flying1819/articles/9035408.html Centos7下yum安装mongodb 简介 MongoDB 是一个基于分布式 文件存储的NoSQL数据库 由C++语言编写,运行稳定,性能高 旨在为 WEB 应用提供可扩展的高性能数据存储解决方案 查看官方网站 MongoDB特点 模式自由 :可以把不同结构的文档存储在同一个数据库里 面向集合的存储:适合存储 JSON风格文件的形式 完整的索引支持:对任何属性可索引 复制和高可用

CentOS7下yum安装mysql5.6

由于CentOS7默认的数据库yum源切换成了MariaDB,需要手动设置yum源才可安装mysql. 1.安装yum源 # rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rpm 2.检测可用的yum源 # yum repolist enabled | grep "mysql.*-community.*" mysql-connectors-community/x86_64 MySQL Con

centos7用yum安装nginx

安装好centos7后,将centos开通上网权限 1.将nginx加入yum # rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 2.yum安装Nginx 3.启动 配置文件和html目录

centos7中yum安装ntfs3g

CentOS默认源里没有ntfs3g,想要添加ntfs支持,无非是自己下载编译安装或者加源yum安装. 昨天重新安装了一个CentOS7,用的是添加aliyun的epel源来yum安装的方式,简单易行. 1.加源wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 2.安装# yum update;yum install ntfs-3g如果系统提示:没有可用软件包,可以输入# yum insta