To get a new project at /var/www/trac the steps would be:
trac-admin /var/www/trac initenv
htpasswd -c /var/www/trac/.htpasswd admin
trac-admin /var/www/trac permission add admin TRAC_ADMIN
chown -R www-data:www-data /var/www/trac
chmod -R 640 /var/www/trac
chmod +X /var/www/trac
This would init a project with an admin user. And here my Apache config for it:
<Location /trac>
SetHandler mod_python
PythonInterpreter main_interpreter
PythonHandler trac.web.modpython_frontend
PythonOption TracEnv /var/www/trac
PythonOption TracEnvParentDir /var/www/trac
PythonOption TracUriRoot /trac
PythonOption TracEnv /var/www/trac
# PythonOption TracEnvIndexTemplate /var/www/trac/templates/index-template.html
PythonOption TracLocale en_US.UTF8
PythonOption PYTHON_EGG_CACHE /tmp
Order allow,deny
Allow from all
</Location>
<Location /trac/login>
AuthType Basic
AuthName "myproject"
AuthUserFile /var/www/trac/.htpasswd
Require valid-user
</Location>
This config needs mod-python:
apt-get install libapache2-mod-python
a2enmod python
service apache2 restart