51core / mango-sns-open Goto Github PK
View Code? Open in Web Editor NEW51core社区项目
Home Page: https://www.51core.net
51core社区项目
Home Page: https://www.51core.net
建议将QQ交流群号放到readme里
一、环境安装
1、首先更新系统
apt update&&apt upgrade -y
2、安装.Net Core环境
按照微软官方的说明安装.Net Core环境
https://github.com/dotnet/core/blob/master/release-notes/3.0/preview/3.0.0-preview8-download.md
执行如下命令:
(1)下载需要的文件
sudo wget https://download.visualstudio.microsoft.com/download/pr/54a51271-ab58-41f3-9b18-a939888251fe/9b44470e8bc2bb6259e91696ad4e56b5/dotnet-runtime-deps-3.0.0-preview8-28405-07-x64.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/24de5026-3471-4803-b674-689b338569df/10770879c266d430f4707e4f05f14559/dotnet-host-3.0.0-preview8-28405-07-x64.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/f65168d8-ecae-473a-a5ca-4300ed6d82ca/1ef8f137d05783380d128550fb1f0eb8/dotnet-hostfxr-3.0.0-preview8-28405-07-x64.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/b19fcec7-447a-465a-b1d5-b18084485b8d/40017d81e52d89f3aaac2537357c6c63/dotnet-runtime-3.0.0-preview8-28405-07-x64.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/13e08a26-96aa-4b54-ab4f-ab967fa13be2/1bbd4e9a5f04e254ec43ede7f43e7005/aspnetcore-runtime-3.0.0-preview8.19405.7-x64.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/cb26477c-ca65-4fa7-86cc-de0131303875/b844b61ec6ddab5d82dabc6c5efd419b/dotnet-targeting-pack-3.0.0-preview8-28405-07-x64.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/0afc82ac-e13e-4079-8579-0b17ead6479a/37153d3072e9f32ae816664b40302c28/dotnet-apphost-pack-3.0.0-preview8-28405-07-x64.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/90cf071f-8412-45b1-9237-ade8d9d5b871/adcdf7d67cb0554f6a53af3d3b303e9d/aspnetcore-targeting-pack-3.0.0-preview8.19405.7.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/4caf9463-865a-4265-83e6-15fc4c217eb2/320dde5e522457a91b2a1daaa57bb764/netstandard-targeting-pack-2.1.0-preview8-28405-07-x64.deb
sudo wget https://download.visualstudio.microsoft.com/download/pr/3dd3123a-7ada-40d0-b920-cd9b22cdb172/5e9142450ceec2b15829ca0fe5c54a68/dotnet-sdk-3.0.100-preview8-013656-x64.deb
(2)运行如下命令安装deb包
sudo dpkg -i ./*.deb
如果出错,执行如下命令修复
apt install -f
(3)验证.Net Core是否安装成功
sudo dotnet --version
看到如下提示:
3.0.100-preview8-013656
3、克隆项目到本地
git clone https://github.com/51core/mango-sns-open.git
转到项目的src目录
cd mango-sns-open/src/
分别运行如下命令:
dotnet restore
dotnet publish
转到项目的Mango.Web/bin/Debug/netcoreapp3.0/publish/ 目录
cd Mango.Web/bin/Debug/netcoreapp3.0/publish/
将目录下的文件复制到/var/www/default目录。
如果不存在/var/www/default目录,运行如下命令建立:
mkdir -p /var/www/default
4、安装redis
运行如下命令安装redis
apt install redis -y
查看redis是否启动成功。
5、安装Jexus
运行如下命令安装Jexus
curl https://jexus.org/release/x64/install.sh|sudo sh
6、安装Sql Server on Linux
官方说明已经很详细了,这里不多说了。
https://docs.microsoft.com/zh-cn/sql/linux/sql-server-linux-setup?view=sql-server-2017
7、用SQL Server management Studio连接数据库,执行项目doc目录下的数据库表结构脚本.sql和项目初始化数据脚本.sql两个文件建立数据库及表。
在执行sql文件之前需要对数据库表结构脚本.sql里的内容,做一些修改,修改的内容主要是:
( NAME = N'MangoDB', FILENAME = N'/var/opt/mssql/data/MangoDB.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
LOG ON
( NAME = N'MangoDB_log', FILENAME = N'/var/opt/mssql/data/MangoDB_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
然后分别运行数据库表结构脚本.sql和项目初始化数据脚本.sql两个文件,建立数据库及表。
8、编辑Jexus的配置文件
这是完整的配置文件:
######################
Web Site: Default
########################################
port=80
#root=/ /home/www.githall.cn
hosts=www.githall.cn #OR your.com,*.your.com
User=www-data
AspNet.Workers=2
addr=0.0.0.0
CheckQuery=false
NoLog=true
NoFile=/index.php
Keep_Alive=false
UseGZIP=false
UseHttps=true
ssl.certificate=/x/xxx.crt #or pem
ssl.certificatekey=/x/xxx.key
ssl.protocol=TLSv1.0 # TLSv1.1 or TLSv1.2
ssl.ciphers=
#AppHost.Port=5000
AppHost={cmd=dotnet /var/www/default/Mango.Web.dll; root=/var/www/default/; port=5000}
DenyFrom=192.168.i0.233, 192.168.1.*, 192.168.2.0/24
AllowFrom=192.168..
DenyDirs=~/cgi, ~/upfiles
indexes=myindex.aspx
rewrite=^/.+?.(asp|php|cgi|pl|sh)$ /index.aspx
reproxy=/bbs/ http://192.168.1.112/bbs/
host.Redirect=abc.com www.abc.com 301
ResponseHandler.Add=myKey:myValue
Jexus php fastcgi address is '/var/run/jexus/phpsvr'
#######################################################
fastcgi.add=php|socket:/var/run/jexus/phpsvr
php-fpm listen address is '127.0.0.1:9000'
############################################
fastcgi.add=php|tcp:127.0.0.1:9000
9、修改appsettings.json文件,其中
server=127.0.0.1;database=MangoDB;uid=数据库用户名;pwd=数据库密码
尤其要注意把redis的端口改为6379,项目默认的端口不是6379
ConnectionString": "127.0.0.1:6379,password=123456"
10、启动Jexus
sudo /usr/jexus/jws start
重启是sudo /usr/jexus/jws restart
11、访问服务器ip地址或者域名,查看是否成功。
至此部署完成。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.