"Fossies" - the Fresh Open Source Software Archive
As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard
) with prefixed line numbers.
Alternatively you can here view
the uninterpreted source code file.
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.
8 # Prerequisites
11 PHP 5 (maybe 4, but not tested; make sure you get apache module too)
13 vsftpd (or another ftp service running on apache server)
18 # Create the HTTP upload directory.
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.
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.
31 These commands can be run as either the Apache user or root.
33 mkdir -p /var/www/uploads/tmp
34 chown -R apache.apache /var/www/uploads
35 chmod -R 2770 /var/www/uploads
40 # Create DB Schema
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.
46 [ from within mysql shell ]
47 create database eventhorizon;
48 grant all priviliges on eventhorizon.* to [evhdbuser]@localhost identified by '[password]';
49 flush priviliges;
52 mysql < eventhorizon.sql
54 Then, set the appropriate username and password in inc.php.local!
59 # Setup Cron
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).
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
74 # Set Admin password
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.
81 htpasswd -b -c /etc/htpasswd.evh admin
86 # Make PHP changes
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
100 # Configure Apache
102 Depending on how you want it setup, edit the Apache configs appropriately. By
103 default it expects to be a VirtualHost.
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.
110 DefaultType application/octet-stream
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).
117 chown apache:apache [EVH file location]
122 # Configure FTP access (if desired)
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)
144 # Localise application text
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).
153 # Go through inc.php.local and make any final changes
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.
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).
164 WARNING: Make sure the ehcleanup-crondaily.sh script contains the proper path for the ehcleanup.php file.