/usr/sbin/apache2ctl: 124: www-browser: not found

I'm configuring my new VPS to host a Rails application with Apache and Passenger. I have an other VPS up and running, I configured months ago.

On the new one I installed Apache and its packages via aptitude, as I did on the first one. Running the following command on the newest VPS returns a successful response

root@www:/etc/apache2# apache2ctl status
Apache Server Status for localhost

Server Version: Apache/2.2.8 (Ubuntu)
Server Built: Jul 10 2009 18:47:48
...

The same command on the older VPS returns the following error

root@www:/etc/apache2# apache2ctl status
/usr/sbin/apache2ctl: 124: www-browser: not found

I don't have any kind of problem with Apache on this VPS, however I'd like to know how to fix this error.


As Phillippe said, install a command-line browser like lynx, links, or elinks to make this work.

The reason why it's happening is that the apache2ctl status command actually makes a request to the web server to check what's going on. It works on the other VPS because that's got a command-line web browser already installed (probably pulled in as a dependency of another package). I agree that the error message could be better, although if you examine the "Suggests" for the apache2.2-common package, www-browser is mentioned there.


Ok, I should have found the solution. Investigating the differences between the two servers, I found that the following command

/etc/alternatives/www-browser

in the older server returns

root@www:/etc/apache2# /etc/alternatives/www-browser
-su: /etc/alternatives/www-browser: No such file or directory

while on the younger

root@www:~$ /etc/alternatives/www-browser
w3m version w3m/0.5.1+cvs-1.968, options lang=en,m17n,image,color,ansi-color,mouse,gpm,menu,cookie,ssl,ssl-verify,external-uri-loader,w3mmailer,nntp,gopher,ipv6,alarm,mark,migemo
usage: w3m [options] [URL or filename]

The younger comes with w3m text browser installed. In order to check the status, Apache needs a text browser to use.

Running the following command on the first server fixed the problem.

aptitude install w3m

Off course, ELinks or lynx whould be valid alternatives as well.


'www-browser' is the name of a virtual package. Try to install elinks (or links or lynx or whatever you prefer) by typing aptitude install elinks.