Cwfm V0.9.1 - Installation procedure

************************** Warning **********************************
If you have already installed a previous version of Cwfm, please stop
reading here and go to file 'Upgrade'.
*********************************************************************

1) Copy all source files found in php/ directory and subdirs to a dedicated 
   directory accessible for read and write by your web server, for example 
   /var/www/cwfm/.
   If you don't have 'root' telnet access to the server (this case is tipycal
   of ISP web hosting), it's highly advisable to create a sub-directory under 
   your area. Let's assume /home/user/htdocs to be your account root folder, 
   where 'user' is your account name. Now you can create 'cwfm' dir:

   $ cd /home/user/htdocs
   $ mkdir cwfm
   
   Following examples are built always with '/var/www/cwfm/' as install dir.
   You can substitute this with your custom directory '/home/user/htdocs/cwfm/'
   or others.

   Path information must be preserved excluding initial php/ directory. So,
   referring to our example, all files in php/ dir must be copied in
   /var/www/cwfm/, all files in php/lang  dir must be copied in
   /var/www/cwfm/lang/, all files in php/img/small dir must be copied in
   /var/www/cwfm/img/small/ and all files in php/img/large/ dir must be 
copied
   in /var/www/cwfm/img/large/
.
   

2) Configure httpd.conf to include alias of your choice
   for example 
  
   Alias /cwfm /var/www/cwfm/

   optionally you can restrict access to cwfm area with:

   <Directory /var/www/cwfm>
     AllowOverride None
     order deny,allow
     deny from all
     allow from <allowed-network>/<netmask>
   </Directory>

   The above lines allow access only from <allowed-network>/<netmask>


3) In php.ini configuration file the following parameters should look:

   register_globals = On
   short_open_tag = On
   file_uploads = On  			
   post_max_size  = <max-size>M
   upload_max_filesize = <max-size>M

   where <max-size> is the maximum upload file size (in megabytes) you want 
   to allow.

   safe_mode = Off
   ************************** Please note *********************************
   If you need to set safe_mode to On for shared services security reasons,
   bear in mind that Cwfm will be unable to access files that are owned by
   users different from that under which Apache runs (e.g. www-data).
   ************************************************************************


   *************************** Windows users *******************************
   Tmp path is required. See 'session.save_path' directive in your php.ini, 
   it should look like:

   session.save_path = /tmp 
   
   This means that a directory '/tmp' must be created in installation partition
   before Cwfm runs.
  
 *************************************************************************

4) Under Unix/Linux Reload Apache (normally with /etc/init.d/apache reload)


5) ************ Security/Permissions notes for Unix/Linux users *************
   Cwfm must have read/write access to the install dir. If you installed
   Cwfm in /var/www/cwfm then you must give Apache's user (e.g. www-data)
   read and write permissions to that directory.
 There are three cases:

   5.1) You have 'root' telnet access to the server. 

        This is the ideal situation, you should chown /var/www/cwfm tree to 
	Apache's user and chmod /var/www/cwfm to 0300. That's all, no further 
	manual work nedded. Example:

        # chown -R www-data: /var/www/cwfm
        # chmod 0300 /var/www/cwfm
  
        Now you can go to step 6)


   5.2) You don't have 'root' telnet access to the server. 

        This case is tipycal of ISP web hosting and implies some extra work. 
	At this point you already made a dedicated directory as suggested
	at point 1). Let's call this directory /home/user/htdocs/cwfm.
   
        ***** IN ALL COMMANDS BELOW YOU HAVE TO USE SUGGESTED 'u=rwx,o=?,g=' 
	ONLY IF GROUP OWNER OF YOUR ROOT DIRECTORY IS NOT APACHE'S GROUP.
	OTHERWISE 'g' and 'o' MUST BE SWAPPED: 'u=rwx,g=?,o=' *****

        You should chmod /home/user/htdocs/cwfm to 0703. This step is mandatory 
        to let Cwfm (e.g. Apache's user) to create 'data' and 'tmp' directory 
	once started. The security hole introduced by 'world rwx' permissions 
	will be fixed later. Example:

        $ chmod u=rwx,o=rwx,g= /home/user/htdocs/cwfm
   
        Cwfm (that in this case belongs to 'world' group) also needs to have 
	read access to source files:
   
        $ chmod u=rw,o=r,g= /home/user/htdocs/cwfm/img/large/*
        $ chmod u=rw,o=r,g= /home/user/htdocs/cwfm/img/small/*
        $ chmod u=rw,o=r,g= /home/user/htdocs/cwfm/lang/*
        $ chmod u=rw,o=r,g= /home/user/htdocs/cwfm/*
        $ chmod u=rwx,o=x,g= /home/user/htdocs/cwfm/lang
        $ chmod u=rwx,o=x,g= /home/user/htdocs/cwfm/img
        $ chmod u=rwx,o=x,g= /home/user/htdocs/cwfm/img/small
        $ chmod u=rwx,o=x,g= /home/user/htdocs/cwfm/img/large
   
   5.3) You don't have telnet access at all.
   
        Chmod can be always performed with an ftp client. An example of a free 
	and great ftp client for Windows that supports attributes change is
	www.smartftp.com
  ***************************************************************************
**
  

6) Now you can connect from your browser with <host>/cwfm, where <host> is
   the url or ip address of your server.
 Then you must enter 'system' and 
   'manager' as username and password. 
  
   ************************** Please note *******************************
   'system'/'manager' are useful only for first time configuration. Once 
   Cwfmini.php is created, 'system'/'manager' will no longer be acceppted.
   **********************************************************************

   Doing so Cwfm will show the 'Options' panel. Choose an admin username and 
   password, set other options and 'Confirm'. Zip Path is the complete path 
   to 'zip' program. If you want to use 'Zip$Download' feature you must have 
   'zip' installed and give Cwfm the right path to.Unzip Path is the complete 
   path to 'unzip' program. If you want to use 'Upload&Unzip' feature you must 
   have 'unzip' installed and give Cwfm the right path to.
   
   Zip and Unzip are free tools that normally come with your distribution.
   Windows user can find them at http://www.info-zip.org.

   ************ Security/Permissions notes for Unix/Linux users *************
   If your environment belongs to that of cases 5.2) or 5.3) (see above) this
   is the time to close 'world' write permission to /home/user/htdocs/cwfm:
   
   $ chmod u=rwx,o=x,g= /home/user/htdocs/cwfm
   **************************************************************************

  
7) Now you can start to create users. 'Login' and enter admin username and
   password. Go to 'Add User' and add one or more user to the system.


8) Finally you can logon as the users created.
