IIS Import/Export Application is missing on Windows Server 2012 - iis

We've got a new Application Server and I have to set up the IIS.
Unfortunately, the Import Application of the Default Web Site is missing...
I couldn't find where I have to activate / install something to get these items...
Can you help me where to find this option to enable the Deployment-Category?
Thanks in advance

If you don't get it working you can always do it with CMD:
Export:
%windir%\system32\inetsrv\appcmd list app "%WEBSITENAME%/%APPLICATION%" /config /xml > C:\Users\%username%\Desktop\%WEBSITEXML%.xml
And for Import:
%windir%\system32\inetsrv\appcmd add app /in < C:\Users\%username%\Desktop\%WEBSITEXML%.xml
You can make your own small bat app out of this...

Related

2 older IIS 7 Servers moving to 1 new IIS 10 Server. Got 1 working, how do I get the second one in?

I've got 2 IIS 7 servers, each has a couple of apps/sites under the "Default Website" directory. I used MSDeploy to package and deploy one of them, and fixed some assembly and pointer issues to get the sites up and running. Then I used MSDeploy to package and deploy the second server, and it totally overwrote the "Default Website" wasting about an entire days work. How can I get the other apps/sites that are under Default Website "merged" into the new Default Website without overwriting what's already there. Thoughts?
This is the default behavior if you import configuration it will override the editing one. to avoid this behavior you have to try a workaround for this. use iis web deploy command line to export and import the site and application pool:
To Export all your website:
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml
This will export all the websites on your webserver, therefore you need to edit the sites.xml and remove the websites that you do not need to import for example:
Default Website
And all other websites that already exist on the second webserver. or you could rename it and then import it.
To Import the website:
%windir%\system32\inetsrv\appcmd add site /in < c:\sites.xml
To Export the Application Pools on IIS :
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml
To import the Application Pools:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml
It’s also possible to export a single website or application pool all you need to do is add the name of the Application Pool or Website to the command line:
To export/import a single application pool:
%windir%\system32\inetsrv\appcmd list apppool “MyAppPool” /config /xml > c:\myapppool.xml
Import:
%windir%\system32\inetsrv\appcmd add apppool /in < c:\myapppool.xml
To export/import a single website:
%windir%\system32\inetsrv\appcmd list site “MyWebsite” /config /xml > c:\mywebsite.xml
Import:
%windir%\system32\inetsrv\appcmd add site /in < c:\mywebsite.xml

Enabling basic http authentication in IIS on Elastic Beanstalk?

For a demo site on Elastic Beanstalk, I'd like to enable basic authentication in IIS (not in the app, but instead have IIS handle it). I can't find how to configure IIS to do this - you don't seem to have much access to IIS configuration itself. Any tips on that appreciated, or if I'm missing the boat here.
thanks!
You need to use ebextensions to customize the server.
Create a yaml init.config file inside a folder called .ebextensions in your web application root. Set the contents as follows:
container_commands:
00-iis-features:
command: dism /online /enable-feature /featurename:IIS-BasicAuthentication
Read more about ebextensions here
Also, see my answer here https://stackoverflow.com/a/42336644/1165140 on how to modify root IIS config.
Hope this sorts you out.

Export IIS Configuration

I want export my IIS Configuration at IIS 7.5 over Shared Configuration.
I get an error message:
Export of configuration files failed.I have no entries at Eventlog, IIS or anything else.
I hope somebody can help me,
Horst
This works form me:
Stop IIS Server
Delete all files under C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys
Uncheck the shared configuration.
After this steps, I can export the configuration and also set the shared configuration again.
Horst
Open CMD as Administrator and run:
IISRESET -STOP
Then move all files in
C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys to another folder
except
c2319c42033a5ca7f44e731bfd3fa2b5_5630a856-d018-483a-866a-3b9512d1e19e
Then run: IISRESET -START
It should work fine

How to Run PHP on IIS7.5 Express?

