KOffice Web Site Debugging
Draft $Date: 2006-10-17 20:21:51 +0200 (Tue, 17 Oct 2006) $
Debugging: Quick start
Unfortunately there is no quick way to fully debug a page meant for the KOffice web site. You can do as much as possible before committing, then commit and check the result when the website updates. If you need to make significant changes to the website, see the Development section
For most of the PHP files, Konqueror does not recognize them as HTML files and therefore refuses to display them. The trick is to add <html> on the first line and </html> on the last line of the document.
Of course be careful not to commit these 2 debug lines.
Development
Aim
This section describes how to set up a local copy of the KOffice web site for development on your computer. It assumes that you have root access to your machine, and that you are running a distribution that provides Apache 2 and PHP4 packages. The instructions have been tested on Kubuntu and Debian.
It also assumes that you are able to download the sources for the entire website using Subversion. Currently, this is about a 100MB download, and the working copy on disk will take about 200MB.
The KOffice site (and KDE sites generally) need PHP to be configured in a certain way, for example to be able to find the appropriate include files. They also work best when a KDE site is installed at the top level of your webserver. These instructions ensure that you install the KOffice site in a way that is most likely to work, and without breaking any existing sites you currently have on your computer.
Step 1: Prepare website sources
These instructions assume that you will work with the KOffice
website sources under /opt. It should be simple to
use a different directory, but using /opt means you
get to copy and paste from the instructions below.
Firstly, ensure the user you are running as has write access to
/opt. This simplest way to do this is to make your
user the owner of that directory as root:
$ su Password: # chown user.user /opt # exit $
(where user is the name of the user you normally run
as.)
Now checkout the website sources from the Subversion repository:
cd /opt svn co svn://anonsvn.kde.org/home/kde/trunk/www/areas/koffice koffice-www
or, if you already have a Subversion account that has write access to the KOffice website:
cd /opt svn co https://svn.kde.org/home/kde/trunk/www/areas/koffice koffice-www
Step 2: Set up a hostname for the site
As root, open the file /etc/hosts.
Find the line that begins 127.0.0.1, and add
test.koffice.org to the end of the line.
It should look similar to the following:
127.0.0.1 localhost systemname test.koffice.org
(where systemname is the current name of your
machine)
Step 3: Install and configure a web server
At this point, you should install Apache 2 and PHP4, and ensure that Apache 2 can execute PHP scripts.
You may need to use the following command to make Apache load the PHP module:
# a2enmod php4
Now (as root) create a file called
/etc/apache2/sites-available/koffice with the following
contents:
NameVirtualHost test.koffice.org
<VirtualHost 127.0.0.1>
DocumentRoot /opt/koffice-www
ErrorDocument 404 /404.php
ServerName test.koffice.org
ErrorLog /opt/koffice-www/logs/kde-error_log
CustomLog /opt/koffice-www/logs/kde-access_log common
DirectoryIndex index.html index.php
<Location />
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Location>
php_value short_open_tag Off
php_value register_globals No
php_value safe_mode On
php_value include_path ".:/opt/koffice-www/media/includes"
</VirtualHost>
Enable the website using:
# a2ensite koffice
You should now restart your webserver. On Debian based systems this is done as root by:
# /etc/init.d/apache2 restart
Step 4:Modify the checkout for your system
In the /opt/koffice-www folder, there's a file called
.htaccess. This file is used by the KOffice web server
to run PHP as a CGI application. However, these instructions describe
setting up PHP as an Apache module, and the file causes problems
here.
These problems can be corrected by simply deleting the file:
rm /opt/koffice-www/.htaccessIt's important that you don't remove the file from the repository!
Step 5: Test your installation
You should now be able to visit http://test.koffice.org and see your local copy of the KOffice website.
The KOffice Project