Use jexus to deploy the ASP. NET Core Environment in ubuntu16.4, and ubuntu16.4jexus
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. Run the following command in the project directory created by:Dotnet restore
5. Run dotnet publish-r ubuntu.16.04-x64,Release the file 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., Such
7.Put thisPublish directory moved to/var/local/Run the following command to sudo mv publish/var/local and check the files in publish:
8.Set the execution permission of the program file, that isAspnetcoretest command sudochmod + 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. decompress the file to get the jexus Folder:Tar-zxvf jexus-5.8.2-x64.tar.gz
4. Move the unzipped jexus folder to/usr:Sudo mv jexus/usr/
5. Go to the/usr/jexus/directory and check what is there: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 (automatically download 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.
The above is all the content of this article. I hope it will be helpful for your learning and support for helping customers.