Friday, July 8, 2011

Phpscheduleit installation procedure

A web-based resource scheduling system that allows administered management of reservations on any number of resources. Typical applications are conference room or machine reservation management. Written in PHP and tested on MySQL.


REQUIREMENTS

  •   Working Mysql Server
  •   Working Apache server
  •   PHP 4.3 or higher
  •   PEAR::DB

1) INITIAL SETUP:

Download the latest phpscheduleit software form http://www.php.brickhost.com/
Transfer the phpScheduleIt 1.2.12.zip file to your Apache server using winscp or some other file transfer method
extract phpScheduleIt 1.2.12.zip on web root
#mkdir /var/www/html/phpscheduleit
#cp phpScheduleIt_1.2.12.zip /var/www/html/phpscheduleit/
#cd /var/www/html/phpscheduleit/
#unzip phpScheduleIt_1.2.12.zip

Change the web directory ownership if required
#chown -R apache.apache *
Rename config/config.new.php to config/config.php and edit the file to be sure it is correct for your web server set up
#cp config/config.new.php config/config.php
2) APACHE CONFIGURATION:
Edit apache httpd.conf and add the following alias
#vim /etc/httpd/conf/httpd.conf
Alias /phpscheduleit "/var/www/html/phpscheduleit"
#service httpd restart

3) CREATE DATABASE :
Create a Database. On the mysql server
#mysql -u root -p ( enter the mysql root password)
mysql> create database phpscheduleit;
mysql> grant all privileges on phpscheduleit.* to schedule_user@localhost identified by 'mypassword';  / if apache server is different, eplace localhost with your apache server ip     
mysql> FLUSH PRIVILEGES;
mysql>show databases;
mysql> exit 


4) EDIT CONFIG FILE: 

Edit the config.php file and modify the required changes.Most importantly, make sure that the 'weburi', 'dbType', 'dbUser', 'dbPass' and 'dbName' settings are correct

If the database not running localy, replace localhost with yourmysql serverip
$conf['db']['hostSpec'] = 'localhost';
Also you have to mention your database name ,username, password which you have created above ( Otherwise defailt values will be taken and DB Error will occure: insufficient permissions)
$conf['db']['dbUser'] = 'schedule_user';
$conf['db']['dbPass'] = 'mypassword';
$conf['db']['dbName'] = 'phpscheduleit';


Verify that the PEAR DB package, a PEAR supported database and PHP version 4.2.0 or greater are installed and properly configured on the destination server. If not, download and install at least these versions

5.A)AUTOMATIC INSTALLATION

1) Simply run the install script by navigating your browser tohttp://yourwebsite.com/phpscheduleit/install/. You will be asked for your database password. Note that you do not need to log in as root, but the user needs to have permission to create and drop databases.
2) You will receive a confirmation or rejection notice about each command being executed. If everything goes well, you will receive a final notice that the installation was successful.
 












5.B) MANUAL SETUP: 
The initial database must be set up. There is an included setup file for this. To execute the setup file in mysql, navigate to the MySQL executable directory (usually /usr/local/mysql/bin) and at the shell prompt type the following:
mysql -u root -p < %path to directory%/install/setup.sql
#mysql -u root -p < /var/www/html/phpscheduleit/install/setup.sql



6) DELETE THE 'INSTALL' DIRECTORY. 
This is a critical step. If the directory is left, then anyone is open to destroy your newly created database.
Now you can start using the application. 

http://yourwebsite.com/phpscheduleit

































How to Integrate Ldap authentication on Phpscheduleit



We can enable the LDAP authentication on phpscheduleit by manually editing the config file.
Edit the config.php file located in phpScheduleIt/config and make the follwoing changes.

#vim config.php
$conf['ldap']['authentication'] = true;
$conf['ldap']['host'] = 'ldapserverip';
$conf['ldap']['port'] = 389;
$conf['ldap']['basedn'] = "ou=People,dc=example,dc=com";
$conf['ldap']['lookupid'] = 'uid=root,ou=People,dc=example,dc=com';
$conf['ldap']['lookuppwd'] = 'secret';
$conf['ldap']['ssl'] = false;

$conf['app']['allowSelfRegistration'] = 0;
$conf['app']['useLogonName'] = 1;  ( Otherwise you have to login using email id)

Save the changes. Now you can login using the ldap users. During the first login, user session will be created.
You can login using default admin and change the permissions of already logged-in ldap users.
(Grant admin permission, change group, edit permission etc)