• PHP
  • Ruby on Rails
  • MySQL
  • Linux
    • SELINUX
    • Fedora
    • debian
  • Apache
  • nginx
  • AJAX
Albertech.net

Category Archives: Apache

Fix: WordPress with password protected subdirectories

July 12, 2012 9:51 am / Albertech.net
wp

If you use WordPress on your root web folder, subdirectories password protected with .htaccess do not work. Users will not get the ability to put in their username and password to access the page. The Apache rewrite rules included in WordPress will forward users to the 404 error page instead.

To get around this, you will need to create a 401 error page in the web root directory (e.g. ~/public_html/401.html) and add the following line to the .htaccess file located in your web root directory.

ErrorDocument 401 /401.html

This also works for other apps using Apache Rewrite Rules, such as Drupal.

Share this:

  • Facebook
  • Google +1
  • Twitter
  • Print
  • Email
Posted in: Apache, wordpress / Tagged: Apache, rewrite, subdirectories

Qualys SSL Labs – SSL web server testing

April 24, 2012 2:49 pm / Albertech.net

Qualsys SSL Labs is a free resource to test your SSL web server configuration. It’ll test for vulnerabilities, certificate validity, supported standards, and more.
https://www.ssllabs.com/ssltest/index.html

 

Share this:

  • Facebook
  • Google +1
  • Twitter
  • Print
  • Email
Posted in: Apache / Tagged: ssl testing

Modifying awstats to show total hits for matching files

November 3, 2011 1:22 pm / Albertech.net

Here’s a quick modification to awstats that allows you to add a totals field for the “Viewed – Full List” option. There isn’t a total hits field for matching files in awstats, so I added one to make it more useful. This makes it a lot quicker to total up hits for a specific folder, file type, or specific file in awstats.

Read More →

Share this:

  • Facebook
  • Google +1
  • Twitter
  • Print
  • Email
Posted in: Apache / Tagged: awstats, code, mods

Setting up mod deflate on Apache2 for Debian to reduce server bandwidth

June 8, 2011 12:28 pm / Albertech.net

Mod deflate in Apache 2 is a great way to save on server bandwidth since it can compress files (js/xml/html/css) before it is sent to the client. Most web browsers support gzip compression (90%+) so this is a great way to reduce the amount of traffic sent by the server. It also helps with the Google Page Speed result.

To setup Apache2 with mod deflate in Debian, enable mod deflate:
a2enmod deflate

This should place 2 files inside /etc/apache2/mods-enabled — deflate.conf and deflate.load.

Edit deflate.conf and copy the following configuration. This configuration is for compressing html, js, css, xml, and text files. It also ignores compression for browsers without support for gzip compression.

AddOutputFilterByType DEFLATE text/html text/plain text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/plain text/xml text/x-js text/css
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

After completing the changes, restart the Apache2 service
/etc/init.d/apache2 restart

http://httpd.apache.org/docs/2.0/mod/mod_deflate.html

Share this:

  • Facebook
  • Google +1
  • Twitter
  • Print
  • Email
Posted in: Apache / Tagged: apache2, mod deflate

Apache config for blocking proxy requests to random hostnames

June 3, 2011 12:59 pm / Albertech.net

If you have an Apache server with strange logfile entries such as:

GET http://proxyjudge1.proxyfire.net/fastenv HTTP/1.1" 404
GET http://images.google.com/ HTTP/1.1" 404

You need to reconfigure your Apache to deny any access to a host that is not specifically configured on your server. This can be done via changing your /etc/apache2/sites-enabled/[your default config]

Make sure to change the realhost.example.com to your host name, change the aliases (I add the IP address if there is only one IP for the domain), and change the document root path. This source of this script is from the Apache.org wiki.

NameVirtualHost *:80

<VirtualHost *:80>
ServerName default.only
<Location />
Order deny,allow
Deny from all
</Location>
</VirtualHost>

<VirtualHost *:80>
ServerName realhost1.example.com
ServerAlias [YOUR IP ADDRESS -- ONLY if each server has its own IP address]
DocumentRoot /path/to/site1
</VirtualHost>

One you are done with the change, make sure you run apache2ctl configtest
to ensure the configuration is correct. Restart the Apache2 service. Check the logfiles again to see if the proxy requests are gone.

This should be the default configuration that you should be using for Apache, unless you are using Apache as a proxy.

Notes:
If you only have one domain name per IP address, you should put in the IP address as an alias. This will allow the website to be accessible by IP, which is useful for server monitoring software.

Source: http://wiki.apache.org/httpd/ProxyAbuse

Share this:

  • Facebook
  • Google +1
  • Twitter
  • Print
  • Email
Posted in: Apache / Tagged: apache2 logs, proxy

Post Navigation

← Older Posts
 

Categories

  • AJAX
  • Android
  • Apache
  • Canon Cameras
  • Cloud
  • CMS
  • Computer Mods
  • Conferences
  • Deals
  • debian
  • Fedora
  • Flash
  • Frameworks
  • git
  • Hardware
  • HTML
  • IDE
  • iPhone
  • iPhone App Review
  • jQuery
  • Linux
  • Mac OS X
  • MySQL
  • nginx
  • PHP
  • portfolio
  • Puppet
  • Ruby on Rails
  • Script Reviews
  • SELINUX
  • Software
  • Software Review
  • SQL Server
  • statistics
  • Tech
  • Tomcat
  • Uncategorized
  • VMWARE
  • VPS
  • Windows
  • wordpress
  • Zend Framework

Blogroll

  • DragonAl Flickr
  • Dropbox – Free 2GB Account
  • James' Blog
  • Javascript Compressor
  • PHP Builder Community
  • PHP-Princess.net
  • Rubular – Regular Expression Validator
  • The Scale-Out Blog
  • Tiny MCE

Tags

activation AJAX android antec Apache AWS awstats canon coda codeigniter debian enclosure external free G1 install vmware tools Internet Explorer iphone 5 jquery Linux mx-1 MySQL office 2007 OSX photoshop PHP plugin plugins portfolio redesigned website review rewrite script security SELinux ssh tinymce tutorial upgrade VMWARE vmware server wordpress wordpress mu XSS zend framework
© Copyright 2013 Albertech.net
Infinity Theme by DesignCoral / WordPress
loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.