Use jexus to deploy asp.net core rtm and ubuntu16.4jexus in ubuntu16.4
The previous article introduced how to use vs to publish and deploy it to the iis environment. Today we will deploy asp.net core in ubuntu without installation.. net core sdk, which is deployed in the runtime mode and uses the jexus server to forward requests to asp.net core.
1. Deploy and prepare the environment
Vmwarevm (other virtual machines can also be used)
Ubuntu16.04 Image
2. Release Environment
Win10 System
Vs2015 update3 or vs code (you can also use the dotnet new-t web command to create a project)
Dotnet sdk DotNetCore.1.0.0-SDK. Preview2-x64 https://www.microsoft.com/net/download self-Installation
I. First, create an asp.net core with vs. The program name should be 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 nodes
"Runtimes ":{
"Ubuntu.16.04-x64 ":{}
}
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 under the project directory created by
5. Run dotnet publish-r ubuntu.16.04-x64. The file is published to the project directory \ bin \ Debug \ netcoreapp1.0 \ ubuntu.16.04-x64.
6. Copy the publish under ubuntu.16.04-x64 to the ubuntu Desktop, as shown in figure
7. Move the publish directory to the dynamic/var/local/command as follows: sudo mv publish/var/local and check the files in publish.
8. Set the execution permission of the program file, that is, the aspnetcoretest command sudo chmod + x/var/local/publish/aspnetcoretest
2 install jexus-5.8.2
1. First enter the tmp directory: cd/tmp
2. Download jexus: wget http://www.linuxdot.net/down/jexus-5.8.2-x64.tar.gz
3. Unzip the file to get the jexus Folder: tar-zxvf jexus-5.8.2-x64.tar.gz
4. Move the unzipped jexus folder to the/usr Directory: sudo mv jexus/usr/
5. Go to the/usr/jexus/directory and check what is available: cd/usr/jexus/
6. Go to the/usr/jexus/siteconf Directory: cd siteconf
7. Open the default configuration file in the editor: sudo vim default (which can be downloaded by the editor)
8. Add the following nodes. The configuration items are separated by semicolons (;). line breaks are not allowed.
AppHost = {export line =/var/local/publish/aspnetcoretest; workRoot =/var/local/publish; env = (PATH =/var/local/publish: $ PATH ); port = 5000}
Description
Export line =/var/local/publish/aspnetcoretest // Application name pointing to your site directory, such as aspnetcoretest
WorkRoot =/var/local/publish // point to your site directory.
Port = 5000 // the port that is forwarded to asp.net core by jesux, because asp.net core can be changed to 5000 by default.
Save and exit after configuration.
9. execute sudo .. /jws start command to enable jexus. If you have previously executed jexus, You can execute sudo .. /jws restart is mainly used to execute this command in siteconf .. /You can also go to the parent directory jexus to execute sudo. /jws start
Common Jexus commands:
Start: sudo./jws start
Restart: sudo./jws restart
Stop: sudo./jws stop
Start a Website: sudo start website name
Restart a Website: sudo restart website name
Stop a Website: sudo stop website name
Access localhsot
Successful.
Exchange and make progress together.
Original address http://www.cnblogs.com/Dream618/p/5667203.html