nginx 基本环境安装
yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
创建目录
cd usr/local
mkdir nginx
cd nginx
安装nginx
wget https://nginx.org/download/nginx-1.21.6.tar.gz
tar xvf nginx-1.21.6.tar.gz
cd nginx-1.21.6
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
cd /usr/local/nginx/sbin
./nginx
cd /usr/local/nginx/sbin
./nginx -s stop
开启防火墙,对外支持
systemctl start firewalld
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --add-port=80/tcp
firewall-cmd --reload
firewall-cmd --list-services
firewall-cmd --zone=public --list-ports
cd /usr/local/nginx/sbin
./nginx -s reload
nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
proxy_pass http://1.1.1.1:9000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /mine/ {
proxy_pass http://1.1.1.1:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 8080;
server_name localhost;
location / {
root html/dist;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
include servers/*;
}
mac通过brew安装redis
brew install redis
brew services start redis
redis-server /usr/local/etc/redis.conf
redis-server
ps axu | grep redis
redis-cli -h 127.0.0.1 -p 6379 -a 密码
redis-cli
ping
AUTH 密码
redis-cli shutdown
sudo pkill redis-server