The previous article describes the deployment to the IIS environment with VS release, today next to Ubuntu deployment asp.net core, do not need to install the. NET Core SDK, with the runtime mode of deployment, the use of Jexus server forwarding requests to ASP.net core.
1. Deployment Readiness Environment
VMware virtual Machines (others can also)
ubuntu16.04 Mirroring
2. Publishing environment
WIN10 system
vs2015 Update3 or vs code (you can also create a project with dotnet new-t Web command)
Dotnet SDK dotnetcore.1.0.0-sdk.preview2-x64 Download address https://www.microsoft.com/net/download Install yourself
First, use vs to create a asp.net core should be the program name Aspnetcoretest
1. Open Project.json
"Dependencies": {"Microsoft.NETCore.App": {"
Version": "1.0.0",
"type": "Platform"//delete this section
},
After modification
"Dependencies": {"
Microsoft.NETCore.App": {"
version": "1.0.0",
},
2. Add the following node
' runtimes ': {
' ubuntu.16.04-x64 ': {}
}
such as after modification
3. Remove the following nodes
"Scripts": {"
prepublish": ["Bower Install", "dotnet bundle"],
"postpublish": ["Dotnet Publish-iis--publish- Folder%publish:outputpath%--framework%publish:fulltargetframework% "]
},
4. Execute dotnet Restore in the project directory created by vs
5. Then execute dotnet publish-r ubuntu.16.04-x64, where the file is published to the project directory \bin\debug\netcoreapp1.0\ubuntu.16.04-x64.
6. Copy the publish from the ubuntu.16.04-x64 to the Ubuntu desktop , as shown below
7. Move this publish directory to the Moving/var/local/ command below sudo mv Publish/var/local and then look at the publish file.
8. settings should be the program file Execution permission is aspnetcoretest command sudochmod+x/var/local/publish/aspnetcoretest
Second installation jexus-5.8.2
1. Enter the TMP directory first: cd/tmp
2. Download Jexus: wget http://www.linuxdot.net/down/jexus-5.8.2-x64.tar.gz
3. Extract files to get Jexus folder:tar-zxvf jexus-5.8.2-x64.tar.gz
4. Move the extracted Jexus folder files to/usr: sudo mv jexus/usr/
5. Enter the/usr/jexus/directory to see what are: cd/usr/jexus/
6. Then enter the/usr/jexus/siteconf directory:CD siteconf
7. Open default profile with Editor:sudo vim default (editor downloads)
8. Add the following node, the main configuration is separated by semicolons, can not wrap.
apphost={cmdline=/var/local/publish/aspnetcoretest;workroot=/var/local/publish;env= (PATH=/var/local/publish:$ PATH);p ort=5000}
Description
Cmdline=/var/local/publish/aspnetcoretest//point to your Site directory application name such as Aspnetcoretest
Workroot=/var/local/publish//point to your Site Directory
port=5000//is forwarded to the ASP.net core port for Jesux because the asp.net core defaults to 5000 can be changed.
Save exit after configuration.
9. Execute sudo. The/jws start command turns on Jexus if it has been executed before sudo can be executed. /jws Restart mainly I was in siteconf to execute this command. /You can also go to the Superior directory Jexus to perform sudo./jws start
Common commands for Jexus:
Start:sudo./jws start
Reboot:sudo./jws restart
Stop:sudo./jws Stop
Start a Web site: sudo start site name
Restart a Web site:sudo restart site name
Stop a Web site:sudo stop site name
Visit the Localhsot
Success.
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.