'Unknown website after creating website using appcmd

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)

enter image description here

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?



Solution 1:[1]

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

Solution 2:[2]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Michael