A blog for Linux Lovers.

Archive for October, 2009

Posted by sibu on October 17, 2009

Options Directive

Using this Options directive controls  we can set server features  for a particular directory.

Options  can be set to None, in which case none of the extra features are enabled.

All :

All options except for MultiViews. (Default Settings).

ExecCGI :

Execution of CGI scripts using mod_cgi is permitted.

FollowSymLinks :

The server will follow symbolic links in this directory.

Includes :

Server-side includes provided by mod_include are permitted.

Indexes :

If the directory does not contain any  DirectoryIndex (e.g., index.html) in that directory, then mod_autoindex will return a formatted listing of the directory.

MultiViews :

Content negotiated “MultiViews” are allowed using mod_negotiation.

You have to be very care full while using + and - symbols with Options

For example, without any + and - symbols:

<Directory /home/sibu>
Options Indexes FollowSymLinks

<Directory /home/sibu/test>
Options Includes

then only Includes will be set for the /home/sibu/test directory.

If the second Options directive uses the + and - symbols:

<Directory /home/sibu>
Options Indexes FollowSymLinks

<Directory /home/sibu/test>
Options +Includes -Indexes

then the options FollowSymLinks and Includes are set for the /home/sibu/test directory.

Posted by sibu on October 17, 2009

Enable Server Side Include(SSI)

SSI (Server Side Includes) are directives that are placed in HTML pages, and evaluated on the server while the pages are being served.  Its use to add dynamically generated content to an existing HTML page.

SSI configurations

We must have mod_include module installed and enabled on apache. Also need to  have the following directive either in your httpd.conf file, or in a .htaccess file:

Options +Includes

This tells Apache that you want to permit files to be parsed for SSI directives.

It always better to tell Apache that which files should be parsed. There are two ways to do this. We can configure to parse any file with a particular file extension, such as .shtml, with the following directives:

        AddType text/html .shtml
        AddHandler server-parsed .shtml

One disadvantage to this approach is that if you wanted to add SSI directives to an existing page, you would have to change the name of that page in order to give it a .shtml extension.

The other method is to use the XBitHack directive:

        XBitHack on

XBitHack tells Apache to parse files for SSI directives if they have the execute bit set. So, to add SSI directives to an existing page, rather than having to change the file name, you would just need to make the file executable using chmod.

chmod +x pagename.html

Posted by sibu on October 10, 2009

MySQL information_schema error when using mysqldump utility

While executing the mysqldump command  you may have experienced following errors.

mysqldump: Got error: 1044: Access denied for user ‘root’@'localhost’ to database ‘information_schema’ when using LOCK TABLES

To quickly fix this problem use the following switch when running mysqldump for MySQL database backups.

mysqldump -u root -p -all-databases -single-transaction > all.sql