1. 程式人生 > >centos7之yum安裝lnmp

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);

?>

web訪問index.php

10.0.40.245/index.php

相關推薦

centos7yum安裝lnmp

安裝LNMP之前要安裝EPEL,以便安裝源以外的軟體,如Nginx,phpMyAdmin等yum install epel-release -y安裝nginxyum install nginx -y systemctl start nginx systemctl enable

centos7進行yum安裝lnmp(linux+nginx+php7.1+mysql5.7)

yum的安裝      1.yum update 下載原始碼時前面需要加上 rpm -ivh  yum localinstall http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0

Centos7 yum安裝 Lnmp以及Lamp

更改 重啟nginx XML fas 授權 /etc/ lin navi html中 首先配置防火墻 CentOS 7.0默認使用的是firewall作為防火墻 1.關閉firewall: systemctl stop firewalld.service #停止fir

yum安裝LNMP+zabbix 坑

Language base text list mat connect 3.4 bho ise zabbix-3.0.4mysql-5.7.17libiconv-1.14.tar.gzphp-5.6.30 yum安裝 nginx mysql php yum源 [ng

centos7 yum 安裝lnmp

pos move rpm bsp oca sys ack x86_64 temporary 安裝7.2把7.1改成7.2就行 使用第三方擴展epel源安裝php7.2 #移除舊版php [root@web02 ~]# yum remove php-mysq

centos7yum安裝mysql(轉)

unity 文件 設置密碼 highlight yum oca 網上 get r文件 CentOS 7的yum源中貌似沒有正常安裝mysql時的mysql-sever文件,需要去官網上下載 # wget http://dev.mysql.com/get/mysql-

centos7使用yum安裝elk

elk安裝elk是一個開源的日誌分析系統。由Elasticsearch、Logstash、Kibana三部分組成Elasticsearch:是一個基於Lucene的搜索服務器, 特點就是分布式,開源,實時搜索,穩定快速,安裝使用方便 javaLogstash:將對日誌進行收集,分析並存儲的工具 rubykib

Centos7通過yum安裝Mysql5.7

-i emctl all oot server aio 否則 mysql- use yum安裝mysql (新版本CentOS自帶mariadb而不是mysql,所以要先卸載了,否則會沖突) 查找mariadb rpm -qa | grep mariadb 卸載mariad

CentOS7yum倉庫配置

系統服務 /etc/ ext 圖片 指定 roo vim div linux系統服務 操作系統版本:CentOS Linux release 7.2.1511 (Core) Yum軟件版本:yum-3.4.3-132.el7.centos.0.1.noarch Yum主

centos7下編譯安裝lnmp和nginx代理實驗

ket orm pass glib href status log nal listen 1、先安裝mysql cd /usr/local/src wget http://mirrors.sohu.com/mysql/MySQL-5.6/mysql-5.6.35-linux

Centos7yum安裝mongodb

數據復制 firewalld stop and 查詢優化 配置文件 blank 可用 計劃 簡介 MongoDB 是一個基於分布式 文件存儲的NoSQL數據庫 由C++語言編寫,運行穩定,性能高 旨在為 WEB 應用提供可擴展的高性能數據存儲解決方案 查看

CentOS7yum安裝 MySQL

usr show secure mes named ucc source ror postfix 首先CentOS7 已經不支持mysql,因為收費了你懂得,所以內部集成了mariadb,而安裝mysql的話會和mariadb的文件沖突,所以需要先卸載掉mariadb,以下

centos7使用yum安裝mongodb

centos7使用yum安裝mongod安裝軟件: yum -y install mongodb mongodb-server 2.啟動服務: systemctl start mongod 連接數據庫: mongo 測試: centos7使用yum安裝mongodb

CentOS7yum安裝Kubernetes

ddr roo alt ger mem 5.0 services eight 配置文件 1、節點規劃 節點 IP hostname 硬件 master 192.168.80.136 master 內存2G CPU:2*1 node1 192.168.80.

使用yum安裝LNMP步驟

服務器 version service 擴展包 libpng vim mon jpeg-6b ipv6 使用yum安裝LNMP步驟 輸入命令cat /etc/redhat-release,查看當前Linux系統版本# cat /etc/redhat-release Cent

centos7docker安裝

net開發 調試 net 左右 端口沖突 相關 通過 不能 util 下午四點左右,我準備接觸docker這個技術。之所以接觸它,原因來自tomcat服務器老是掛,也不能說老是掛,一周一次吧,或者不定時,最初出現的問題,分為這麽幾類? 一類,java代碼的問題,某個類導致線

centos7通過yum安裝Openresty

openrestyCentos7安裝Openresty通過yum安裝 在 /etc/yum.repos.d/ 下新建 OpenResty.repo 內容 [openresty]name=Official OpenResty Repositorybaseurl=https://copr-be.cloud.fed

centos7通過yum安裝JDK1.8

好處 list path border color lin CA AR mar 安裝之前先檢查一下系統有沒有自帶open-jdk 命令: rpm -qa |grep java rpm -qa |grep jdk rpm -qa |grep gcj 如果沒有輸入信

Centos7系統yum安裝zabbix3.4詳細步驟

zabbix 監控 第一步:準備工作關閉SELINUX,關閉防火墻。 第二步:先安裝mariadb數據庫(也可用mysql,同一人開發的,一模一樣)1.安裝mariadb#yum install -y mariadb-server mariadb 2.啟動mariadb並設置開機啟動#systemct

centos7yum安裝ntfs-3g

iyu 沒有 .com mount 想要 方式 .repo defaults etc 1,CentOS默認源裏沒有ntfs3g,想要添加ntfs支持,需要自己下載編譯安裝或者加源yum安裝。我這裏使用的是添加aliyun的epel源來yum安裝的方式。 2,添加epel