Squid proxy in Ubuntu with password authentication

  1. Install squid3
    sudo apt-get install squid3
    
  2. /etc/squid3/squid.conf
    auth_param digest program /usr/lib/squid3/digest_pw_auth -c /etc/squid3/passwords
    auth_param digest realm proxy
    acl authenticated proxy_auth REQUIRED
    http_access allow authenticated
    http_port 3128
    
  3. Setting up a user
    htdigest -c /etc/squid3/passwords proxy user
    
  4. Restart/reload squid
    service squid3 restart
    

P.S.

OSQA install experience

OSQA is an opensource Q/A engine. In this article I’ll describe the way I installed it on my VPS.

I like Debian/Ubuntu OS. Debian lacks new packages, that’s why I chose Ubuntu 12.04 LTS.

Act 1. Lighttpd

I had Lighttpd installed on my machine, so firstly I tried to install OSQA on Lighttpd. Googling around I found that running OSQA in fcgi mode is not OK (when you have a VPS). WSGI is the right way. Unfortunately, Lighttpd’s WSGI is very unstable, experimental and unsupported. That’s why I decided to move to nginx.

Act 2. nginx

Django projects are great with pure WSGI servers. So I decided to install nginx with WSGI server (uWSGI, GUnicorn, etc.). Spending 3 days, writing LOTS of site blocks, tuning nginx, messing around with various WSGI servers, I finally switched to Apache.

Act 3. Apache

My Apache/Ubuntu way was as described in article on meta.osqa.com. After doing the steps I received 500 errors as well as this:

Middleware module "django.middleware.csrf" does not 
define a "CsrfResponseMiddleware" class

OSQA is not compatible with Django 1.4.0, but works OK in 1.3.1. Check your version:

python
>>> import django
>>> django.VERSION

If necessary install 1.3.1:

sudo easy_install django==1.3.1

P.S.

In my spare time I’ll continue playing with nginx + uWSGI (or gunicorn), I think it’s the best way of running OSQA.