快速搭建伺服器依賴環境

2021-10-08 08:27:20 字數 3059 閱讀 2608

1. 安裝docker、docker-compose

sudo yum -y install docker
curl -l  -s`-`uname -m` > /usr/local/bin/docker-compose

chmod +x /usr/local/bin/docker-compose

2. 構建mysql、redis、rabbitmq容器[docker-compose.yml]

version: '3'

services:

redis:

image: redis

container_name: redis

restart: always

ports:

- 6379:6379

deploy:

resources:

limits:

cpus: '0.5'

memory: 1000m

volumes:

- ./redis/conf/redis.conf:/usr/local/etc/redis/redis.conf

- /etc/localtime:/etc/localtime:ro

- ./redis/data:/data

command: redis-server /usr/local/etc/redis/redis.conf

rabbitmq:

image: rabbitmq:management

container_name: rabbitmq

restart: always

ports:

- 5672:5672

- 15672:15672

deploy:

resources:

limits:

cpus: '0.5'

memory: 1000m

volumes:

- /etc/localtime:/etc/localtime:ro

environment:

rabbitmq_default_user: admin

rabbitmq_default_pass: admin

mysql:

image: mysql:5.7.23

container_name: mysql

restart: always

ports:

- 3306:3306

volumes:

- ./mysql/3306:/var/lib/mysql

- /etc/localtime:/etc/localtime:ro

environment:

mysql_root_password: root

command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max_allowed_packet=128m --max_connections=6000 --lower_case_table_names=1 --sql_mode=strict_trans_tables,no_zero_in_date,no_zero_date,error_for_division_by_zero,no_auto_create_user,no_engine_substitution

3. 安裝nginx

rm -rf nginx-1.12.0.tar.gz4. 配置環境變數

vi /etc/profile
最下面新增,並儲存

export path="$path:/usr/local/nginx/sbin"
更新環境變數

source /etc/profile
5. 修改nginx配置

預設路徑 -》/usr/local/nginx/conf/nginx.conf

#user  nobody;

worker_processes 1;

#error_log logs/error.log;

#error_log logs/error.log notice;

#error_log logs/error.log info;

#pid logs/nginx.pid;

events

http

擴充套件配置檔案:

http配置模版:

server

#上傳顯示

location /uploads

#前端訪問

location ^~ /admin

#後端 api服務配置

location ^~ /api/sys

location ^~ /api/demo

# location ^~ /api/

}

ssl 配置模版:

server

location ^~ /api/sys

#檔案上傳

location ^~ /api/upload

#上傳顯示

location /uploads

#前端訪問靜態檔案

location ^~ /admin

}

快速搭建FTP伺服器

1.2 程式介面找到 啟用或關閉windows功能 並開啟 1.3 上面兩步也可以簡化為一步 按 win r 快捷鍵開啟執行對話方塊,輸入 optionalfeatures 後,按回車鍵 1.4 從 啟用或關閉windows功能 彈窗中找到internet information services ...

快速搭建本地伺服器

今天在想靜態檔案能否讀取本地json檔案,沒有伺服器肯定是不行的。那麼如何搭建乙個靜態檔案的伺服器呢?我肯定沒有那本事,不過github上面已經有了比較好的相關的開源專案,解決這個問題。anywhere 使用很簡單 直接看文件就行 裝好以後直接執行 anywhere h localhost p 88...

nginx fastcgi c 伺服器環境搭建

nginx 的中文維基 tar zxvf nginx 0.6.26.tar.gz configure,注意了類似checking for not found項,可能是依賴包沒有,則需要安裝依賴包 缺少pcre,yum install pcre安裝。或者去 如果缺少openssl,yum instal...