mysql schema for membersdb and apche config added
authorAlex McMahon <alex.mcmahon@cs.tcd.ie>
Wed, 20 May 2009 13:20:27 +0100
changeset 2 e8c21d72976d
parent 1 29ae580f12bd
child 6 c692d0081830
mysql schema for membersdb and apche config added
mysql_apache/apache-default-site
mysql_apache/mysql_members_schema
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mysql_apache/apache-default-site	Wed May 20 13:20:27 2009 +0100
@@ -0,0 +1,110 @@
+<VirtualHost *:80>
+	ServerAdmin webmaster@localhost
+        ServerName sphere.dsg.cs.tcd.ie
+
+
+	DocumentRoot /var/www/private/HTMLrequester
+<Directory "/var/www/private/HTMLrequester/members">
+Options Indexes MultiViews FollowSymLinks
+        AuthType Basic
+        AuthName "Member's Area"
+        AuthFormAuthoritative On
+
+        AuthFormMySQLHost localhost
+        AuthFormMySQLUsername www-data
+        AuthFormMySQLPassword www-data
+        AuthFormMySQLDB members
+
+        AuthFormMySQLTableSID sessions
+        AuthFormMySQLTableGID uid_gid
+        AuthFormMySQLTableTracking tracking
+
+        AuthFormMySQLFieldUID uid
+        AuthFormMySQLFieldGID gid
+        AuthFormMySQLFieldDownloadSize download_size
+        AuthFormMySQLFieldDownloadPath download_path
+        AuthFormMySQLFieldDownloadDate download_date
+        AuthFormMySQLFieldTimeout timeout_date
+        AuthFormMySQLFieldIPAddress client_ip_address
+        AuthFormMySQLFieldExpiration expiration_date
+
+        #AuthFormMySQLTableGIDCondition
+#       AuthFormMySQLTableSIDCondition "`sid`=$sid1 AND `sid_dir`=$sid2 AND (`uid`=$uid OR `signature`='members')"
+       AuthFormMySQLTableSIDCondition "`sid`=$sid1 AND `sid_dir`=$sid2 AND (`uid`=$uid OR `signature`='members')"
+#   AuthFormMySQLTableSIDCondition "`sid`=$sid1 AND `sid_dir`=$sid2"
+
+
+        #AuthFormMySQLTableTrackingCondition
+
+        AuthFormSessionTimeout 30
+        AuthFormSessionCookies On
+        AuthFormSessionAutoRefresh -1
+        AuthFormTrackingLifetime 30
+
+        AuthFormPageLogin index.php
+        AuthFormPageExpired /session_expired.html
+        AuthFormLastPageKey go_back_to
+        #AuthFormPageAutoRefresh
+        #AuthFormPageNotAllowed
+
+        #Require valid-user
+        Require group 0 1
+</Directory>
+
+<Directory "/var/www/private/public">
+	AuthFormPageNotAllowed /paying_members_only.html
+	AuthFormMySQLTableSIDCondition "`sid`=$sid1 AND `sid_dir`=$sid2 AND (`uid`=$uid OR `signature`='some_signature_public')"
+	Require group 1 
+</Directory>
+<Directory "/var/www/private/private">
+	AuthFormPageNotAllowed /premium_only.html
+	Require group 2 
+</Directory>
+<Directory <"/var/www/private/admin">
+	AuthType Basic
+	AuthName "Administration"
+	AuthUserFile /var/www/private/passwords
+	
+	# Turn off 'mod_auth_form' in this directory,
+	# giving control to 'mod_auth'.
+	AuthFormAuthoritative Off
+	
+	Allow from 127.0.0.1  # localhost
+	Deny from all
+	Order Deny,Allow
+	Require valid-user
+</Directory>
+
+	ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
+	<Directory "/usr/lib/cgi-bin">
+		AllowOverride None
+		Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
+		Order allow,deny
+		Allow from all
+	</Directory>
+
+	ErrorLog /var/log/apache2/error.log
+
+	# Possible values include: debug, info, notice, warn, error, crit,
+	# alert, emerg.
+	LogLevel debug
+
+	CustomLog /var/log/apache2/access.log combined
+
+    Alias /doc/ "/usr/share/doc/"
+    <Directory "/usr/share/doc/">
+        Options Indexes MultiViews FollowSymLinks
+        AllowOverride None
+        Order deny,allow
+        Deny from all
+        Allow from 127.0.0.0/255.0.0.0 ::1/128
+    </Directory>
+# <Directory "/var/www/HTMLrequester/">
+#        Options Indexes MultiViews FollowSymLinks
+#        AllowOverride None
+#        Order deny,allow
+#        Deny from all
+#        Allow from 127.0.0.0/255.0.0.0 ::1/128
+#    </Directory>
+
+</VirtualHost>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mysql_apache/mysql_members_schema	Wed May 20 13:20:27 2009 +0100
@@ -0,0 +1,63 @@
+CREATE TABLE  `members`.`creds` (
+  `uid` int(8) unsigned NOT NULL auto_increment,
+  `username` varchar(20) NOT NULL default 'anon',
+  `password_md5` varchar(32) NOT NULL default '5f4dcc3b5aa765d61d8327deb882cf99' COMMENT 'default password = password',
+  PRIMARY KEY  (`uid`),
+  KEY `new_index` (`uid`)
+) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
+
+CREATE TABLE  `members`.`groups` (
+  `gid` int(8) unsigned NOT NULL,
+  `groupname` varchar(20) character set utf8 NOT NULL,
+  PRIMARY KEY  (`gid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+
+CREATE TABLE  `members`.`groups` (
+  `gid` int(8) unsigned NOT NULL,
+  `groupname` varchar(20) character set utf8 NOT NULL,
+  PRIMARY KEY  (`gid`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8
+
+CREATE TABLE  `members`.`requests_tbl` (
+  `req_ID` int(8) unsigned NOT NULL auto_increment,
+  `uid` int(8) unsigned NOT NULL,
+  `req_val` varchar(1024) collate utf8_unicode_ci NOT NULL,
+  `req_response` tinyint(1) NOT NULL,
+  `req_created` date NOT NULL,
+  PRIMARY KEY  (`req_ID`),
+  KEY `new_index` (`uid`),
+  CONSTRAINT `new_fk_constraint10` FOREIGN KEY (`uid`) REFERENCES `creds` (`uid`) ON UPDATE CASCADE
+) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='InnoDB free: 3072 kB; (`user_ID`) REFER `members/creds`(`uid`)'
+
+CREATE TABLE  `members`.`sessions` (
+  `sid` varchar(32) NOT NULL,
+  `sid_dir` varchar(32) NOT NULL,
+  `uid` int(8) unsigned NOT NULL,
+  `signature` varchar(20) NOT NULL,
+  `timeout_date` datetime NOT NULL,
+  `expiration_date` datetime NOT NULL,
+  `req_ID` int(8) unsigned NOT NULL,
+  PRIMARY KEY  (`sid`),
+  KEY `new_fk_constraint` (`uid`),
+  CONSTRAINT `new_fk_constraint` FOREIGN KEY (`uid`) REFERENCES `creds` (`uid`) ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC
+
+CREATE TABLE  `members`.`tracking` (
+  `uid` int(8) unsigned NOT NULL,
+  `client_ip_address` varchar(15) NOT NULL,
+  `download_date` datetime NOT NULL,
+  `download_path` varchar(255) NOT NULL,
+  `download_size` int(8) unsigned NOT NULL,
+  KEY `new_fk_constraint3` (`uid`),
+  CONSTRAINT `new_fk_constraint12` FOREIGN KEY (`uid`) REFERENCES `creds` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED
+
+CREATE TABLE  `members`.`uid_gid` (
+  `uid` int(8) unsigned NOT NULL,
+  `gid` int(8) unsigned NOT NULL,
+  PRIMARY KEY  (`uid`),
+  KEY `new_index` USING BTREE (`uid`),
+  KEY `new_fk_constraint9` USING BTREE (`gid`),
+  CONSTRAINT `new_fk_constraint2` FOREIGN KEY (`uid`) REFERENCES `creds` (`uid`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='InnoDB free: 4096 kB; (`uid`) REFER `members/creds`(`uid`)'
+