#更新apt-get
apt-get update
#安装vsftpd
apt-get install vsftpd
#新增ftp账户
adduser sharp
#下载并安装mysql apt仓库更新
wget https://repo.mysql.com//mysql-apt-config_0.8.9-1_all.deb
dpkg -i mysql-apt-config_0.8.9-1_all.deb
rm mysql-apt-config_0.8.9-1_all.deb
apt-get update
#安装mysql-server
apt-get install mysql-server
#配置mysql
mysql -u root -p
#添加一个远程账户admin
GRANT ALL ON *.* TO admin@'%' IDENTIFIED BY 'admin' WITH GRANT OPTION;
flush privileges;
#修改mysql的监听地址,文件中的bind-address改为0.0.0.0
#vim中x:删除,e:编辑,i:插入,按esc键返回指令模式,[:w]保存[:q]退出编辑器
vim /etc/mysql/mysql.conf.d/mysqld.cnf
#重启mysql服务,然后就可以尝试远程连接了
service mysql restart
##########################安装dotnet#############
apt-get update
sudo apt-get install curl libunwind8 gettext apt-transport-https
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-debian-stretch-prod stretch main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-get update
sudo apt-get install dotnet-sdk-2.1.4
#以服务方式自启动DOTNET
systemctl edit --user --full --force dotnet-appser.service
添加如下内容:(注意,WorkingDirectory必须要指定,不然hostingEnvironment.ContentRootPath始终为/root。/usr/bin/dotnet必须使用绝对路径,直接使用dotnet,systemctl会报错。)
[Unit]
Description=dotnet-AppServer
[Service]
WorkingDirectory=/home/sharp/appser
ExecStart=/usr/bin/dotnet AppService.dll
Restart=always
RestartSec=10
SyslogIdentifier=51customer
User=root
[Install]
WantedBy=multi-user.target
##################启动服务##################
systemctl start dotnet-appserver.service
##################查看服务状态#####################
systemctl status --user dotnet-appserver.service
一键复制
编辑
Web IDE
原始数据
按行查看
历史