Hello All,
The information contained in this email can also be viewed here:
http://www.aikiframework.org/wiki/Aiki_Robust_Update_System in the section
titled Development Notes.
Development Notes Related Source Changes
1. renamed src/aiki.php to src/bootstrap.php and src/libs/core.php to
src/libs/aiki.php
2. added Aiki database session save handler as opposed to the default PHP
file handler
3. added Aiki sessions table to src/sql/CreateTables.sql
4. added Aiki Exception class
5. added log exception method to the log utility
6. added autoconf feature to --enable-update which is disabled by default
7. added autoconf variables for setting directories related to update
8. added optional update dialog to the admin interface
9. added basic ground-work and partial implementation of classes related
to update system
10. added makefile for captcha
Parts of the Aiki update system implementation are mostly complete and
working:
1. Admin Interface Update Dialog
2. Check for Update
3. Check Minimum Requirements are Met
4. Download Update Package
5. Validate Update Package
6. Decompress Update Package
7. Backup Existing Aiki Installed Files and Database
Here are the commands I use to install and test:
./autogen.sh \
&& cd build \
&& DB_SUPER_USER_PASS=password \
DB_PASS=aiki \
AIKI_LOG_LEVEL=debug \
AIKI_SAVE_DIR=save \
../configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--enable-update \
&& make distall \
&& make install-mysql-user \
&& sudo cp -a aiki-[0-9].[0-9].[0-9][0-9] /var/www/html/aiki \
&& sudo chmod 0755 /var/www/html/aiki \
&& sudo mkdir -vp -m 0700 /var/log/aiki \
&& sudo chown steven /var/log/aiki \
&& firefox http://localhost/aiki/ &
The parts of the update system that are NOT working or partially
implemented:
1. Backup->restore Methods for FileBackup and DatabaseBackup
2. Updater Classes
1. The Updater should use the Upgrade object
2. FileUpdater should contain the specifics of updating the Aiki files
3. DatabaseUpdater should contain the specifics of updating the Aiki
database
3. Updates Class
1. This should contain ALL of the version specific methods for updater
(example: public function _0_8_24_871($args))
4. Upgrade Classes
1. ConfigUpgrade should contain the specifics of a configuration
upgrade (config.php aiki_config table)
2. SiteUpgrade should contain the specifics of a Aiki site/app upgrade
(example: /assets or /admin)
3. CoreUpgrade should contain the specifics of a everything that is
NOT a site or config upgrade, but Aiki core
Direction
The current direction the update system is taking to overcome the write
privilege issue is depending on suPHP which is a Apache module PHP handler
that enables the PHP script process to run as the owner of the script. It is
my understanding that Wordpress uses a similar method (or Fast CGI) as well
for their updater. This means that for the Aiki update system to work, suPHP
must be installed and configured properly. Otherwise the updater will fail
gracefully, letting the users know they do not meet the requirements. The
Aiki update system supports the run-time type of installation package. The
Aiki update system will not support the 'sudo make install' type
installation as the owner of the files would be root.
suPHP Configuration
This is the working setup I'm testing with and other systems may vary. The
version is suPHP-0.6.3.
Installing:
sudo yum -y install mod_suphp
The files installed:
/etc/httpd/conf.d/mod_suphp.conf
/etc/suphp.conf
/usr/lib/httpd/modules/mod_suphp.so
/usr/sbin/suphp
Apache Supplemental Configuration (should be in httpd.conf or related conf):
<Directory /var/www/html/aiki>
<IfModule mod_suphp.c>
suPHP_AddHandler php5-script
suPHP_Engine on
# Directory php.ini is in
suPHP_ConfigPath /etc
</IfModule>
</Directory>
The above directory element value should point to a valid Aiki root
directory.
Apache Supplemental Configuration (/etc/httpd/conf.d/mod_suphp.conf):
# This is the Apache server configuration file providing suPHP support..
# It contains the configuration directives to instruct the server how to
# serve php pages while switching to the user context before rendering.
LoadModule suphp_module modules/mod_suphp.so
My suPHP Configuration file (/etc/suphp.conf):
[global]
;Path to logfile
logfile=/var/log/suphp.log
;Loglevel
loglevel=info
;User Apache is running as
webserver_user=apache
;Path all scripts have to be in
docroot=/
;Path to chroot() to before executing script
;chroot=/mychroot
; Security options
allow_file_group_writeable=false
allow_file_others_writeable=false
allow_directory_group_writeable=false
allow_directory_others_writeable=false
;Check wheter script is within DOCUMENT_ROOT
check_vhost_docroot=false
;Send minor error messages to browser
errors_to_browser=true
;PATH environment variable
env_path=/bin:/usr/bin
;Umask to set, specify in octal notation
umask=0077
; Minimum UID
min_uid=500
; Minimum GID
min_gid=500
; Use correct permissions for mod_userdir sites
handle_userdir=true
[handlers]
;Handler for php-scripts
php5-script=php:/usr/bin/php-cgi
;Handler for CGI-scripts
x-suphp-cgi=execute:!self
Unfortunately, I have reached a critical time and will not be able to
continue contributing to Aiki untill after I find employment. I hope to
rejoin soon. I've enjoyed being part of the Aiki team! I wish you all the
best!
Steven
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help : https://help.launchpad.net/ListHelp