Unknown website after creating website using appcmd

5.7k views Asked by At

I am using IIS 8.5 (Windows 8.1). I tried to create a website to my local IIS using the appcmd tool. I used those pages as reference (I know they are for IIS 7 but I couldn't find the equivalent for IIS 8):

Here is the command I used:

appcmd add site /name:fakeAbsorbApi /physicalPath:C:\development\ecms\build\deploy\fakeAbsorbApi /bindings:http:/*:9898

I receive the following feeedback:

SITE object "fakeAbsorbApi" added
APP object "fakeAbsorbApi/" added
VDIR object fakeAbsorbApi/" added

but if I check my IIS Manager, it shows the website as "unknown," and I can't do anything with it. (It seems that the web config is not being detected)

Screenshot of IIS Manager with "X" on new website

I tried to create the same website using the same parameters via IIS Manager (pointing to the very same folder) and the website it created works perfectly.

Anything I am missing?

2

There are 2 answers

0
Adam On BEST ANSWER

Hey it looks like you have an extra colon on the bindings flag. Also you need to add a host header after the port number. I fixed it below.

C:\Windows\System32\inetsrv>appcmd add site /name:fakeAbsorbApi /physicalPath:C:\development\ecms\build\deploy\fakeAbsorbApi /bindings:http/*:9898:www.domain.com
0
Michael come lately On

If you do not include an Application Pool in your arguments, appcmd may choose the "DefaultAppPool" for you. If that app pool does not exist, the site will be created in the "Unknown" state.