centos7安装配置lnmp

yum install nginx mariadb-server mariadb php php-mysql php-fpm

systemctl start nginx

systemctl enable nginx

nano /etc/php.ini

cgi.fix_pathinfo=0

nano /etc/php-fpm.d/www.conf

user = nginx

group = nginx

systemctl start php-fpm

systemctl enable php-fpm

nano /etc/nginx/conf.d/default.conf

server {

listen       80;

server_name  localhost;

location / {

root   /opt/www;

index  index.php index.html index.htm;

}

error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   /opt/www;

}

location ~ \.php$ {

root           /opt/www;

fastcgi_pass   127.0.0.1:9000;

fastcgi_index  index.php;

fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

include        fastcgi_params;

}

}

vi nginx.conf

user nginx;

worker_processes auto;

error_log /var/log/nginx/error.log;

pid /run/nginx.pid;

events {

worker_connections 1024;

}

http {

log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘

‘$status $body_bytes_sent "$http_referer" ‘

‘"$http_user_agent" "$http_x_forwarded_for"‘;

access_log  /var/log/nginx/access.log  main;

sendfile            on;

tcp_nopush          on;

tcp_nodelay         on;

keepalive_timeout   65;

types_hash_max_size 2048;

include             /etc/nginx/mime.types;

default_type        application/octet-stream;

include /etc/nginx/conf.d/*.conf;

}

systemctl restart nginx

systemctl start mariadb

mysql_secure_installation

systemctl enable mariadb.service

时间: 2024-10-25 05:54:50

centos7安装配置lnmp的相关文章

Centos7 安装配置OpenLdap服务及OpenLdap管理工具

我们上一篇文章中介绍了,Centos7+Openvpn使用Windows AD(LDAP)验证登录的配置介绍.说到LDAP服务,我们知道不止windows有,linux下也有,比如openldap,sambaLDAP服务,具体就不多介绍了,我们今天主要介绍一下Centos7 安装配置OpenLdap及Ldap管理工具等操作,为后面的Centos7+Openvpn+openldap验证登录做好基础. 我们首先配置一个指定源,我们源地址指向了阿里云的仓库源 cd /etc/yum.repos.d v

CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL)

CentOS 6.5安装配置LNMP服务器(Nginx+PHP+MySQL) 一.准备篇: 1 /etc/init.d/iptables stop #关闭防火墙 2 关闭SELINUX 3 vi /etc/selinux/config 4 #SELINUX=enforcing #注释掉 5 #SELINUXTYPE=targeted #注释掉 6 SELINUX=disabled #增加 7 :wq 8 shutdown -r now #重启系统 二.安装篇 1.安装nginx 1 yum re

Centos7安装配置Apache+PHP+Mysql+phpmyadmin

转载自: Centos7安装配置Apache+PHP+Mysql+phpmyadmin 一.安装Apache yum install httpd 安装成功后,Apache操作命令: systemctl start httpd //启动apache systemctl stop httpd //停止apache systemctl restart httpd //重启apache systemctl enable httpd //设置apache开机启动 异常处理我再阿里云上配置并出现启动Apac

CentOS 6.4安装配置LNMP服务器(Nginx+PHP+MySQL)

准备篇 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 ACCEPT #允许3306端口通过防火墙 备注:很多网友把这两条规则添加到防火墙配置的最后一行,导致防火墙启动失败, 正确

CentOS7安装配置redis-3.0.0

清园 沉没的Atlantis CentOS7安装配置redis-3.0.0 一.安装必要包 yum install gcc 二.linux下安装 #下载 wget http://download.redis.io/releases/redis-3.0.0.tar.gz tar zxvf redis-3.0.0.tar.gz cd redis-3.0.0 #如果不加参数,linux下会报错 make MALLOC=libc  安装好之后,启动文件 #启动redis src/redis-server

CentOS 6.5 yum安装配置lnmp服务器(Nginx+PHP+MySQL)

以下全部转载于  http://blog.csdn.net/lane_l/article/details/20235909 本人于今晚按照该文章使用centos 6.7 64bit安装成功,做个备份,就转过来了. --------------------------------------------------------------- 转载者语: 转载于:http://www.osyunwei.com/archives/2353.html 原文标题:CentOS 6.2yum安装配置lnmp

Centos7安装配置gitlab

Centos7安装配置gitlab 这篇文字我会介绍在Centos7上安装gitlab,配置gitlab的smtp,并且创建项目demo. sudo yum install openssh-server sudo yum install postfix sudo yum install cronie sudo service postfix start sudo chkconfig postfix on sudo lokkit -s http -s ssh 使用清华大学gitlab的镜像http

CentOS 6.4 安装配置LNMP服务器(Nginx+PHP+MySQL) 及搭建Wordpress

准备:1.配置防火墙,开启80端口.3306端口 # Firewall configuration written by system-config-firewall # Manual customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A INPUT -m state –state ESTABLISHED,RE

CentOS7安装配置DNS服务器

准备工作(假设名称为bigcloud.local) #更改主机名称 #vi /etc/sysconfig/network # Created by anaconda NETWORKING=yes HOSTNAME=bigcloud.local #修改文件/etc/hosts,内容如下: 127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1         localhost local