How to start IIS Express Manually - iis

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"

Related

aspnet_compiler Failed to map the path '/'

.NET 4.5.2, IIS 8.5 on Windows 8.1 x64. I have a single ASP.NET web site at /localhost/. The DEFAULT website is disabled, a new site with was created with the right bindings. I am trying to pre-compile it in place:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319> aspnet_compiler -c -v /
error ASPRUNTIME: Failed to map the path '/'.
I tried the metabase-path route:
aspnet_compiler -c -m lm/w3svc/2/root
error ASPRUNTIME: Failed to map the path '/'.
I Can get it to compile by specifying the physical path but I don't want to do that because this same application exists on different servers with different physical paths (devs, QA, production). Not even the metabase paths are all the same. "/" is the same everywhere.
For grins I added this to a page in the site to make sure i wasn't losing my mind:
Response.Write(Server.MapPath("/"));
and got what I expected.
What am I doing wrong?
This is a rights issue; apparently you need to be administrator to access the IIS metabase.
I see two possible solutions:
Use -p to specify the physical path; that way aspnet_compiler does not need to access the IIS metabase. (OP already explained this may not be a practical solution in a server cluster.)
Run aspnet_compiler from an elevated command prompt (i.e. "Run As Administrator"), as suggested here.

Tomcat Intellij Idea: Remote deploy

RackSpace Cloud Server Ubuntu-12.04, Intellij Idea-11.1.2, Windows-8, Tomcat-7.0.26, JDK-6.
On Intellij Idea when i try to run jsf project on my remote Tomcat 7 server it says:
Error running servername: Unable to connect to the ip-address:1099
It seems problem is about JNDI port which is 1099 but I couldn't activate it I guess. Tomcat config is sth. like that:
What I've tried?
Setting CATALINA_OPTS or JAVA_OPTS on the server side with:
CATALINA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
and
JAVA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
But this one did not work, any ideas?
My answer to my question:
The correct way to deploy remotely is editing JAVA_OPTS environment variable on the remote server. Just enter the command below:
export JAVA_OPTS="-Dcom.sun.management.jmxremote=
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
If that's not going to work and if you don't have any obsession to deploy your website via Intellij Idea, I've got the solution for this problem. To be able to run your website under Tomcat, you can/should get artifact in form of .war file.
It can be done in Intellij from project settings(ctrl+alt+shift+s) then hit the plus button and add new artifact(web:application archieve)
After rebuilding the artifact, .war file can be seen in project-folder\out\artifacts. Next, you should place this file into your tomcat/webapps folder.
For example if you are using Tomcat-7, the folder that I mean exists in /var/lib/tomcat7/webapps. Before copying your .war file you should rename it as ROOT.war. This provides to access your site directly by http://youripaddress:8080. After restarting Tomcat7 service you can access the site.
But not finished yet, you can debug your project remotely like you are debugging your project at your local machine with Intellij Idea. Open Run/Debug Configuration in Idea, hit the plus button and there must be Remote. This is the way to debug your projects for application servers like JBoss, Glassfish as well in Idea. Enter your host and port numbers, select your project as a module.
Before starting to debug, as Intellij says you should give the following parameter to your server JVM:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
To be able to do that in Ubuntu and for Tomcat-7, modified the catalina.sh file in usr/share/tomcat7 folder. I inserted the parameter above of the if [ -z "$LOGGING_MANAGER" ]; then line. It must be on the middle part of the file. Then you should be able to debug your project with Intellij Idea.

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

Where is the log file using Production profile with NServiceBus GenericHost and default log4net settings when installed as a service?

I have a very simple NServiceBus.Host.exe application that is using the default logging and the Production profile. According to the documentation, this should result in an appending file log that should appear in the same folder as the EXE. However, when I run the application as a service, the log file doesn't appear in the same folder as the EXE, and thus far I've been unable to locate it at all. The service is running as Local System. Do I need to run it as a user account and look for the file in the AppData folder somewhere? Is it under c:\windows somewhere? Where is it and is there a way for me to have it actually log to a file in the same folder as the EXE as advertised?
Update:
Using ProcMon and ProcExp from SysInternals, I can see that there is no attempt to create any log file in the folder where my EXE exists, nor are there any file permission errors while trying to create a log file anywhere, at least not from the PID of the service (if for some reason log4net spins up another process to do this work then I might have missed it).
It turns out that the service wasn't actually running in the Production profile. I had for some reason gotten it into my head that services would run in the production profile by default, while running it in interactive mode would use Lite by default. Not so - the service will use the Lite profile unless you specify otherwise. I changed my command to install the service from:
NServiceBus.Host.exe /install /displayName:MyService
to
NServiceBus.Host.exe /install /displayName:MyService NServiceBus.Production
and this fixed the issue.

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.

Resources