A hint: This file contains one or more very long lines, so maybe it is better readable using the pure text view mode that shows the contents as wrapped lines within the browser window.
1 Event Horizon (EVH) is pretty simple to get up and running. All you need 2 to know is below. The PHP config file is called inc.php.local. Any 3 usernames/passwords/paths you change from below MUST be reflected in 4 this file or EVH will fail to run properly. Just copy inc.php to 5 inc.php.local and make your changes there. 6 7 # 8 # Prerequisites 9 # 10 MySQL 11 PHP 5 (maybe 4, but not tested; make sure you get apache module too) 12 Apache 13 vsftpd (or another ftp service running on apache server) 14 15 16 17 # 18 # Create the HTTP upload directory. 19 # 20 It is highly recommend that this location be outside the DocumentRoot for 21 any and all Apache Virtual Hosts. This is mainly for security reasons, and 22 it keeps prying scripts from downloading files without permission. The 'tmp' 23 directory is where we'll configure PHP to put the file uploads before 24 they're processed. The 'uploads' directory will be the main repository of 25 the uploaded files. 26 27 The default locations are below. Be sure to change the upload directory 28 to wherever you want it to be. Also, the apache user and group may be 29 different depending on your distribution. 30 31 These commands can be run as either the Apache user or root. 32 33 mkdir -p /var/www/uploads/tmp 34 chown -R apache.apache /var/www/uploads 35 chmod -R 2770 /var/www/uploads 36 37 38 39 # 40 # Create DB Schema 41 # 42 Currently, EVH only supports MySQL. Not for any particular reason, but just 43 because that is what we had at hand. The .sql file is a schema export of 44 the MySQL structure. This will have to be done as root. 45 46 [ from within mysql shell ] 47 create database eventhorizon; 48 grant all priviliges on eventhorizon.* to [evhdbuser]@localhost identified by '[password]'; 49 flush priviliges; 50 exit; 51 52 mysql < eventhorizon.sql 53 54 Then, set the appropriate username and password in inc.php.local! 55 56 57 58 # 59 # Setup Cron 60 # 61 The deletion of files upon expiration is done via a Cron script which runs 62 daily. The SQL database currently only holds the date a file was uploaded, 63 and not the time, so an hourly cron job just doesn't make sense. This will 64 have to be done as root (I guess these could be under the Apache user's 65 cron eventually). 66 67 cp ehcleanup-crondaily.sh /etc/cron.daily/ehcleanup.sh 68 chown root.root /etc/cron.daily/ehcleanup.sh 69 chmod 700 /etc/cron.daily/ehcleanup.sh 70 71 72 73 # 74 # Set Admin password 75 # 76 The administration interface can be found at: http://[server]/[path]/tnadmin. 77 The command below will create a new htpasswd file (and overwrite an 78 existing one) and set the admin password. This command will need to be 79 run as root. 80 81 htpasswd -b -c /etc/htpasswd.evh admin 82 83 84 85 # 86 # Make PHP changes 87 # 88 By default, the php.ini file needs some modifications. The changes needed 89 are below. 90 - enable register_globals 91 - set max upload size, max post size, max memory limits all to 2GB 92 - PHP MAXIMUM IS 2147483647 93 - set tmp_dir to the location above (/var/www/uploads/tmp) 94 - set location of the php error log so you can monitor any 95 uploads/downloads/errors 96 97 98 99 # 100 # Configure Apache 101 # 102 Depending on how you want it setup, edit the Apache configs appropriately. By 103 default it expects to be a VirtualHost. 104 105 To facilitate downloads of the files, make sure that the following option 106 is set either globally or in the VirtualHost definition. If this isn't set, 107 some browsers may show the contents of the file instead of forcing a 108 download like it should. 109 110 DefaultType application/octet-stream 111 112 Also, depending on how you configure Apache, place all files from the EVH 113 tar bundle into the path of Apache (such as in the DocumentRoot or a 114 sub-directory thereof). Make sure apache owns the location of the EVH php 115 files (so it can create/remove symlinks for file downloads). 116 117 chown apache:apache [EVH file location] 118 119 120 121 # 122 # Configure FTP access (if desired) 123 # 124 As far as I can tell, all browsers have about a 2GB restriction on submitted 125 form data. This limits us to 2GB uploads when using HTTP. To allow for 126 larger uploads, EVH supports files uploaded via FTP. In order for this to 127 work, the following things need to be done. 128 - Install some sort of FTP service (vsftpd is a good example) 129 - setup a new system account called evhftp 130 - edit /etc/passwd and set the default shell for the evhftp user to 131 something like /sbin/nologin (make sure the shell you 132 specify is in /etc/shells) 133 - set the default group for evhftp to Apache's 134 - chown apache:nobody [evhftp user home dir] (allows for Apache to 135 move files into upload dir) 136 - chmod 2733 [evhftp user home dir] 137 - set $enableFTP = 1 in inc.php.local 138 - cp evhftp-vsftpd.conf /etc/vsftpd/user_conf/[evhftp username] (not necessary, 139 but it increases security; also edit for accuracy of homedir) 140 141 142 143 # 144 # Localise application text 145 # 146 All text within the application is contained in the lang/ folder. The idea 147 was to have a file for each language supported and then just specified 148 somehow. Currently, there is only English (lang/en.inc). Customize any 149 application text here (like page footer). 150 151 152 # 153 # Go through inc.php.local and make any final changes 154 # 155 Go through inc.php.local and make sure all of the variables are set in accordance 156 with the above steps. Also, make sure to change the $domains value to 157 actual valid domains. This variable is the regex which determines if 158 supplied source/destination addresses are acceptible. Only one address 159 must match this value. 160 161 162 WARNING: The find_ftp_file function in functions.php has a $fsize line which may need some tweaking. Apparently, some distros have different orders of the 'ls -l' output. You'll want to verify that the command it uses actually gets the bytes of the file uploaded, or you'll get some upload errors (mysql insert will fail). 163 164 WARNING: Make sure the ehcleanup-crondaily.sh script contains the proper path for the ehcleanup.php file.