apache
General posts that involve Apache 2, these will include howtos, configuration information and experiments
Host git repositories with git, gitosis and gitweb on Debian 6/Ubuntu 10.04
5First up we'll need to install git and some Python tools to get Gitosis installed.
Where # is used it means you need to either run the command as a superuser with sudo or as root.
# apt-get install -y git-core gitweb python-setuptools
Next we have to clone gitosis from it's git repository and install it.
Adding your git usercd /tmp
git clone git://eagain.net/gitosis.git
cd gitosis
# python setup.py install
# adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git
The above command creates a new system user with /bin/sh as More >
nginx config for reverse proxying WordPress & WP Super Cache and keeping the load off Apache2
0The whole point of this is to get as much load off of Apache as possible to keep the server running nice and smoothly.
ConfigurationThe configuration below will mean that nginx will serve basically everything;
- static files
- uploaded files and
- cached content
server {
listen 80; server_name DOMAIN_HERE;access_log /var/log/nginx/access.DOMAIN_HERE.log;gzip on; gzip_disable msie6; # disable gzip for IE6 gzip_static More >
nginx log real IP from Pound
2Recently I started using Pound as a load balancer to a cluster of nginx servers and found my access logs were filled with the IP address of the load balancer. I did some digging and found the correct way to "fix" this.
First thing you need to do is make sure you remove X-Forwarded-For from Pound
ListenHTTP
... snip ...
... snip ...
HeadRemove "X-Forwarded-For"
End
Once this is done, reload Pound.
Next you need nginx compiled with realip module - http://wiki.nginx.org/NginxHttpRealIpModule
On Ubuntu/Debian servers this module comes by default, otherwise you may have to compile it in yourself More >
WordPress + nginx + Varnish + Apache 2
22Lately I've been doing a lot of work with Varnish, this includes testing it within a load balanced environment, putting it behind nginx, putting it in front of Solr, the list goes on.
This blog post will hopefully give you an insight in to a simple way of combining nginx, Varnish and Apache to create a powerful WordPress environment that can really take a hammering.
I'm going to assume you already have Apache and nginx working together, if not I suggest you read my other articles on these subjects to learn how to combine them.
Installing VarnishConfiguring More >sudo apt-get install varnish
Coming soon… Solr research
0Recently I decided that it would be a good idea for the company I work for to start looking in to Apache Solr for use with some of our bigger clients, I will report any fun I find it with back here including installation on Debian/Ubuntu and most likely complain about Jetty and Tomcat because I hate both and am really not looking forward to working with them again, even though I am excited about Solr itself.
Watch this space.
New syslog.tv nginx wordpress site configuration explained
5I made some modifications to my nginx configuration this weekend to improve performance and clear up some bugs.
upstream backend { server 127.0.0.1:81 fail_timeout=120s; }
server { listen 80; server_name syslog.tv;
access_log /var/log/nginx/access.syslog.tv.log;
gzip on; gzip_disable msie6; gzip_static on; gzip_comp_level 9; gzip_proxied any; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
location / { root /var/www/syslog.tv;
set $wordpress_logged_in ""; set $comment_author_email ""; set More >
Apache internal dummy connection
1Recently I found that one of the servers I look after that runs a high profile site was generating semi-high load at traffic peaks. You could generally say that this would be understandable but the server was shooting up to a load of around 10 for a few seconds and with that load jump I was able to graph an increase of Apache processes on top of it. Again though, this would generally be considered normal, but knowing how well the server performs and having nginx sitting on top handling all static content I knew something wasn't quite right.
Looking through the logs I found quite a lot of More >
Show IP in Apache logs from nginx reverse proxy
3This is a very quick blog to show you how to show a users IP address in your Apache access logs when the site in question is being reverse proxied to Apache through nginx.
You need the rpaf module for Apache, on Debian and Ubuntu this is simple to install
apt-get update && apt-get install libapache2-mod-rpaf && a2enmod rpaf && apache2ctl graceful
This set of commands will do the following;
- Update apt package list
- Install libapache2-mod-rpaf
- Enable mod-rpaf
- Gracefully restart Apache (doesn't kill connections)
Once installed you simple need to be sure to pass the correct headers through, so More >
Convert DER certificate to PEM
2Some times as an administrator you will be given a certificate from a third party that will be in the DER format, which cannot be loaded in to Apache.
Converting it is a simple process:
openssl x509 -in certificate.crt -inform DER -out certificate.pem -outform PEM
More nginx proxy_cache optimizations and nginx load balancing
4This is yet another follow up to post to several previous posts about using nginx as a reverse proxy with caching. It is actually a direct addition to my post from a week or so ago which outlined how to actually using nginx's proxy caching feature which can be read here -- http://syslog.tv/2010/02/07/nginx-proxy_cache-and-explained-benchmarked/.
Even more changes?Yes, even more changes, these are basic changes that are there to improve the caching capabilities and also implement load balancing.
Cache changesThe first set of changes are in the main nginx configuration More >

