Project deployment Linux server-related nginx proxy mongoDB installation database encryption fnalshell connection host upload static resources nginx simple configuration

Table of contents

Deploy the specific process

Linux common commands

Install Node.js

Install MongoDB


Deploy the specific process

Linux common commands

After entering the Linux system, use commands to operate, first introduce a few commands:

ls: ll: View the files in the current directory

exit: Exit the system

clear: clear the screen

touch: Create a file, such as touch file name

mkdir: Create a directory, such as mkdir directory name

mv: move a directory or file, such as where the file or directory to be moved by mv

rm -rf The directory or file name to be deleted: delete the directory or file

Install Node.js

下载 wget https://nodejs.org/dist/v17.0.0/node-v17.0.0-linux-x64.tar.xz
 解压 tar xvf node-v17.0.0-linux-x64.tar.xz
创建软连接
ln -s /root/node-v17.0.0-linux-x64/bin/node /usr/local/bin/node
ln -s /root/node-v17.0.0-linux-x64/bin/npm /usr/local/bin/npm

Install MongoDB

安装依赖库:
yum -y install pcre*
yum -y install openssl*
下载 curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-4.2.1.tgz
解压:tar zxvf mongodb-linux-x86_64-rhel70-4.2.1.tgz
移动:mv mongodb-linux-x86_64-rhel70-4.2.1/ /usr/local/mongodb
创建数据文件夹、日志文件和mongo配置文件:
mkdir -p  /usr/local/mongodb/data/db
touch /usr/local/mongodb/mongod.log
touch /usr/local/mongodb/mongodb.conf
在配置文件中加入如下代码:简单配置
dbpath=/usr/local/mongodb/data/db
logpath=/usr/local/mongodb/log/mongod.log
logappend = true
port = 27017
fork = true
auth = true
cd bin
本地启动一次:./mongod --dbpath /usr/local/mongodb/data/db
./mongod -dbpath=/usr/local/mongodb/data/db --bind_ip 0.0.0.0
指定所有的 ip 都可以连接上
启动时读取配置文件
./mongod --config /usr/local/mongodb/mongodb.conf
解决依赖库确缺失问题
安装下面rpm包
wget https://vault.centos.org/centos/8/AppStream/x86_64/os/Packages/compat-openssl10-1.0.2o-3.el8.x86_64.rpm
rpm -ivh compat-openssl10-1.0.2o-3.el8.x86_64.rpm

Original address
http://39.108.235.186/article/624efc121ecaa48cf5ef7760 http://39.108.235.186/article/624efc121ecaa48cf5ef7760

Guess you like

Origin blog.csdn.net/weixin_55508765/article/details/124029167