标签:prefix 配置 后台 软件的安装 web nodejs lis install sbin
环境准备
#!/bin/bash
# 使用nvm安装node.js
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | NVM_DIR=/usr/local/nvm bash
export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/dist
echo "export NVM_DIR="/usr/local/nvm"" >> /etc/bashrc
echo "[ -s "\$NVM_DIR/nvm.sh" ] && \. "\$NVM_DIR/nvm.sh" " >> /etc/bashrc
echo "export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/dist" >> /etc/bashrc
source /etc/bashrc
source ~/.bash_profile
nvm install 10.15.1
nvm alias default v10.15.1
nvm use 10.15.1
#!/bin/bash
cd /usr/src
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-4.0.3.tgz
tar xvf mongodb-linux-x86_64-4.0.3.tgz
mv mongodb-linux-x86_64-4.0.3 mongodb
mkdir -p /data/mongodb/data && mkdir -p /data/mongodb/logs
# 启动服务
/usr/src/mongodb/bin/mongod --dbpath /data/mongodb/data --logpath /data/mongodb/logs/logs.log --fork --port 27017
#!/bin/bash
cd /usr/src
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
tar xzf redis-5.0.5.tar.gz
cd redis-5.0.5
make
cd src
make install PREFIX=/usr/local/redis
mkdir -p /usr/local/redis/etc/
cp /usr/src/redis-5.0.5/redis.conf /usr/local/redis/etc
#后台启动
sed -i ‘s/daemonize no/daemonize yes/g‘ /usr/local/redis/etc/redis.conf
#启动redis
/usr/local/redis/bin/redis-server /usr/local/redis/etc/redis.conf
#!/bin/bash
cd /usr/src
wget http://nginx.org/download/nginx-1.12.0.tar.gz
tar xvf nginx-1.12.0.tar.gz
cd nginx-1.12.0
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
yum -y install pcre-devel openssl openssl-devel
make
make install
/usr/local/nginx/sbin/nginx
upstream apubplat-servers {
server 127.0.0.1:18888;
}
server {
listen 80;
server_name xxx.xxx.com;
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://apubplat-servers;
}
}
upstream apubplat-servers {
server 127.0.0.1:18888;
}
server {
listen 80;
server_name xxx.xxx.com;
add_header Strict-Transport-Security max-age=15768000;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name xxx.xxx.com;
ssl_certificate /usr/local/nginx/conf/key/1_xxx.com_bundle.crt;
ssl_certificate_key /usr/local/nginx/conf/key/2_xxx.com.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_pass http://apubplat-servers;
}
}
git clone https://github.com/wangweianger/APubPlat
npm install
// development
npm run dev
// product
npm start
// egg.js 日志位置
APubPlat/buildlogs/*.log
标签:prefix 配置 后台 软件的安装 web nodejs lis install sbin
原文地址:https://www.cnblogs.com/se7enjean/p/10989401.html