editing vhost.conf : Service is not available now, probably your Plesk is misconfigured
[This article is aimed at web developers who have medium level knowledge of Apache server administration]
I was deeply involved in hacking away at various proxy directives and had added some lines to my Apache Configuration (by editing the vhost.conf file for one of my virtual accounts on a LAMP server that was running PLESK 8.2 as a VPS Hosting package from WebFusion).
I had added the following BAD lines in my config :
…
#never let this setting be anything other than off
#otherwise we could turn into an open relay!
ProxyRequests off
#only because the above line of code is OFF
#can we do this next directive safely
<Proxy http://www.example.com/*>
Order allow, deny
Allow from all
</Proxy>
…
[IMPORTANT WARNING : the code sample above should not be copied and pasted into your own config file without fully understanding the ProxyRequests directive]
After editing the vhost.conf file, changes don’t come into effect until you have restarted Apache. So, I did this within PLESK at: System > Server > Service Management > {and then clicking on the orange button next to Web Server (Apache)}
Once I had done this - I got the error:
Top > Virtuozzo
Service Unavailable Active Tasks
Service is not available now, probably your Plesk is misconfigured.
Contact Your provider for details.
Internal Plesk error occurred: Unable to make action: Unable to manage service by websrvmng: websrvmng: Service /etc/init.d/apache2 failed to start
Because I was messing about with Proxy Directives (and I was suffering from a kind of tunnel-vision-debug-thinking) - I was convinced that the config error was caused by an issue regarding proxies.
That was not the case - I eventually discovered that it was a syntax error in the configuration
These are the CORRECT lines that worked in my config :
…
#never let this setting be anything other than off
#otherwise we could turn into an open relay!
ProxyRequests off
#only because the above line of code is OFF
#can we do this next directive safely
<Proxy http://www.example.com/*>
Order allow,deny
Allow from all
</Proxy>
…
See the glaring mistake?
Yes - thats right … the line:
Order allow,deny
should have NO SPACE between the comma and the ‘d’ of deny.
See mod_access > ORDER for more info (where it says “Keywords may only be separated by a comma; no whitespace is allowed between them.”)
Other Indications of Server Misconfiguration (for your interest)
Whilst attempting to look at the website on that virtual account Firefox 3.07 showed the following error message:
Connection Interrupted
The document contains no data.
The network link was interrupted while negotiating a connection. Please try again.
[Try Again]
whereas IE 7 showed this error message:
Internet Explorer cannot display the webpage
Most likely causes:
You are not connected to the Internet.
The website is encountering problems.
There might be a typing error in the address.
…
Also for your interest:
I was running Apache/2.0.55 on Ubuntu
October 19th, 2009 at 5:30 pm
Hi Hacker,
I came here searching for relation between htaccess and mod_proxy, I read in a post that the htaccess file can accept absolute path only if mod_proxy is enabled. Do you have any idea on this?
November 4th, 2009 at 10:10 pm
I am not sure of the answer to that question.
However you could probably find the answer by investigating the RewriteRule directive which can become proxy-like by using the [P] flag.
Weird though it seems RewriteRule is the place to look with regard to proxying within the .htacess, rather than ProxyPass (which, in Apache HTTP Server Version 2.0, is limited to just : server config, virtual host, directory contexts).
In fact as i was digging up a link to it i noticed it says “[P] … mod_proxy must be enabled in order to use this flag.”
see:
rewriterule:
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule
ProxyPass
http://httpd.apache.org/docs/2.0/mod/mod_proxy.html#proxypass
Basically, if you are into proxying, you either have to have mod_proxy enabled by your host or enough access to the system to be able to enable it yourself.