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安装的更多相关文章

  1. [转载]linux+nginx+python+mysql安装文档

    原文地址:linux+nginx+python+mysql安装文档作者:oracletom # 开发包(如果centos没有安装数据库服务,那么要安装下面的mysql开发包) MySQL-devel- ...

  2. linux中nginx、mysql安装碰到的问题

    服务器到期新买了一台服务器,记录一下重新安装基本环境碰到了一些问题 安装nginx 1. 启动失败 403 forbidden nginx 解决方案:(个人使用直接用了root账号,修改对应nginx ...

  3. nginx + php + mysql安装、配置、自启动+redis扩展

    用过了apache就想着用用nginx,网上教程其实很多,但是受服务器版本等限制,每个人遇到的问题也不一样,先记录下我的 一.安装依赖 yum -y install gcc zlib zlib-dev ...

  4. linux(centos7) nginx php mysql安装

    环境: linux:centos7 php:7.0 基础命令 // yum install -y lrzsz // centos7 默认已安装yum install epel-release ngin ...

  5. Nginx 笔记与总结(11)Nginx + php-fpm + MySQL 安装 ecshop

    下载 ecshop (ECShop_V2.7.3_UTF8_release1106)安装包,解压之后把 upload 文件夹使用 ftp 传到服务器的 /usr/local/html 目录下,同时改名 ...

  6. WNMP(Windows + Nginx + PHP + MySQL) 安装

    最近在开发一个新的项目,环境用的是: Nginx1.10.3  下载地址: http://nginx.org/en/download.html  下载windows版本包 PHP 7.1.1  下载地 ...

  7. 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 ...

  8. vagrant(二)配置文件vagrantfile详解 以及安装php、nginx、mysql

    上一篇文章完整的讲叙了如何安装一个vagrant的环境.这里主要说一说vagrant的配置文件Vagrantfile. 一 配置详解 在我们的开发目录下有一个文件Vagrantfile,里面包含有大量 ...

  9. Mac OS使用brew安装Nginx、MySQL、PHP-FPM的LAMP开发环境

    准备工作 新版的 Mac OS 内置了Apache 和 PHP,我的系统版本是OS X 10.9.3,可以通过以下命令查看Apache和PHP的版本号: httpd -v Server version ...

随机推荐

  1. noip18

    T1 来自cf原题 考场直接暴力枚举 \(A,B\),15pts. 正解: 首先时间的表达式,\(T=\frac{A}{a_{i}}+\frac{B}{b_{i}}\),然后以\(\frac{1}{a ...

  2. liunx上安装nacos

    下载nacos wget https://github.com/alibaba/nacos/releases/download/1.4.1/nacos-server-1.4.1.tar.gz 启动服务 ...

  3. Docker运行sonarqube-(代码质量检测平台)

    sonarqube是什么 SonarQube是用于持续检查代码质量的开源平台. 可用于持续集成,持续部署流程中的代码检测环节. idea和jenkins都提供了插件配合使用. liunx推荐配置环境 ...

  4. Ubuntu系统开放指定端口

    今天在一台Ubuntu服务器里面配置了一个Nginx服务,监听的8080端口.本机可以访问,但是局域网就是访问不到.首先怀疑防火墙没有开放8080端口,设置ufw防火墙开放8080端口 $ sudo ...

  5. wpf中INotifyPropertyChanged的用法

    using System;using System.Collections.Generic;using System.ComponentModel;using System.Linq;using Sy ...

  6. CentOS8安装Mysql5.7

    检查是否安装mysql [root@iZ2ze8crquorxf6c7l0eluZ ~]# rpm -qa |grep mysql [root@iZ2ze8crquorxf6c7l0eluZ ~]# ...

  7. css - rem和vw

    css - rem和vw 物理像素 物理像素在不同的设备中1px里可以容纳的像素颗粒是不相同的,所以1px这个单位其实也是有N个像素颗粒填充的.同一尺寸屏幕的每个像素点所能容纳的像素颗粒越多显示效果越 ...

  8. 在Raspberry Pi 3B+上安装Windows 10 IoT

    下载 进入树莓派下载页面,当前网址https://www.raspberrypi.org/downloads/ 选择Windows 10 IoT Core,当前网址https://docs.micro ...

  9. 使用ECharts绘制网址径向树状图

    an.rustfisher.com有很多内容,很多页面.如果用一个树状图把所有页面展示出来会是什么效果? 第一时间想到了ECharts. 最后效果: https://an.rustfisher.com ...

  10. mysql绕过root密码登录

    绕过密码登录步骤: 一.Mysql8.0之前: 关闭服务 执行参数:mysqld --skip-grant-tables 新开窗口执行mysql,即可进入mysql 二.Mysql8.0之前: 关闭服 ...