I would like to automate the process of deploying a new build of an existing site and allow for me to go back to the previous version of the site easily. Up until this point I have been copying my new build to the production server and placing it into a folder with a build number associated with it. Through the IIS user interface I would stop the site and then change the physical path on the site pointing it to my new build. If for some reason I would need to back the changes out I would simply go back into IIS and stop the site and point it back to the previous build.
I see where I can use appcmd to stop and start the site. I just can't find any way to change the physical path property on the site.
Thanks for you help.
you could probably use powershell Intro to Power Shell for IIS7
EDIT: This Page has examples for creating websites and applications in IIS with powershell.
Based on the samples it should be something like this:
Set-ItemProperty IIS:\sites\DemoSite\DemoApp -physicalPath C:\DemoSite\DemoApp -type Application
Related
Currently we have following structure:
web
build0001
build0002
build0003
So, each time we deploy new version of web application, we create folder with build number and then change path in IIS to use that directory.
Now question is, can I do same thing with msbuild:
1) publish to web\buildxxxx
2) and update IIS setting to use web\buildxxxx for that site.
While currently I doing all this in same server, in the future I'll need to do this on remote servers also, meaning that I'll running msbuild from different server than IIS is.
So far I've came to this:
"C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe"^
-verb:sync^
-source:contentPath="c:\stageDir"^
-dest:contentPath="c:\web\build0004",computername="https://remoteServer:8172/MsDeploy.axd?site=MySite",UserName="DeployUser",Password="xxx",authType=Basic^
-enableRule:DoNotDeleteRule^
-allowUntrusted^
-postSync:runCommand="C:\windows\system32\inetsrv\appcmd.exe set vdir MySite/ -physicalPath:c:\web\build0004"
Problem with this approach is, that is requires a lot of permissions, because of these things:
build0004 at the moment of syncing is out of current website's folder (say build0003), so it requires DeployUser to have administrative rights.
I need ability to use runCommand, which requires even more - allow WMSVC to run commands.
I finish creating my website using Visual Studio 2010.. also I already have a domain name... My question is how do I publish/upload my website to my domain through the FTP server... I'm a total newbie at this and web tutorials are so complicated It makes my brain bleed...
I already tried using copy website but my website fails to appear on my domain... instead only my scripts/ ".aspx files" and resources appear on the page... in hyperlink format...
I also tried to publish the website but the same happened...
You are going to have 2 choices most likely. One is going to be some sort of ftp (or secure ftp). The other would be web deploy if the host offers it. What you want to do is publish your project to your local file system and then copy THAT output to the ftp (www) root (most likely). If you have web deploy you can also set that up in the publish settings in visual studio. Your web host should be able to provide the info you need in that case.
you need to publish your project to iis. make sure your iis is activated first in your machine, and initialize your asp framework with the iis. after all the setup are complete, then you can publish your project.
I just change the Properties of my asp.net project like given below.
Property\Web\Use Local IIS Web Server \ Project Url: http://domain.com
Property\Web\Use Local IIS Web Server \ Override application root URL: http://domain.com
But after the commit in svn. The changes got reflected in other team members's project. Because these settings are in project file of application.
I also can't ignore this project file from commit. Because in this case other member won't be having proper update of my work from svn.
How can i keep these setting only personal to me, while keep committing the project file of the web application.
If you keep those changes in the project file you'll inevitably cause problems with versioning within SVN, which is not the best way to go. One approach is to leave the project settings as they are (I'm assuming that you're using IIS and everyone else is using Cassini or IIS Express) but create a website within your local IIS. Then, instead of running the application via F5 or CTRL-F5, manually attach the debugger to the ASP.NET worker process via Debug > Attach to process.
I'm trying to deploy my ASP.net webpage on my local using IIS base on the steps from this site http://www.shubho.net/2011/01/quick-deployment-of-aspnet-applications.html
However, when I'm trying to do an import application, the option wasn't available. I tried reinstalling MSDeploy, but it still didn't work.
Any one had an idea of how to set my application importing?
Regards
All you need to do to publish to local is Click the publish and create "New". Then when asked in the wizard instead of Web Deploy select "File System", then in the target location browse to C:\inetpub\wwwroot\YourFileName. Make sure VS is in Release Mode to publish. In IIS 7 you will set up a new site and make sure you set the Directory to the same file location. Then your Done. If you need more help you can email me at roman.appsllc#gmail.com and I will send you a walk through with images.
I'm trying to use NAnt/NAntContrib build script to build a web application on Windows 2008 (IIS 7.0).
In the build file, there is mkiisdir task, which fails with:
[mkiisdir] The webservice at 'localhost' does not exist or is not reachable.
All the documents/posts I found so far (non for w2k8, only Vista) say to install IIS 6 Compatibility services (all of them, including scripting tools, etc.) So I did, but it still throws this error.
Any idea what else need to be changes, so NAnt be able to create/delete virtual directories on IIS 7.0?
EDIT: New data - when I log in as local administrator to this server, the nant task succeeds, but it fails when I log in as a domain admin. I have added the domain admins group in the local Administrators group, but it still fails. Any idea what other permissions I need to check/change in order to make my domain admin user to be able to execute this task? I can create manually virtual folders without any problems.
In order to get iis nantcontrib tasks to work you need to install IIS6 Management Compatibility Tools. Here is the blog describing how to do it in Vista:
http://thoughtworker.in/2008/01/15/nant-the-webservice-at-localhost-does-not-exist-or-is-not-reachable/
Here is a screenshot of how to do it in Windows Server 2008:
alt text http://img407.imageshack.us/img407/699/iis6tools.png
To answer my own question - I have isolated the part of the code in NantContrib which was causing the problem, and made a sample application to test.
I have posted this as a separate question here, and there is the solution as well.
Cheers