
#1 follow instructions in /var/www/groovix/common/install.txt

#1.5 apt-get install php-mysql python-mysqldb

#2. run ./install.bash
 you will need to enter:
 - the hostname or ip address of the mysql server you wish to use, usually "localhost"
 - the mysql root password for that server
 - your custom version identifier, must match the value in the pactime.conf file on each client
 - your custom password,  must match the value in the pactime.conf file on each client
 - custom database prefix and custom database user prefix.  The "user prefix" and the "custom version identifier" combined can't be more than 16 characters.  The "user prefix" and "db prefix
" can be set to prevent multiple installations from conflicting on a single mysql server.  Normally hitting enter for the default value is fine.
 - custom database password prefix. The "password prefix" should be set to a secret value, this is essentially a password that prevents unauthorized direct database access if the pactime.conf file from the clients is compromised.


#3. populate password file
mkdir -p /etc/groovix
htpasswd -c /etc/groovix/web-admin.pw admin
htpasswd  /etc/groovix/web-admin.pw staff

#4. password protection for some functionality
#add a section like this to /etc/apache2/sites-available/default
     <Directory /var/www/groovix/pactime/>
        <FilesMatch "add_guest_users.py|session_time.py|broadcast_message.py|change_settings_global.py|change_settings.py|reboot.py|end_session.py|send_message.py|gxconnect.py">
          AuthName "PacTime Admin" 
            AuthType Basic
              AuthUserFile /etc/groovix/web-admin.pw
                require valid-user
                </FilesMatch>
        </Directory>

     <Directory /var/www/groovix/cmon/admin>
          AuthName "Cmon Admin"
            AuthType Basic
              AuthUserFile /etc/groovix/web-admin.pw
                require valid-user
        </Directory>



#4 Restart Apache afterwards:
/etc/init.d/apache2 restart

to set default quotas: ( example for 180 minutes per day no other restrictions )
update pac_settings set quota_m=-1 where id='global';
update pac_settings set quota_w=-1 where id='global';
update pac_settings set quota_d=180 where id='global';
update pac_settings set quota_s=-1 where id='global';




EXAMPLE: to add special user quotas:
mysql> insert into pac_settings (type,id,quota_d) values (50,"staff",180);
mysql> nsert into pac_settings (type,id,quota_s,threshold_y,threshold_o) values (30,"vkiosk",30,5,5);