I have Win XP SP3 and have installed IIS7.5 Express and want to run PHP on it.
I am able to run simple HTML code on the server, I am able to start and stop the server by running iisservices.exe, but I am not able to run php scripts on it.
If I have the following PHP file:
<? php
echo "hello world";
?>
<html>HI</html>
The output is HI but the PHP script doesn't run.
I have followed the steps described in this article to install PHP:
http://learn.iis.net/page.aspx/724/install-and-configure-php/
But can't proceed from step 10 onwards because IIS Express doesn't have an IIS Management Console MMC snap-in.
How do I configure IIS Express to run PHP?
Assuming you've carried out steps 1 - 9 in the article you linked to and have your PHP files extracted to c:\php then complete the following steps using a cmd.exe command prompt:
Firstly we need to configure IIS Express and setup a handler for PHP
cd "\Program Files\IIS Express"
appcmd set config -section:system.webServer/fastCgi /+"[fullPath='C:\PHP\php-cgi.exe',arguments='',maxInstances='4',idleTimeout='300',activityTimeout='30',requestTimeout='90',queueLength='1000',instanceMaxRequests='200',protocol='NamedPipe',flushNamedPipe='False',rapidFailsPerMinute='10']" /commit:apphost
appcmd set config -section:system.webServer/handlers /+"[name='PHP-FastCGI',path='*.php',modules='FastCgiModule',verb='*', scriptProcessor='c:\php\php-cgi.exe']" /commit:apphost
Assuming your PHP website resides in c:\MyPHPWeb we create a site in IIS Express that listens on http://localhost:32701:
appcmd add site /name:"MyPHPApp" /bindings:http/*:32701: /physicalPath:"c:\MyPHPWeb"
Next start the site:
iisexpress.exe /site:MyPHPApp
And finally browse to your PHP page:
http://localhost:32701/test.php
Option-1: (From command line)
Go to IIS Express installation folder (%programfiles%\iis express)
Run following two commands
appcmd.exe set config /section:system.webServer/fastCGI /+[fullPath=**'c:{php_installation-folder}\php-cgi.exe'**]
appcmd.exe set config /section:system.webServer/handlers /+[name='PHP_via_FastCGI',path='.php',verb='',modules='FastCgiModule',scriptProcessor='c:{php_installation-folder}\php-cgi.exe',resourceType='Unspecified']
Option-2: (Using UI)
Install WebMatrix (from http://www.microsoft.com/web/webmatrix/)
Start WebMatrix and choose 'Site From Folder' option and select your php file folder and click OK
In the WebMatrix left pan select Settings (bottom of the left pan select 'Site' and on the top of the left pan select 'Settings')
In the settings tab, check the PHP check box, this would install PHP and configure for you.
Click 'Restart' button in WebMatrix to restart IIS Express
In WebMatrix left pan bottom select 'Files' and on the top of the left pan (tree view), you should see your php page and now right click on this page node and select 'Launch in Browser'
Download php installer.
It should let you choose what type of server, so choose IIS and then it should work from there.

How to start IIS Express Manually

Is there a command line program or service that I can use to start IIS Express manually?
iisexpress program is responsible for that.
http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line
Once you have IIS Express installed (the easiest way is through Microsoft Web Platform Installer), you will find the executable file in %PROGRAMFILES%\IIS Express (%PROGRAMFILES(x86)%\IIS Express on x64 architectures) and its called iisexpress.exe.
To see all the possible command-line options, just run:
iisexpress /?
and the program detailed help will show up.
If executed without parameters, all the sites defined in the configuration file and marked to run at startup will be launched. An icon in the system tray will show which sites are running.
There are a couple of useful options once you have some sites created in the configuration file (found in %USERPROFILE%\Documents\IISExpress\config\applicationhost.config): the /site and /siteId.
With the first one, you can launch a specific site by name:
iisexpress /site:SiteName
And with the latter, you can launch by specifying the ID:
iisexpress /siteId:SiteId
With this, if IISExpress is launched from the command-line, a list of all the requests made to the server will be shown, which can be quite useful when debugging.
Finally, a site can be launched by specifying the full directory path. IIS Express will create a virtual configuration file and launch the site (remember to quote the path if it contains spaces):
iisexpress /path:FullSitePath
This covers the basic IISExpress usage from the command line.
From the links the others have posted, I'm not seeing an option. -- I just use powershell to kill it -- you can save this to a Stop-IisExpress.ps1 file:
get-process | where { $_.ProcessName -like "IISExpress" } | stop-process
There's no harm in it -- Visual Studio will just pop a new one up when it wants one.
Or you simply manage it like full IIS by using Jexus Manager for IIS Express, an open source project I work on
https://jexusmanager.com
Start a site and the process will be launched for you.
There is not a program but you can make a batch file and run a command like that :
powershell "start-process 'C:\Program Files (x86)\IIS Express\iisexpress.exe' -workingdirectory 'C:\Program Files (x86)\IIS Express\' -windowstyle Hidden"

Resources