mkdir /usr/local/javacd /usr/local/java/wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gzwget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u211-b12/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u211-linux-x64.tar.gz
tar -zxvf jdk-8u211-linux-x64.tar.gz
vi /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_211
export ZOOKEEPER_HOME=/usr/local/zookeeper-3.4.14
export NODE_HOME=/usr/local/elasticsearch-6.3.2/node-v10.1.0-linux-x64
export JRE_HOME=/usr/local/java/jdk1.8.0_211/jre
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$ZOOKEEPER_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$NODE_HOME/bin:$ZOOKEEPER_HOME/bin:$PATHexport NODE_PATH=$NODE_HOME/lib/node_modules
source /etc/profile
java -version
mkdir /usr/local/redis
chmod 777 /usr/local/redis/
cd /usr/local/redis
wget http://download.redis.io/releases/redis-4.0.12.tar.gz
tar -zxvf redis-4.0.12.tar.gz
cd redis-4.0.12
yum -y install tcl
如果提示cc没有找到:yum -y install gcc gcc-c++ libstdc+±devel
如果提示/deps/hiredis/libhiredis.a:cd ./deps make lua hiredis linenoise
make MALLOC=libc
make test
make install
vim redis.conf
daemonize yes
bind 0.0.0.0
port 6379requirepass 1111111111
./src/redis-server ./redis.conf
vim /etc/systemd/system/redis-server.service
[Unit]
Description=Redis Server Manager
After=syslog.target
After=network.target[Service]
#Type=simple
#User=redis
#Group=redis
Type=forking
#PIDFile=/var/run/redis_6902.pid
#ExecStart=/usr/local/redis/redis-4.0.12/src/redis-server /usr/local/redis/redis-4.0.12/redis.conf
#ExecReload=/usr/local/redis/redis-4.0.12/src/redis-server -s reload
#ExecStop=/usr/local/redis/redis-4.0.12/src/redis-cli shutdown
#Restart=always
PIDFile=/var/run/redis_6379.pid
ExecStart=/usr/local/redis/redis-4.0.12/src/redis-server /usr/local/redis/redis-4.0.12/redis.conf
ExecReload=/usr/local/redis/redis-4.0.12/src/redis-server -s reload
ExecStop=/usr/local/redis/redis-4.0.12/src/redis-server -s quit
PrivateTmp=true[Install]
WantedBy=multi-user.target
systemctl enable redis-server.service
systemctl status redis-server.service
systemctl restart redis-server.service
systemctl list-unit-files |grep redis
systemctl start redis-service
mkdir /usr/local/nginx
cd /usr/local/nginx/
wget -c https://nginx.org/download/nginx-1.15.8.tar.gz
yum install gcc-c++
yum install -y pcre pcre-devel
yum install -y zlib zlib-devel
yum install -y openssl openssl-devel
tar -zxvf nginx-1.15.8.tar.gz
cd nginx-1.15.8
./configure --with-http_ssl_module
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
cd …/sbin/
./nginx
ps aux|grep nginx
vim /usr/local/nginx/conf/nginx.conf
server {listen 80;server_name xxx.xxx.xxx;location / {proxy_set_header Host $host;proxy_pass http://localhost:8689/website/;}location /website/ {proxy_pass http://localhost:8689/website/;proxy_cookie_path /website/ /;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}}server {listen 80;server_name api.wechat.smart.chenghong.tech;rewrite ^(.*) https://$server_name$1 permanent;location / {proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://api_wechat_smart;}}server {listen 443 ssl;server_name api.wechat.smart.chenghong.tech;ssl_certificate /usr/local/nginx/cert2/3232530_api.wechat.smart.chenghong.tech.pem;ssl_certificate_key /usr/local/nginx/cert2/3232530_api.wechat.smart.chenghong.tech.key;ssl_session_cache shared:SSL:1m;ssl_session_timeout 5m;ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;ssl_prefer_server_ciphers on;location / {proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;proxy_pass http://api_wechat_smart;}}upstream api_wechat_smart{server localhost:8689;}
/usr/local/nginx/sbin/nginx -s reload
附加
cd nginx-1.16.0
./configure
make
make install
netstat -ano|grep 80
cd configure
ls
wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure=====================================================
make
make install
cd /usr/local/src
wget https://www.openssl.org/source/openssl-1.0.1t.tar.gz
tar -zxvf openssl-1.0.1t.tar.gz
cd /usr/local/nginx-1.16.0
./configure
make
make install
mkdir /usr/local/zk
cd /usr/local/zk
wget http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz
java -version
tar -xvzf zookeeper-3.4.14.tar.gz
cd zookeeper-3.4.14
cd bin/
./zkServer.sh start
firewall-cmd --zone=public --add-port=80/tcp --permanent
命令含义: --zone #作用域 --add-port=80/tcp #添加端口,格式为:端口/通讯协议 --permanent #永久生效,没有此参数重启后失效
firewall-cmd --reload
firewall-cmd --list-ports