網(wǎng)站首頁 編程語言 正文
1.安裝 Git
sudo apt-get update sudo apt-get install git Do you want to continue? [Y/n] Y git --version
2. 安裝 UFW
sudo apt-get install ufw sudo ufw enable sudo ufw default deny sudo ufw allow 22/tcp sudo ufw allow 80/tcp sudo ufw allow 3306/tcp sudo ufw allow 27017/tcp sudo ufw allow 6379/tcp sudo ufw allow 8000:9000/tcp
3.安裝 Nginx
sudo apt-get install build-essential sudo apt-get install libtool sudo apt-get update sudo apt-get install libpcre3 libpcre3-dev sudo apt-get install zlib1g-dev sudo apt-get install openssl wget http://nginx.org/download/nginx-1.14.2.tar.gz tar -zxvf nginx-1.14.2.tar.gz cd nginx-1.14.2 ./configure --prefix=/usr/local/nginx make sudo make install sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf ps -ef|grep nginx curl -L http://127.0.0.1/index.html vi ~/.profile INSERT >>>>>>> export PATH=$PATH:/usr/local/nginx/sbin source ~/.profile vi /etc/init.d/nginx.server COPY INSERT >>>>>>> sudo chmod +x /etc/init.d/nginx.server sudo sysv-rc-conf nginx.server on
-
unable to resolve host iZs3y2byjpi9oxZ
?解決方案:
vi /etc/hosts INSERT >>>>>>> 127.0.0.1 iZs3y2byjpi9oxZ
/etc/init.d/nginx.server
#!/bin/sh set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="nginx daemon" NAME=nginx DAEMON=/usr/local/nginx/sbin/$NAME SCRIPTNAME=/etc/init.d/$NAME.server # If the daemon file is not found, terminate the script. test -x $DAEMON || exit 0 d_start() { $DAEMON || echo -n " already running" } d_stop() { $DAEMON –s quit || echo -n " not running" } d_reload() { $DAEMON –s reload || echo -n " could not reload" } case "$1" in start) echo -n "Starting $DESC: $NAME" d_start echo "." ;; stop) echo -n "Stopping $DESC: $NAME" d_stop echo "." ;; reload) echo -n "Reloading $DESC configuration..." d_reload echo "reloaded." ;; restart) echo -n "Restarting $DESC: $NAME" d_stop # Sleep for two seconds before starting again, this should give the # Nginx daemon some time to perform a graceful stop. sleep 2 d_start echo "." ;; *) echo "Usage: $SCRIPTNAME {start|stop|restart|reload}" >&2 exit 3 ;; esac exit 0
4.安裝 NetCore
wget https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb sudo apt-get update; \ sudo apt-get install -y apt-transport-https && \ sudo apt-get update && \ sudo apt-get install -y dotnet-sdk-3.1 dotnet --info
5.安裝 MySQL
# wget https://downloads.mysql.com/archives/get/p/23/file/mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz tar zxvf mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz sudo mv mysql-5.7.24-linux-glibc2.12-x86_64 /usr/local/mysql vi /etc/my.cnf COPY INSERT >>>>>>> cd /usr/local/mysql groupadd mysql useradd -r -g mysql mysql chown -R mysql:mysql ./ sudo bin/mysqld --initialize --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data # copy initial password [Note] A temporary password is generated for root@localhost: kiZI&a&kk6SQ sudo ./support-files/mysql.server start ps -ef|grep mysql ./bin/mysql -u root -p Enter password: kiZI&a&kk6SQ ALTER USER 'root' @'localhost' IDENTIFIED BY '123456'; CREATE USER 'root' @'%' IDENTIFIED BY '123456'; GRANT ALL ON *.* TO 'root' @'%'; FLUSH privileges; sudo cp ./support-files/mysql.server /etc/init.d/mysql.server sudo sysv-rc-conf mysql.server on vi ~/.profile INSERT >>>>>>> export PATH=$PATH:/usr/local/mysql/bin source ~/.profile
/etc/my.cnf
[mysqld] port = 3306 basedir=/usr/local/mysql datadir=/usr/local/mysql/data max_connections=200 max_connect_errors=10 character-set-server=utf8mb4 default-storage-engine=INNODB default_authentication_plugin=mysql_native_password [mysql] default-character-set=utf8mb4 [client] port=3306 default-character-set=utf8mb4
6.安裝 NodeJs
wget https://nodejs.org/dist/v14.15.1/node-v14.15.1-linux-x64.tar.xz tar xf node-v14.15.1-linux-x64.tar.xz sudo mv node-v14.15.1-linux-x64 /usr/local/nodejs cd /usr/local/nodejs ln -s /usr/local/nodejs/bin/node /usr/local/bin/ node -v ln -s /usr/local/nodejs/bin/npm /usr/local/bin/ npm -v npm config set registry https://registry.npm.taobao.org # install pm2 npm install pm2@latest -g ln -s /usr/local/nodejs/bin/pm2 /usr/local/bin/ sudo pm2 status
7.安裝 MongoDB
wget -qO - https://www.mongodb.org/static/pgp/server-3.4.asc | sudo apt-key add - echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list sudo apt-get update sudo apt-get install -y mongodb-org sudo service mongod start sudo service mongod status sudo service mongod stop vi /etc/mongod.conf EDIT >>>>>>> # network interfaces net: port: 27017 #bindIp: 127.0.0.1 bindIp: 0.0.0.0 #security: security: authorization: enabled sudo service mongod restart ps -ef | grep mongod # 進(jìn)入數(shù)據(jù)庫 mongo # 用admin身份 use admin # 創(chuàng)建超級管理員賬號 db.createUser( {user: "admin",pwd: "admin",roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]}) # 測試授權(quán) db.auth("admin","admin") # 建庫授權(quán) use testdb # 創(chuàng)建數(shù)據(jù)庫管理賬號 db.createUser( {user: "root",pwd: "123456",roles: [ { role: "readWrite", db: "testdb" } ]}) # 授權(quán)用戶 db.auth("root","123456") # 數(shù)據(jù)測試 db.log.insert({"created":"db","name":"testdb"}) db.log.insert({"created":"user","name":"root"}) exit # 開機自啟 sudo systemctl enable mongod
/etc/mongod.conf
# mongod.conf # for documentation of all options, see: # https://docs.mongodb.com/v3.4/reference/configuration-options/ # systemLog Options: systemLog: destination: file path: "/usr/local/mongodb/log/mongod.log" logAppend: true # processManagement Options: processManagement: fork: true # net Options: net: port: 27017 #bindIp: 127.0.0.1 bindIp: 0.0.0.0 # security Options: #security: security: authorization: enabled # setParameter Options: setParameter: enableLocalhostAuthBypass: false # storage Options: storage: dbPath: "/usr/local/mongodb/data" journal: enabled: true # operationProfiling Options: # replication Options: # sharding Options: # auditLog Options: # snmp Options:
MongDB數(shù)據(jù)庫角色對應(yīng)如下:
- Read:允許用戶讀取指定數(shù)據(jù)庫
- readWrite:允許用戶讀寫指定數(shù)據(jù)庫
- dbAdmin:允許用戶在指定數(shù)據(jù)庫中執(zhí)行管理函數(shù),如索引創(chuàng)建、刪除,查看統(tǒng)計或訪問system.profile
- userAdmin:允許用戶向system.users集合寫入,可以找指定數(shù)據(jù)庫里創(chuàng)建、刪除和管理用戶
- clusterAdmin:只在admin數(shù)據(jù)庫中可用,賦予用戶所有分片和復(fù)制集相關(guān)函數(shù)的管理權(quán)限。
- readAnyDatabase:只在admin數(shù)據(jù)庫中可用,賦予用戶所有數(shù)據(jù)庫的讀權(quán)限
- readWriteAnyDatabase:只在admin數(shù)據(jù)庫中可用,賦予用戶所有數(shù)據(jù)庫的讀寫權(quán)限
- userAdminAnyDatabase:只在admin數(shù)據(jù)庫中可用,賦予用戶所有數(shù)據(jù)庫的userAdmin權(quán)限
- dbAdminAnyDatabase:只在admin數(shù)據(jù)庫中可用,賦予用戶所有數(shù)據(jù)庫的dbAdmin權(quán)限。
- root:只在admin數(shù)據(jù)庫中可用。超級賬號,超級權(quán)限
7.安裝 Redis
sudo apt-get install redis-server Do you want to continue? [Y/n] Y ps -ef|grep redis vi /ect/redis/redis.conf EDIT >>>>>>> #bind 127.0.0.1 requirepass 123456 service redis-server restart
服務(wù)自啟配置
sudo apt-get install sysv-rc-conf # redis-server sudo sysv-rc-conf redis-server on # nginx.server sudo sysv-rc-conf nginx.server on # mysql.server sudo sysv-rc-conf mysql.server on # mongo sudo systemctl enable mongod
實例軟件的版本:
nginx-1.14.2.tar.gz
packages-microsoft-prod.deb
mysql-5.7.24-linux-glibc2.12-x86_64.tar.gz
node-v14.15.1-linux-x64.tar.xz
原文鏈接:https://www.cnblogs.com/Run2948/p/Ubuntu_16_04_Env_Quickly_Setup.html
相關(guān)推薦
- 2022-12-24 Docker自定義網(wǎng)絡(luò)詳解_docker
- 2023-12-20 IDEA新建maven項目,使用mybatis操作數(shù)據(jù)庫完整過程
- 2022-07-22 UC瀏覽器兼容問題
- 2022-03-30 pytorch中的dataset用法詳解_python
- 2022-07-22 HttpClient如何自定義重試方法
- 2022-04-18 taro 中設(shè)計稿尺寸相關(guān)問題,以及自適應(yīng)頁面寫法
- 2023-03-19 Python學(xué)習(xí)之configparser模塊的使用詳解_python
- 2022-12-11 瀏覽器控制臺報錯Failed?to?load?module?script:解決方法_nginx
- 最近更新
-
- window11 系統(tǒng)安裝 yarn
- 超詳細(xì)win安裝深度學(xué)習(xí)環(huán)境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎(chǔ)操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區(qū)別,Jav
- spring @retryable不生效的一種
- Spring Security之認(rèn)證信息的處理
- Spring Security之認(rèn)證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權(quán)
- redisson分布式鎖中waittime的設(shè)
- maven:解決release錯誤:Artif
- restTemplate使用總結(jié)
- Spring Security之安全異常處理
- MybatisPlus優(yōu)雅實現(xiàn)加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務(wù)發(fā)現(xiàn)-Nac
- Spring Security之基于HttpR
- Redis 底層數(shù)據(jù)結(jié)構(gòu)-簡單動態(tài)字符串(SD
- arthas操作spring被代理目標(biāo)對象命令
- Spring中的單例模式應(yīng)用詳解
- 聊聊消息隊列,發(fā)送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠(yuǎn)程分支