Recently I configured a virtual host in Litespeed outside of the normal Virtual Host Template I use. Typically I use the EasyRailsWithSuEXEC but this time I needed to use the PHP_SuEXEC template. It was easy as most configurations are with the LiteSpeed however when I performed a graceful restart I noticed that the virtual host I had just configured was showing “Restart Required” instead of “Running” as shown in the image below.
Initially I thought that I would need to do a hard restart of the server maybe because I was using a new Virtual Host Template however doing so did not resolve the issue. I next moved on to examining the log and quickly noticed the issue was an option I did not expect added by the PHP_SuEXEC Virtual Host Template. The LSWS logs showed the below error.
- 2009-03-09 14:19:40.941 [ERROR] [config:vhost:sub-domain.example.com] Path for document root is not accessible: /var/www/html/sub-directory/public_html/
- 2009-03-09 14:19:40.941 [ERROR] [config:vhost:sub-domain.example.com] configuration failed!
When you add the home directory in the Virtual Host Template configuration it automatically adds /public_html to the end of it. Needless to say this directory did not exist on my server and thus the virtual host would not start. I removed the /public_html by following the below steps.
- Open Virtual Host: Click Configuration in the top navigation menu and select “Virtual Host” from the drop down. Now click on the View/Edit link to the right of the virtual host you want to edit.
- Edit Document Root Setting: Now click on the General tab and then click Edit at the top right of the General configuration box. Modify the Document Root setting and then select Save.
- Gracefully Restart: For the change to take effect you need to click Actions in the top navigation and select “Gracefully Restart” from the drop down menu. Verify you want to restart the server and once this is completed the Virtual Host should now show as Running.
Make sure to visit the new virtual host in a web browser to make sure it is running properly. If the Document Root setting is not your problem I would investigate the logs anyway as that should provide a clear cut answer as to what configuration issue is causing the Virtual Host to not start up correctly.