Dec 092009

I know a lot of people get the urge to consult the almighty Google for just about everything. But I found something very interesting about Linux and its documentation methods. Most of the installed programs on your system come with documentation in HTML format. This is very useful for finding out direct and straight-forward information and documentation. These “docs” can be found under “/usr/share/doc/”. But accessing these files can be a pain. So why not do it a better way: through the browser. And skip the trip to Google.

If you already have Apache (or some other HTTP (web) Server) installed then you can skip all this and try entering “http://localhost/doc/” in your browser. The screen you should get is below in the image. IF you don’t get something close to that then continue reading.

Things you will need: For this example we will be using Apache (HTTP) Web Server (I’m sure anything that will let you access your system via “http://localhost/” will do)

First things first: Install the Apache Web Server. In Fedora you can do this with

# sudo yum install apache2

Debian or Debian-based (Ubuntu …)

# sudo apt-get install apache2

Another option is to compile and install it from source. There are instructions on how to do that here. Once it is installed, there are two things you need to check. First make sure the following is in your “/etc/host” file:

127.0.1.1    <YOUR HOST NAME HERE>
127.0.0.1    localhost

Since you’re using Linux you probably don’t have to add anything. These lines will make your browser point back to your system whenever you type in “http://YOUR-HOST-NAME” or “http://localhost” in your browser.

Again, this step is probably not needed but it wouldn’t hurt to make sure your default Apache site configuration file (mine is “/etc/apache2/sites-available/default”) contains at least the following lines:

Alias /doc/ "/usr/share/doc/"
 <Directory "/usr/share/doc/">
 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order deny,allow
 Deny from all
 Allow from 127.0.0.0/255.0.0.0 ::1/128
 </Directory>

These few lines will point “http://localhost/doc/” to “/usr/share/doc/” and allow you to view the files and documentation in your web browser. Now make sure Apache is running with the following:

# sudo /etc/init.d/apache2 start

NOTE: if you already had Apache running and THEN you changed the above files, then you will need to restart Apache for the new settings to be taken into effect (“sudo /etc/init.d/apache2 restart”)

And that’s it! Now go to your web browser and type in – “http://localhost/doc/” – The trailing slash is important. You should get something like the following.

2009-12-09-020243_1280x768_scrot

Localhost Documentation - Without Google

You’re are currently viewing all the documentation files of (most) all the programs and apps installed on your system (anything under /usr/share/doc/). When you install a program, most of the time, it will dump some documentation files here. I find these files to be easier to look at than the vast volumes and volumes of web pages Google might return. Plus, most of this documentation is direct and contains the same information you would find if you looked up the info online.

There may not be documentation for every single program, but atleast you can view baisc information. Try looking at “ffmpeg”: I found this to have a nice “how-to” sheet. I was very amazed when I clicked on the “ImageMagick” folder: FULL documentation. You never know if what you’re looking for is in there until you search for it. In the end, I will consult this before I use Google, simply because it’s there, and it’s less information to sort through.

  • Share/Bookmark

Leave a Reply

(required)

(required)