Posts tagged apache
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
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 >
code_swarm – Apache, Python and PostgreSQL commit visualization
0nginx, proxy_cache and reverse proxying explained & benchmarked
3Where to begin? nginx would be a good start I suppose. It's far easier and makes much for sense for you to actually read about nginx from it's own website - http://nginx.org/en/ - but just to give a simple explanation too; `nginx is king of static content HTTP servers.`
Anyone that has dealt with Apache on medium to high traffic websites will know that Apache is bit of a `wheezy, old geezer` when it comes to content serving using it's mpm-worker (threaded). Very often high traffic will cause server load to go through the roof but for serving dynamic content, there really is no More >
Using nginx, Varnish and Apache
7So lets get to the problem first. I have several lightly to medium loaded sites running on some virtual servers, they servers themselves are highly configured to run beautifully on our host environments, very, very RAM intensive but low disk I/O and low CPU usage.
As mentioned, the sites are relatively low loaded, they'll generally hang around at between 3,000-5,000 unique hits a day and are run through Apache using PHP, various PHP modules and MySQL, a simple generic LAMP environment, yet customised to suit it's surroundings and host.
The sites themselves run fine on that setup, More >

