I want to now what is the easiest way to deploy asp.net site to a windows server? Normally we do by uploading files through FTP client.
But as we can checkout repository on linux server and just running "svn up" command though SSH deploys the latest changes, is there any similar way on windows?
Thanks
Web deployment tool is what I use. It can be automated from the command line, and MSBuild can be used to generate deployment packages if you use a CI server. On the simplest level though it supports 1 click deploy from the toolbar in Visual Studio (probably only recommended to development servers).
You can do nearly the same thing on Windows.
Use Remote Desktop Connection to
access the server (this is the
windows counterpart of SSH)
Run "svn
up"
An SVN client doesn't ship with Windows, but the client ports from SilkSVN and CollabNet work just as well as any other.
Related
I have now a working Website that I have deployed to the IIS on my local machine using Visual Studio 2013. I can access the website successfully from other machines in my office and in neighboring offices. I have even had others check the access from geographically remote locations, and still been successful. The access method is to put my machine's IP Address and add the name of the application, ###.###.###.###\name, into the address bar of a browser.
The next step is to promote it to production. We are not using Azure, so the tutorials for promotion to production I have found aren't useful, nor are we using 3rd party providers.
The method I have conceived is as follows:
Have an admin directly login into a company server
install the database software
install Visual Studio
install IIS
copy the local machine's db to the server db
copy the locally deployed files to the server
admin login into Visual Studio
deploy the site on the server in the same way it was deployed on the local machine
use the server IP or update the host file on all networked computers to map the IP to an appropriate name (or the local network has a local DNS we can update)
This would allow me a DEV environment (the VS IDE), a TEST env (locally deployed version), and a PROD env (the version deployed on the server).
I don't see any reasons why this wouldn't work, maybe a bit tedious, but workable.
Is this method ok? Am I missing anything critical?
No, this is an altogether inappropriate way to push a build to a production environment.
Your source code should be stored in a source code repository. You should have an automated, continuous build server pull from the repository and complete the build in a dedicated environment that is itself under change control. The build should include the generation of installation files, e.g. a click-once deployment package. From there you can have an admin run the deployment package, or, ideally, you'd push it automatically with a tool like Octopus.
The above, honestly, is the bare minimum for a commercial web site. There is much, much more you can do to make things even more robust, e.g. blue-green deployment.
Note that none of this involves installing development tools like Visual Studio on your server. The server should stay as clean as possible, running the fewest applications that you need, to minimize any sort of attack surface and to keep the machine running efficiently.
Dont Put Yours Machine IP, Decompilers Can Take It And BruteForce Your IP To Remote Acess Your Machine.
I will run an asp.net application on a linux system with mono.
The application run on the iis without problems.
I published the application with VS to the IIS.
I put the same content to my linux machine.
The file structure looks like this for the IIS:
How can I start this application on a linux machine with mono?
It depends what you are wanting to do. You could use Mono XSP4, which is a web server distributed with mono (primary use is for debug and therefore has limitations but it will run your site).
You can find installation instructions on the mono project web site (http://www.monodevelop.com/download/linux/). The package on ubuntu is called mono-xsp4 but you will need to add the mono project repos.
Once installed running it is simple:
$ cd /path/to/your/aspnet/project/root
$ xsp4
This will fire it up and run it on the default port with an option to kill it from the command line by hitting enter.
A few options to help:
$ xsp4 --nonstop --port=443 --https --cert=/my/cert.crt --pkfile=/my/key --pkpwd=mykeypwd
Non stop means the server will run without ability to stop using enter. Port is self-explanatory. The rest of the options are about running with HTTPS should you want to do that.
Hope this helps. Happy coding.
A little background (before I get downvoted to oblivion!)
I'm working on an intranet-hosted ASP.NET web application in a highly secure environment. At the moment it's deployed by building a package in Visual Studio, the zip file is copied onto the server and installed in IIS using WebDeploy (right-click -> Deploy -> Import Application).
What I'd like to do is deploy a sanitised version of this application to an Azure Web Site for demonstration purposes, however most of the standard Azure deployment methods do not apply to me because:
I work on a secure network so Visual Studio is blocked from connecting to Azure (rendering 95% of documentation irrelevant!)
installable software is strictly controlled on this network so I cannot install the Azure SDK needed to create Service Definitions, Configurations and Packages
The only machine I have access to which can connect to Azure is woefully underpowered and can only run puTTY, PowerShell and basic text editors.
At the moment, I have a Windows VM in Azure just running IIS and WebDeploy - this works but seems like overkill (and a good way to burn through my credit) when Web Apps in theory do everything I need.
What can I do?
Another option may be to checkin the WebDeploy package to a free subscription of Visual Studio Team Services (VSTS = TFS in the cloud) and then create a deployment pipeline in VSTS using the new Release Management features.
https://www.visualstudio.com/features/release-management-vs.aspx
in that case:
1) FTP from your machine using your own FTP client or i would recommend to use PSFTP from Putty package.
2) Still WebDeploy, but use that to generate the needed files, then you can use PowerShell like that.
You can also use https://www.microsoft.com/web/webmatrix/ to connect to azure websites. It works with HTTP, only problem could be a corporate proxy.
We have a web application we've been writing in VB.NET. We want to get that running within a Linux server, specifically CentOS. I installed Mono version 4.0.1 on the server, as well as xsp and mod_mono. I'm not sure however, how to properly configure the setup to get the application running. We have several .aspx and .dll files. Do I just FTP them over to the server? I think we would need some wrapper executable script to get the application going, since all the websites I have been looking at state that, but I'm not sure how that works for a web application.
If you are using Visual Studio, you should use FTP to deploy your asp.net applications into GNU Linux environment. The IDE would take care of what files has to be deployed in order to get your asp.net application working.
But if you are using MonoDevelop you could use SSH Fuse. Here you have a Getting Started guide about working and deploying ASP.NET apps from MonoDevelop to an Linux environment:
http://www.monodevelop.com/documentation/creating-aspnet-projects/
If you don't have experience with FUSE, don't worry I get this for you
https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh
That's all. You don't need a wrapper as you mentioned before, it is pretty much like and an standard IIS site. Quite easy right? It has to work always that your application and its dependencies are compatible with mono, and indeed with apache or xsp configured correctly.
Cheers!
I'm using the built in web server in Visual Studio to test some pags but I wanted to be able to connect to it from other machines to test out browsers on different platforms. I was wondering if it was possible to configure that server to listen to an external interface or if I have to throw this over to IIS. I've turned off the windows firewall so that shouldn't be an issue.
Not with the default ASP.NET Development Web Server. You could probably use Cassini if you don't want to use IIS.
I would use SVN and setup a test server to automatically have the SVN updated on the tested server.
What I have done in the past is setup a SVN repository and add my sites into it. And on the test server setup a running copy of the repository and have a scheduled task automatically update it every 5mins. This works great since I dont have to worry about ftping or any thing. Works great since I use VisualSVN and Commenting my changes is easy.