Running scripts at predetermined times

You can use cron to schedule jobs to run at regular time intervals, but to run a script at a particular time and date, use the ‘at’ command.

at TIME [DATE] -f scriptname

where TIME is like 2:30pm or 10:00am, and date is in the format like ‘Mar 10’ or ‘Apr 01’.

To view scripts that are scheduled for execution, use the command: atq

This lists the scripts that are ‘queued’ for execution. The first digit on each line is the job number for each scheduled script. To remove/cancel a scheduled script, use the atrm command, with the job number.

Setting default routes

To set a default route via a router (192.168.0.1), use the following command:

<code>
route add default gw 192.168.0.1 netmask 0.0.0.0 eth0
</code>

– this will add a default route via the gateway at 192.168.0.1 for all traffic.

Installing and configuring Komplete CMS on Linux/Apache

Komplete is a CMS system developed in PHP. To install on Apache using the PHP module there are a number of other requirements that must be met. After dropping the komplete dir into your /var/www/html/ dir and configuring access in httpd.conf to that directory, the installation page for Komplete guides you through what prequisites are needed. Out of the box on my Fedora Core 4 server with Apache 2.0.54 here’s the feedback from the installation page:

<code>
OS Version:     Linux   Passed
PHP Version:    5.0.4   Passed
DOMXML/DOMXSLT: Yes/No  Not found
Multibyte String:       Yes/No  Not found
GD:     Yes/No  Not found
PHP-MySQL:      Yes/No  Exist
ImageMagick:    Yes/No  Exist
File Writable:  Writable        Not Passed
PHP Session:    Yes/No  Exist
</code>

The help on the install page guides you through was needs to be installed and configured:


DOMXML/DOMXSLT: Komplete requires the DOMXML/DOMXSL extensions active in your PHP installation. These extensions are actually wrappers for the libxml2 and libxslt1 GNOME libraries, that provide a very powerful and fast layer for XML/XSL transformations. To activate your DOMXML/XSL libraries, you should have those libraries installed (if you have a recent version of Linux on your server, libxml2 and libxslt1 should be already installed, as they are shipping with the GNOME package. We have tested with the Redhat 8 server system, the exact versions being : libxml-2.4.14, libxslt-1.0.19). If you don't have libxml and libxslt installed on your system, download them from http://xmlsoft.org and http://xmlsoft.org/XSLT/ and compile them. Then you should recompile your PHP version by adding the "--with-dom --with-dom-xslt --with-dom-exslt" configuration options before compiling.
You might also want to download our precompiled PHP distribution (packaged as RPM for RedHat 8.0) from ftp://ftp.interakt.ro/pub/Krysalis/rpms/

I checked that these libraries were installed:

<code>
#rpm -q libxml2
libxml2-2.6.19-1

# rpm -q libxslt
libxslt-1.1.14-2
</code>

(There is further info about installing and using DOMXML here: http://www.devarticles.com/c/a/PHP/Parsing-XML-With-DOMXML-And-PHP/1/

I then downloaded latest php src 5.0.5 from php.net, and ran the configure script with the options to compile in the needed features:

<code>
./configure --with-dom --with-dom-xslt --with-dom-exslt --enable-mbstring --with-gd
</code>

This gave an error:

<code>
If configure fails try --with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.
</code>

To fix this I downloaded libpng from: http://www.libpng.org/pub/png/libpng.html, copied the makefile from the scripts dir as per the instructions, and then:

<code>
make
make install
</code>

On running the configure script for php again, I got the next error:

<code>
If configure fails try --with-jpeg-dir=<DIR>
configure: error: PNG support requires ZLIB. Use --with-zlib-dir=<DIR>
</code>

… so now the configure script looked like this:

<code>
./configure --with-dom --with-dom-xslt --with-dom-exslt --enable-mbstring --with-gd
 --with-jpeg --with-zlib
</code>

.. this was clean, so then followed by:

<code>
make install
</code>

At this point I had unknowingly built the cgi mode PHP, and I needed the module for Apache.

Adding

<code>
--with-apxs2
</code>

compiles the Apache2.0 module.

<code>
./configure --with-dom --with-dom-xslt --with-dom-exslt --enable-mbstring --with-gd --with-zlib --with-mysql --disable-cgi --with-apxs2

make
make install
</code>

The .so was still not created. In order to compile Apache modules you need httpd-devel installed (for the apxs2 api):

<code>
yum install httpd-devel
</code>

Ran configure, make and deploy, and this time I had the module.

Copied .so to apache modules
– changed httpd.conf to point to php module.

At this point I had gained everything minus domxml and domxsl. I decided at this point togo back to PHP 4.4 which I think has different support for domxml and domxs. I configured and installed it the same as the steps above for PHP 5.0.

This post on the KompleteCMS website gives exact instructions on compiling and installing the exact versions of domxml and domxsl needed: http://www.kompletecms.com/support/forum/komplete_lite_forum/?top=6770