Home » Archive

Articles in the Apache Category

Apache »

[3 Nov 2011 | One Comment | 1,386 views]

Here’s a quick modification to the awstats file 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.

Apache »

[8 Jun 2011 | No Comment | 706 views]

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.

View the full post for the configuration instructions.

Apache »

[3 Jun 2011 | No Comment | 962 views]

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]

Apache, PHP »

[31 May 2011 | One Comment | 4,094 views]

I ran across this error today after noticing a file_get_contents was not working. This was on a page that had been working fine for about a year.
“php_network_getaddresses: getaddrinfo failed: Name or service not known”

This issue is typically caused by the Apache/PHP host unable to contact the DNS server.

The first thing to check is to see if you can ping the remote host using console.

  • If no, then your primary name server on /etc/resolv.conf (Debian) is not working. Find a working DNS and restart Apache.
  • If yes, then Apache is still connecting to the broken DNS server. You should try restarting Apache …

Apache »

[21 Sep 2010 | No Comment | 1,270 views]

If you get this warning message when you start up Apache (apache2), this means that you are missing the ServerName setting inside apache2.conf. By default, the install of Apache in Debian is doesn’t include that setting in apache2.conf. The main reason is because they don’t know what your server name will be.

To fix:
Open up /etc/apache2/apache2.conf

Add the following line:
ServerName MyServer.com

Replace “MyServer” with your server name. Restart Apache.

Note:
Its only looking for the setting inside apache2.conf.  It ignores the “ServerName” within a Virtual Host configuration block (such as in /etc/apache2/sites-enabled/000-default)

Apache, Linux »

[29 Sep 2009 | One Comment | 3,993 views]

I recently installed Mailman with Exim4, which was a challenge considering all the manual configuration you have to do. I found a few guides on the install, but they didn’t seem to be “complete” enough to get the system working. Turns out, the biggest challenge was Exim4. The configuration files are confusing, especially since there are two sets of configuration files.

Apache, Linux »

[3 Sep 2009 | 2 Comments | 7,242 views]

One thing I’ve encountered with Awstats is adding in old apache log files. This is useful if you are migrating data from servers. By default, Awstats will ignore ALL past dates in the log that occur before the most recent log entry date. In order to avoid Awstats from finding the “recent log entry date”, you will need move all Awstats cached files into a separate folder.

Apache, Frameworks »

[11 Aug 2009 | No Comment | 1,034 views]

Here’s a quick tip to make cleaner looking URLs in CodeIgniter PHP framework. By default, if you have an application, the path of the application usually ends after index.php. Using Apache RewriteEngine, you can make cleaner looking URLs. You can have something similar to mysite.com/cigniter/MyApplication instead of mysite.com/cigniter/index.php/MyApplication

Apache, Linux, PHP »

[2 Jul 2009 | No Comment | 5,146 views]

I recently implemented a way to limit access by IP range on specific blogs on WordPress MU. As you know, WordPress MU uses Apache Rewrite engine to rewrite URLs. For instance, you have a blog on WordPress MU called “intranet”. Apache Rewrite takes the “intranet” string in the URL and automatically rewrites it as a value in the PHP script. A side effect to Apache Rewrite is that “Directory” .htaccess parameters don’t work. So, if you wanted only your company IPs to access an internal blog, you will need to use Apache Rewrite parameters instead. For the solution, read on…

Apache »

[5 May 2009 | 2 Comments | 1,084 views]

Sitemaps are useful if you want search engines to look in specific directories of your website. The standard robots.txt notation only has the exclusion list; where not to look and the search frequency.

For instance, a really basic robots.txt file looks like this:

User-agent: *
Crawl-delay: 3
Disallow:/cgi-bin/

For me, I set the Crawl-delay to 3 as a general rule to prevent crawlers from consuming all the web server bandwidth. Generally, Yahoo crawlers are the most aggressive on your site, Google averages about ~13 seconds per request. Anyway, a sitemap gives the crawler a better idea of where to search, rather than trying to discover …