此文以CentOS为例,乌班图的是有区别的,请参照https://www.cnblogs.com/takako_mu/p/11725733.html。
安装.Net Core
$ wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
$ sudo dpkg -i packages-microsoft-prod.deb
$ apt install -y apt-transport-https
$ apt update
$ apt install -y dotnet-sdk-2.2
注意事项:如果上述命令执行顺利,请直接跳到安装Node.Js
2020/1/21记录:之前在公司给的服务器上一直是好的,但是我在自己的阿里云服务器上执行上述命令时出错。提示如下:
E: Unable to locate package dotnet-sdk-2.2
E: Couldn't find any package by glob 'dotnet-sdk-2.2'
E: Couldn't find any package by regex 'dotnet-sdk-2.2'
后来我又重头再运行了一次后成功,无语。难道是我中途 apt update没有执行?好吧,到此为止。
安装Node.js
$ curl -sL https://deb.nodesource.com/setup_10.x | bash - $ apt install -y nodejs --fix-missing
安装 Nginx
$ apt install -y nginx $ systemctl enable nginx
安装Redis
$ apt install -y redis-server
修改 /etc/redis/redis.conf /etc/redis/redis.conf
bind 0.0.0.0 daemonize yes dir /home/redis/ requirepass schindler
安装 MongoDB
$ apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4 $ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | tee /etc/apt/sources.list.d/mongodborg-4.0.list $ apt update $ apt install -y mongodb-org
修改 /etc/mongod.conf /etc/mongod.conf
bindIp: 0.0.0.0启动
$ systemctl enable mongod $ systemctl start mongod安装 RabbitMQ 安装 erlang 新建 /etc/apt/sources.list.d/bintray.erlang.list
deb http://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
$ apt update $ apt install -y erlang-base \ erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlanginets \ erlang-mnesia erlang-os-mon erlang-parsetools erlangpublic-key \ erlang-runtime-tools erlang-snmp erlang-ssl \ erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl安装 RabbitMQ
$ curl -fsSL https://github.com/rabbitmq/signingkeys/releases/download/2.0/rabbitmq-release-signing-key.asc | apt-key add - $ apt-key adv --keyserver "hkps.pool.sks-keyservers.net" --recv-keys "0x6B73A36E6026DFCA" $ apt install -y apt-transport-https $ tee /etc/apt/sources.list.d/bintray.rabbitmq.list <<EOF deb https://dl.bintray.com/rabbitmq-erlang/debian bionic erlang-21.x deb https://dl.bintray.com/rabbitmq/debian bionic main EOF $ apt update $ apt install -y rabbitmq-server --fix-missing $ systemctl enable rabbitmq-server $ systemctl start rabbitmq-server $ rabbitmq-plugins enable rabbitmq_management $ rabbitmq-plugins enable rabbitmq_tracing添加⽤户和权限
$ rabbitmqctl add_user test test $ rabbitmqctl set_user_tags test administrator $ rabbitmqctl list_users $ rabbitmqctl set_permissions -p / test ".*" ".*" ".*"安装 Yarn
$ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - $ echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list $ apt update $ apt install -y yarn $ yarn config set registry 'https://registry.npm.taobao.org'安装 pm2 和 logrotate
$ yarn global add pm2 $ pm2 install pm2-logrotate $ pm2 set pm2-logrotate:max_size 100M创建 www ⽬录
$ mkdir /var/www $ pm2 ecosystem File /var/www/ecosystem.config.js generated
以下为安装图:
标签:脚本,install,CentOS,list,apt,etc,https,Linux,erlang From: https://www.cnblogs.com/takako_mu/p/16620801.html