Got an alert stating IIS 7 role unavailable, when checked found that the service named World Wide Web publishing service was not starting. This could be in case the IIS isn’t shutdown cleanly. This could break the services like World Wide Web publishing service (w3svc).
In that case, we can fix the issue by resetting the IIS by executing the commands
# iisreset /stop
# iisreset /start
taskkill /F /FI “SERVICES eq w3svc”
Finally, restarting the IIS would fix the issue.