ubuntu部署nodejs项目
安装nodejs
apt update
curl -sL https://deb.nodesource.com/setup_16.x | sudo bash –
sudo apt -y install nodejs
apt install mysql-server
mysql -u root -p
CREATE USER ‘admin’@’%’ IDENTIFIED BY ‘pass12345’;
grant all privileges on *.* to ‘admin’@’%’;
apt install redis-server
systemctl status redis-server
apt install nginx
systemctl status nginx
sudo systemctl enable nginx
sudo nano /etc/nginx/nginx.conf
server {
listen 80;
server_name admin.api.lingbits.com;
location / {
proxy_pass http://127.0.0.1:7001;
}
}
sudo nginx -t
sudo systemctl restart nginx