在centos7上部署asp.net core應用
阿新 • • 發佈:2019-03-13
.org vsftpd pmo 進行 ssl linu dir rod win
切換到root賬號
Su
gcc 安裝
yum install gcc-c++
安裝pcre和pcre-devel
yum install -y pcre pcre-devel
安裝zlib zlib
yum install -y zlib zlib-devel
安裝openssl openssl
yum install -y openssl openssl-devel
安裝wget:
yum -y install wget
下載安裝nginx
cd /usr/local/src wget http://nginx.org/download/nginx-1.1.10.tar.gz tar-zxvf nginx-1.1.10.tar.gz cd nginx-1.1.10 ./configure make make install
查找安裝路徑:
whereis nginx
啟動、停止nginx
cd /usr/local/nginx/sbin/ ./nginx ./nginx -s stop ./nginx -s quit ./nginx -s reload
查看nginx進程
ps -ef | grep nginx
查看端口占用
ps aux | grep 23275
從windows傳文件
1.安裝ftp服務
yum -y install ftp vsftpd
2.查看配置文件路徑
rpm -qc vsftpd
3.創建目錄
mkdir wwwroot
4.修改文件夾權限
chmod -R 777 dirPath
-R表示遞歸子文件夾
chmod 777 /home
5.下載filezilla連接linux
Asp.net和asp.net core的不同之處
在配置方面:ASP.NET 使用的是web.config文件,而ASP.NET Core使用 appsettings.json 文件來進行配置。
依賴註入:ASP.NET不需要/很少關註就可以開發一個完整的程序,而ASP.NET Core使用了大量的依賴註入(包括本地文件讀取都需要)。
管道:ASP.NET使用 httpmodule來配置使用,而ASP.NET Core則使用的是middware。
安裝.net core
https://dotnet.microsoft.com/learn/dotnet/hello-world-tutorial/install
1.註冊key
sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm
2.Install the .NET SDK
sudo yum update
sudo yum install dotnet-sdk-2.2
3.Check everything installed correctly
Dotnet –info
運行.net示例項目
通過瀏覽器訪問
並將網址加入信任名單 (否則會被linux攔截)
可以看到上圖畫面,正常運行.
參考: https://www.cnblogs.com/ants/p/5732337.html#autoid-4-0-0
在centos7上部署asp.net core應用