Occasionally when creating a web application in SharePoint 2013 it may be created and show in the list of web applications but the virtual directory will remain empty.
This is caused when the server provisioning the web application is experiencing low resources. To prevent this happening again increase resources on your server or move some services to another server.
To resolve allow the web application to be created successfully do the following:
- Open IIS
- Click on Application Pools and select your SharePoint Central Administration application pool
- Open advanced settings, change the Shutdown Time Limit (seconds) to 400. This will increase the timeout when creating web applications.
- Next return to SharePoint Central Administration, select Manage Web Applications
- Select your Web Application and click on Authentication Providers
- Click on default
- Without changing anything scroll to the bottom and click Save. This action will cause your IIS site to be recreated along with the virtual directory and its contents.
- Once this has completed your web application should work
Some forums recommend copying the files from another virtual directory, do not do this as you could copy over customisations that are not applicable to your web application.
Some also recommend restarting the Microsoft SharePoint Foundation Web Application. This will work but doing this will bring your entire SharePoint farm down whilst it completes and this can take hours.