Categories: Apache, Tomcat

Pages: 1 2 3 4 5 6 7 8 9 10 >>

07/28/10

Permalink 08:12:04 am, by admin Email , 17 words   English (US)
Categories: Apache

Parse .html files for PHP

Create a .htaccsss file containing the following lines:

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

03/23/10

Permalink 05:06:36 am, by admin Email , 42 words   English (US)
Categories: Apache

Disable ETags

Create a file at /etc/httpd/conf.d/no-etags.conf with the following:

Header unset ETag
FileETag None

Then of course restart Apache.

Here's a discussion on why you may want to turn ETags off:

http://www.askapache.com/htaccess/apache-speed-etags.html

03/19/10

Permalink 05:02:31 am, by admin Email , 111 words   English (US)
Categories: Apache

Canonical Rewrite Rules

Here's a good rule set for forcing use of a preferred url:

RewriteCond %{HTTP_HOST} !^desired\.domain\.name(:.*)?$  [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://desired.domain.name/$1 [L,R=301] 

This version of the canonical rewrite expands on the original found here:

http://httpd.apache.org/docs/2.2/rewrite/rewrite_guide.html#canonicalhost

by adding:

  1. redirects domains with suffixes (not just prefixes) back to the canonical host; and
  2. allows Host request headers to contain port specifiers (which is allowed by RFC2616 section 14.24)

as suggested here:

http://colby.id.au/node/99

and by using a 301 redirect as recommended by Google here:

http://www.google.com/support/webmasters/bin/answer.py?answer=44231&hl=en

02/07/10

Permalink 04:43:25 am, by admin Email , 54 words   English (US)
Categories: Apache, PHP

Turn on PHP register_globals with .htaccess file

It is of course a bad idea to write code that depends on register_globals for security reason, but sometimes when faced with old code it's a necessary evil. You can turn on register_globals for a site or directory by adding the following line to your .htaccess file:

php_flag register_globals on

11/17/09

Permalink 04:50:33 am, by admin Email , 42 words   English (US)
Categories: Apache

Apache - Remove Auth From Subdirectory

Assume that you have a folder that is restricted by HTTP Basic Auth but you want to allow access to a sub-folder. Here's how:

<Directory /var/www/vhosts/domain.com/httpdocs/myfolder >
   Satisfy Any
   Allow from all
</Directory>

1 2 3 4 5 6 7 8 9 10 >>

July 2010
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
        1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Reliable Penguin offers Linux Server Migrations, Systems Administration & Programming. Visit our main website at:

http://www.reliablepenguin.com

Search

Bookmark and Share

XML Feeds

powered by b2evolution