nginx与mysql安装
yum install -y wget vim gcc-c++ bash-completion
wget http://nginx.org/download/nginx-1.14.0.tar.gz
tar xf nginx-1.14.0.tar.gz -C /root
cd /root/nginx-1.14.0
useradd -s /sbin/nologin nginx
yum -y install gcc pcre-devel openssl-devel
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_ssl_module --with-http_stub_status_module --with-stream --with-http_v2_module --with-http_gzip_static_module --with-http_gunzip_module --with-stream_ssl_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module
BT
--user=nginx --group=nginx --prefix=/www/server/nginx --with-openssl=/www/server/nginx/src/openssl --add-module=/www/server/nginx/src/ngx_devel_kit --add-module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge --add-module=/www/server/nginx/src/nginx-sticky-module --add-module=/www/server/nginx/src/nginx-http-concat --with-http_stub_status_module --with-http_ssl_module --with-http_v2_module --with-http_image_filter_module --with-http_gzip_static_module --with-http_gunzip_module --with-stream --with-stream_ssl_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --with-ld-opt=-ljemalloc
make && make install
pkill httpd
ln -s /usr/local/nginx/sbin/nginx /sbin/
nginx
nginx -s reload
firewall-cmd --zone=public --add-port=80/tcp --permanent
------------------------------------------------------------------
server {
listen 80; //端口
server_name www.b.com; //域名
charset utf-8; //支持所有编码utf-8 万国编码
location / {
root www; //指定网站根路径
index index.html index.htm;
}
}
-----------------------------------------------------------------反向代理
http {
.. ..
upstream webserver { //定义集群 //注意位置 upstream 定义服务器名字 webserver 集群服务器名字
server 192.168.2.100:80; //集群的第一台机
server 192.168.2.200:80; //集群的第二台机
}
.. ..
server {
listen 80; //监听80端口
server_name localhost; //定义域名
location / {
proxy_pass http://webserver; //跳转到webserver
root html; //可有可无
index index.html index.htm; //可有可无
}
}
-----------------------------------------------------------------百度跳转
server {
listen 80;
server_name 88.88.218.1;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass http://www.baidu.com;
root html;
index index.html index.htm;
}
-----------------------------------------------------------------
/usr/local/nginx/conf/proxy.conf
echo `curl http://www.baidu.com` > /usr/local/nginx/html/index.html
#############################################################################################################################mysql5.7安装
wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm
yum -y install mysql57-community-release-el7-8.noarch.rpm
yum -y install mysql-server
systemctl start mysqld
systemctl enable mysqld #设置开机自动启动
ps -C mysqld #检查是否有进程
netstat -utnlp | grep mysqld #看服务端口是否启动
grep password /var/log/mysqld.log #查询初始化密码C8&rp/gN#ijd
mysql -hlocalhost -uroot -p'系统产生的随机密码'
mysql>set global validate_password_policy=0; 只检查密码的长度
mysql>set global validate_password_length=6; 密码长度不能小于6个
mysql>alter user root@"localhost" identified by "weilai"; #用于改密码
mysql>alter user root@"localhost" identified by "Hdug&34dg1Gd";
]#vim /etc/my.cnf
[mysqld]#这个不放进去,以下如果不放,你用简短密码后期还是无法登陆,长密码无所谓
validate_password_policy=0
validate_password_length=6
lower_case_table_names=1 //忽略大小写
:wq
]#systemctl restart mysqld
//防火墙配置
[root@localhost ~]# iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT //centOS6 版本的端口放行
[root@localhost ~]# firewall-cmd --permanent --zone=public --add-port=3306/tcp
success
mysql> grant all on *.* to root@"%" identified by "Hdug&34dg1Gd";
select user,host,authentication_string from mysql.user; //查看授权列表
drop user 'root'@'192.168.12.1'; //删除用户授权
nginx与mysql安装的更多相关文章
- [转载]linux+nginx+python+mysql安装文档
原文地址:linux+nginx+python+mysql安装文档作者:oracletom # 开发包(如果centos没有安装数据库服务,那么要安装下面的mysql开发包) MySQL-devel- ...
- linux中nginx、mysql安装碰到的问题
服务器到期新买了一台服务器,记录一下重新安装基本环境碰到了一些问题 安装nginx 1. 启动失败 403 forbidden nginx 解决方案:(个人使用直接用了root账号,修改对应nginx ...
- nginx + php + mysql安装、配置、自启动+redis扩展
用过了apache就想着用用nginx,网上教程其实很多,但是受服务器版本等限制,每个人遇到的问题也不一样,先记录下我的 一.安装依赖 yum -y install gcc zlib zlib-dev ...
- linux(centos7) nginx php mysql安装
环境: linux:centos7 php:7.0 基础命令 // yum install -y lrzsz // centos7 默认已安装yum install epel-release ngin ...
- Nginx 笔记与总结(11)Nginx + php-fpm + MySQL 安装 ecshop
下载 ecshop (ECShop_V2.7.3_UTF8_release1106)安装包,解压之后把 upload 文件夹使用 ftp 传到服务器的 /usr/local/html 目录下,同时改名 ...
- WNMP(Windows + Nginx + PHP + MySQL) 安装
最近在开发一个新的项目,环境用的是: Nginx1.10.3 下载地址: http://nginx.org/en/download.html 下载windows版本包 PHP 7.1.1 下载地 ...
- centos nginx+php+mysql 安装libiconv不成功
wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz tar -zxvf libiconv-1.13.1.tar.gzcd l ...
- vagrant(二)配置文件vagrantfile详解 以及安装php、nginx、mysql
上一篇文章完整的讲叙了如何安装一个vagrant的环境.这里主要说一说vagrant的配置文件Vagrantfile. 一 配置详解 在我们的开发目录下有一个文件Vagrantfile,里面包含有大量 ...
- Mac OS使用brew安装Nginx、MySQL、PHP-FPM的LAMP开发环境
准备工作 新版的 Mac OS 内置了Apache 和 PHP,我的系统版本是OS X 10.9.3,可以通过以下命令查看Apache和PHP的版本号: httpd -v Server version ...
随机推荐
- [TcaplusDB知识库]数据库支撑底盘引擎计算层介绍
在上次的TcaplusDB知识库中,TcaplusDB君为大家讲解了TcaplusDB所用的基于HASH表的Key-value存储引擎TXHDB.存储引擎作为数据库的支撑底盘,其重要性无可置疑,而在本 ...
- IDEA中的Git操作,看这一篇就够了!
大家在使用Git时,都会选择一种Git客户端,在IDEA中内置了这种客户端,可以让你不需要使用Git命令就可以方便地进行操作,本文将讲述IDEA中的一些常用Git操作. 环境准备 使用前需要安装一个远 ...
- python 实用技巧:几十行代码将照片转换成素描图、随后打包成可执行文件(源码分享)
效果展示 原始效果图 素描效果图 相关依赖包 # 超美观的打印库 from pprint import pprint # 图像处理库 from PIL import Image # 科学计算库 imp ...
- leetcode——217. 存在重复元素
leetcode--217. 存在重复元素 题目描述:给定一个整数数组,判断是否存在重复元素. 如果存在一值在数组中出现至少两次,函数返回 true .如果数组中每个元素都不相同,则返回 false ...
- Hadoop day1
Hadoop就是存储海量数据和分析海量数据的工具 1.概念 Hadoop是由java语言编写的,在分布式服务器集群上存储海量数据并运行分布式分析应用的开源框架,其核心部件是HDFS与MapReduce ...
- 微信小游戏 Three.js UI 2D text 简单方案
在微信小游戏中使用 THREE.js 引擎,没有合适的 UI 库可用,只能自己动手.图片啥的都还好,text 不好弄.text 要计算 width 和 height,不然事件响应范围不对. funct ...
- 数据库CPU 100%处理记录
问题描述 2020年7月13日一大早收到告警,测试环境数据库CPU告警. 登录aws查看监控如下图 问题分析 出现这种cpu 100%的问题,都是因为sql性能问题导致的, 主要表现于 cpu 消 ...
- vue七种实现组建通信的方法
目录 组件通信 1.props 父组件--->子组件通信 2.$emit 子组件--->父组件传递 $emit与props结合 兄弟组件传值 3.bus(事件总线) 兄弟组件通信 4.$p ...
- MySQL——日志管理
一.MySQL日志类型 1.错误:--log--error ---------------------*** host_name.err 2.常规: --general_log host_name.l ...
- 使用easyui进行上左右布局
在后台管理系统开发的过程中,上左右的布局是最常见的页面布局方式,现在我们来看看使用easyui这个jquery前端框架如何快速搭建一个可用的页面框架. 1.在页面中引入easyui所需的文件 1 &l ...