Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

20 Dec 2011

Reading the documentation in /usr/share/doc especially the .gz compressed files

Have you ever wanted to read the the documentation in the /usr/share/doc directory. If you install apache it makes it nice and easy to read all the documentation that comes with most Linux packages.
First install Apache2
$ sudo apt-get install apache2 apache2-doc
apache2-doc is the special case here. It allows you to browse your documentation /usr/share/doc/ through your web browser. from

http://localhost/doc/

This does not work out right though. you need to change the configuration of apache to get it to decompress and show the *.gz files as plain text.
I posted on Stackoverflow to get a way to use the apache to show the content of *.gz documents in the /usr/share/doc/ directory. This is what was posted as possible solution
http://stackoverflow.com/questions/5242106/apache-gz-gzip-content-handler-for-linux-documentation-usr-share-doc-and-local

Here are those instructions in brief. It tells apache how to deal with .gz files to process them as plain text and send them to the browser as plain text.
 sudo a2enmod headers
 sudo a2enmod deflate
 gksu gedit /etc/apache2/sites-enabled/000-default
Go to the bottom of the file and find the section with Alias /doc/ "user/share/doc/" and change it to look like this.
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/local/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

    AddEncoding gzip gz
    <FilesMatch "\.gz$">
      ForceType text/plain
      Header set Content-Encoding: gzip
    </FilesMatch>
</Directory>   

 sudo apache2ctl restart
Now you are done and can read your *nix documentation that comes with most packages.

8 Sept 2007

Apache2 Documentation apache2-doc manuall problems

For those of us who want to find out how to fix the problem of apache2-doc at http://localhost/manual/ giving us junk like this

URI: index.html.de Content-Language: de Content-type: text/html; charset=ISO-8859-1 URI: index.html.en Content-Language: en Content-type: text/html; charset=ISO-8859-1 URI: index.html.es Content-Language: es Content-type: text/html; charset=ISO-8859-1 URI: index.html.fr Content-Language: fr Content-type: text/html; charset=ISO-8859-1 URI: index.html.ja.euc-jp Content-Language: ja Content-type: text/html; charset=EUC-JP URI: index.html.ko.euc-kr Content-Language: ko Content-type: text/html; charset=EUC-KR URI: index.html.pt-br Content-Language: pt-br Content-type: text/html; charset=ISO-8859-1.

Which is a type map, which is meant to allow for multiple languages in the documentation. It dose not work so to fix it try the following at this link.Apache2 Documentation doesn't work - Ubuntu Forums.

I changed these instructions a bit by
sudo mkdir typemaps
and
sudo mv *.html to ./typemaps/
which moved the all the *.html type map pages to the typemaps dir. so if I need to restore them I can. you could also just delete them with
sudo rm -f *.html
but then you have no way of retrieving them. This post dose not contain any documentation on modifying the /etc/apache2/apache2.conf file.

You may have to repeat the above instructions in some of the /usr/share/doc/apache2-doc/manual/ sub directories, like: developer, faq, howto, misc, mod, rewrites, programs, platform, ssl, and vhosts. As the documentation links to them as well.