Diskuse:155PIN2 Projekt - Informatika 2: Porovnání verzí
Řádek 3: | Řádek 3: | ||
=== Založení instance === | === Založení instance === | ||
trac-admin /opt/trac/ | trac-admin /opt/trac/pin2 initenv | ||
chgrp www-data /opt/trac/ | chgrp www-data /opt/trac/pin2 -R | ||
chmod g+w /opt/trac/ | chmod g+w /opt/trac/pin2 -R | ||
* http://trac.edgewall.org/wiki/TracInstall#CreatingaProjectEnvironment | * http://trac.edgewall.org/wiki/TracInstall#CreatingaProjectEnvironment | ||
Řádek 12: | Řádek 12: | ||
<pre> | <pre> | ||
<Location /trac/ | <Location /trac/pin2> | ||
SetHandler mod_python | SetHandler mod_python | ||
PythonInterpreter main_interpreter | PythonInterpreter main_interpreter | ||
PythonHandler trac.web.modpython_frontend | PythonHandler trac.web.modpython_frontend | ||
PythonOption TracEnv /opt/trac/ | PythonOption TracEnv /opt/trac/pin2 | ||
PythonOption TracUriRoot /trac/ | PythonOption TracUriRoot /trac/pin2 | ||
</Location> | </Location> | ||
<Location /trac/qgama/login> | <Location /trac/qgama/login> | ||
Řádek 23: | Řádek 23: | ||
PythonInterpreter main_interpreter | PythonInterpreter main_interpreter | ||
PythonHandler trac.web.modpython_frontend | PythonHandler trac.web.modpython_frontend | ||
PythonOption TracEnv /opt/trac/ | PythonOption TracEnv /opt/trac/pin2 | ||
PythonOption TracUriRoot /trac/ | PythonOption TracUriRoot /trac/pin2 | ||
AuthType Basic | AuthType Basic | ||
AuthName "QGama Trac" | AuthName "QGama Trac" | ||
AuthUserFile /opt/trac/ | AuthUserFile /opt/trac/pin2/.htpasswd | ||
Require valid-user | Require valid-user | ||
</Location> | </Location> |
Verze z 18. 9. 2011, 10:27
Trac
Založení instance
trac-admin /opt/trac/pin2 initenv chgrp www-data /opt/trac/pin2 -R chmod g+w /opt/trac/pin2 -R
cat /etc/apache2/sites-enabled/003-trac
<Location /trac/pin2> SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnv /opt/trac/pin2 PythonOption TracUriRoot /trac/pin2 </Location> <Location /trac/qgama/login> SetHandler mod_python PythonInterpreter main_interpreter PythonHandler trac.web.modpython_frontend PythonOption TracEnv /opt/trac/pin2 PythonOption TracUriRoot /trac/pin2 AuthType Basic AuthName "QGama Trac" AuthUserFile /opt/trac/pin2/.htpasswd Require valid-user </Location>
/etc/init.d/apache2 restart
Přidání uživatele
htpasswd /opt/trac/pin2/.htpasswd user
trac-admin /opt/trac/pin2 permission add user student
Pro admina:
trac-admin /opt/trac/pin2 permission add admin TRAC_ADMIN
Git
Soubor conf/gitolite.conf:
repo pin2/2011 RW+ = @landa
PostGIS
createuser -D -R -S -P <user>
CREATE SCHEMA <user>; ALTER SCHEMA b11 OWNER TO <user>; GRANT ALL ON geometry_columns TO <user>; GRANT SELECT ON spatial_ref_sys TO <user>;
#!/bin/sh
if [ -z $1 ] ; then
echo "usage: $0 <user>"
exit 1
fi
USER="$1"
SCHEMA=`echo $USER | cut -d'_' -f2`
DB=pgis_pin2
createuser -D -R -S -P $1
psql $DB -c "CREATE SCHEMA $SCHEMA;"
psql $DB -c "ALTER SCHEMA $SCHEMA OWNER TO $USER;"
psql $DB -c "GRANT ALL ON geometry_columns TO $USER;"
psql $DB -c "GRANT SELECT ON spatial_ref_sys TO $USER;"
exit 0