lnmp搭建
一,安装php
1,列出php php-fpm是否存在
yum list php php-fpm
2,安装
yum -y install php php-fpm
3,启动php-fpm:
/etc/init.d/php-fpm start
service php-fpm start
二,安装ngnix
yum list nginx
yum -y install ngnix
service nginx start #启动nginx进程方法[1]
/etc/init.d/nginx start #启动nginx进程方法[2]
ps -ef | grep nginx #查看nginx进程
修改nginx配置文件,如下
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#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 logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index 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 html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root /usr/share/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /usr/share/nginx/html$fastcgi_script_name; #$script需改为/usr/share/nginx/html
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
# }
}
三,安装mysql(cetos7以上安装mariadb)
yum install mysql
yum install mysql-service -y
service mysqld start
mysql 进入数据库
设置mysql允许远程访问
在mysql数据库的user表中添加以下数据
INSERT INTO `user` ( `Host` , `User` , `Password` , `Select_priv` , `Insert_priv` , `Update_priv` , `Delete_priv` , `Create_priv` , `Drop_priv` , `Reload_priv` , `Shutdown_priv` , `Process_priv` , `File_priv` , `Grant_priv` , `References_priv` , `Index_priv` , `Alter_priv` , `Show_db_priv` , `Super_priv` , `Create_tmp_table_priv` , `Lock_tables_priv` , `Execute_priv` , `Repl_slave_priv` , `Repl_client_priv` , `ssl_type` , `ssl_cipher` , `x509_issuer` , `x509_subject` , `max_questions` , `max_updates` , `max_connections` ) VALUES ('%', 'root', PASSWORD( 'myadmin' ) , 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', '', '', '', '', '0', '0', '0');
刷新权限
flush privileges;
yum -y install php-mysql #安装php-mysql 扩展
service php-fpm restart #重启php-fpm进程
lnmp搭建的更多相关文章
- 搭建LNMP;搭建WIKI
#!/bin/bash#lnmp搭建#搭建WIKI 1.系统检测,系统环境优化 搭建版本: nginx-1.8.1.tar.gzmysql-5.5.32-linux2.6-x86_64.tar.gzl ...
- centos 桥接配置 设置网络代理 lnmp搭建
一.桥接配置 centos设置 编辑->虚拟网络编辑器->桥接模式->还原默认设置 虚拟机->设置->网络适配器->桥接 cd /etc/sysconfig/ne ...
- linux lnmp搭建及解释
lnmp的搭建linux nginx mysql(mariaDB) php 安装mysql依赖:yum -y install cmake(cmake编译工具)yum -y install gcc gc ...
- lnmp 搭建 svn服务
服务器环境 lnmp 环境搭建地址:https://lnmp.org/install.html 注意事项 服务器必须开放3690端口 安装过程 1.yum install subversion(安 ...
- LNMP搭建 源码包
LNMP源码包搭建 linux CentOS-6.5-x86_64-bin-DVD1 nginx 版本1.8.0 下载地址:http://nginx.org/en/download.htm ...
- linux,centOS,用LNMP搭建wordpress,更新固定连接--全流程
下午到晚上的时间,买了个linux服务器,用的centOS系统,遇到各种问题! 1.用putty,ssh到vps后,根据网上命令,一步步下载并安装,具体步骤可以看一下网上教程,LNMP.org站上的教 ...
- CentOS 7.4 基于LNMP搭建wordpress
之前有好多次搭建wordpress的经历,有在Ubuntu系统上,有在CentOS7.2系统上,但都是搭完还是稀里糊涂的,因为好多都是教程上照着敲的.这次好好出个教程,以便以后方便查看. 准备工作:C ...
- Lnmp搭建zabbix运维监控系统
使用目的? 在公司项目中需要做一个日志监控,最开始选择的是efk,但是efk的资料相对较少并且之前对这几个产品都没接触过,使用起来难度.于是选择了zabbix作为项目的运维监控系统. zabbix能做 ...
- lnmp搭建-手动版
参照链接:http://blog.csdn.net/bravemelon/article/details/64925499 centOS 下安装 Nginx yum -y groupinstall & ...
- 基于centos的lnmp搭建
部署lnmp环境 安装配置mariadb配置php配置phpmyadmin配置php-fpm配置nginx配置测试 LNMP(linux,nginx,mariadb,php)部署,以下默认在root权 ...
随机推荐
- JavaScript自学之数组排序
<html> <head> <title>数组排序</title> <script type="text/javascript" ...
- win7+vs2008+windows mobile6.5.3
1.安装vs2008+vs2008sp12.安装Windows Mobile 6 Professional SDK Refresh.msi3.安装Windows Mobile 6 Profession ...
- vi(Visual Editor)常用的命令
任何用户最常做的事要数创建和编辑文件,包括文档.报告和文字,vi(Visual Editor)是一个有效而相对简单的全荧幕编辑,使用vi,只要记著少量基本指令,就可以开始起步,再学习其他更复 杂的指令 ...
- WordPress多站点获取当前博客信息
http://www.utubon.com/1495/wordpress-multisite-get-current-bolg-info global $current_blog; 它的返回结果是: ...
- 【待整理】MongoDB 数据集
MongoDB复制集原理 https://yq.aliyun.com/articles/64?spm=5176.100239.blogcont14692.15.XzCCrj MongoDB管理:如何优 ...
- 制作自己的嵌入式Linux电脑_转
制作自己的嵌入式Linux电脑 http://os.51cto.com/art/201409/450334.htm 原文链接:http://blog.jobbole.com/75414/ 包含器件选择 ...
- mybatis比较数字或者单字母
http://blog.csdn.net/alibert/article/details/50177017 <if test="req.queryType == '3'.toStrin ...
- IOS开发UISearchBar失去第一响应者身份后,取消按钮不执行点击事件的问题
在iOS开发中,使用UISearchBar的时候,当搜索框失去焦点的时候,取消按钮是默认不能点击的,如图按钮的颜色是灰色的: 这是因为此时取消按钮的enabled属性被设置为NO了,那么当我们需要让 ...
- app推送中的通知和消息区别
最近在做mqtt及其他消息推送的功能,推送服务挺多的,小米推,极光推,华为推,个推等,当然还有苹果的apns.感觉都差不多,尝试了apns,小米推和个推,各个厂家都提供的有sdk,demo. 关于通知 ...
- 【003:jsoncpp的简单使用】
#include <json/json.h> #include <iostream> #include <string> using namespace std; ...