P r o f e s s i o n a l — M a n a g e m e n t — S o l u t i o n s
RSS icon Email icon Home icon
  • Install eaccelerator on FC4 with php 5.0.4

    Posted on November 12th, 2008 Admin No comments

    Eaccelerator is a PHP accelerator/encoder/caching utility that is based off of the old mmcache (which is no longer being maintained). What Eaccelerator does is it caches your PHP scripts so that the database is no longer being queried everytime someone needs a script. This is
    particularly useful for large forums, but pretty much anyone can benefit from it. Since these scripts are cached, you’ll notice a decrease in memory use and server load.

    Installation procedure.
    Lets get the source file first.
    wget http://heanet.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.4-rc1.tar.bz2

    bzip2 -d eaccelerator-0.9.4-rc1.tar.bz2
    tar xvf eaccelerator-0.9.4-rc1.tar

    Note:
    1) you need to find where PHP is installed. For most, it’s usually either “/usr/bin” or “/usr/local”, but it may be something else. you can find using which php command.
    2) if you are getting phpize: command not found , Then you need to install php-devel.

    yum install php-devel

    cd eaccelerator-0.9.4-rc1/

    phpize
    ./configure –enable-eaccelerator=shared –with-php-config=/usr/bin/php-config
    make
    make install

    Take note of where the shared lib was installed (last line of output of the the above command

    cp eaccelerator.ini /etc/php.d

    Edit the above (copied) file, locate this line:
    zend_extension_ts=”/usr/lib/php4/eaccelerator.so”

    and replace it with ( whatever path you have noted )

    zend_extension=”/usr/lib/php/modules/eaccelerator.so”

    Now all that’s left is to create a tmp dir for eaccelerator’s cache (/tmp/eaccelerator is the default, but you can change it in the above file), and restart apache.

    mkdir /tmp/eaccelerator
    chown apache /tmp/eaccelerator
    chgrp apache /tmp/eaccelerator
    chmod 644 /tmp/eaccelerator
    /sbin/service httpd restart

    Test by knocking up a phpinfo.php page or give php -v command via shell you should note.

    PHP 5.0.4 (cli) (built: Nov 8 2005 08:27:12)
    Copyright (c) 1997-2004 The PHP Group
    Zend Engine v2.0.4-dev, Copyright (c) 1998-2004 Zend Technologies
    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator

    Share/Save/Bookmark

  • Installing SquirrelMail on Unix and Linux systems

    Posted on August 5th, 2008 Admin No comments

    This articler covers installation of SquirrelMail on generic Unix or Linux system. It does not cover installation of operating system or tools required to install web server or PHP. Any version numbers used in examples are specific to the time when this documentation is written. If current version numbers differ, make sure that you are not using old, obsolete or vulnerable software. Guide uses UW IMAP server as example. This IMAP server can be used in generic email setup when incoming mail is stored in /var/spool/mail directory. If you are planning to use webmail with big number of users or with bigger mailboxes, consider using different IMAP server and redesign entire email system.
    Download required software

    You will need:

    * Apache – http://httpd.apache.org/download.cgi
    * PHP – http://php.net/downloads.php
    * UW IMAP – http://www.washington.edu/imap/
    * SquirrelMail – http://squirrelmail.org/download.php

    # install -d /usr/local/src/downloads
    # cd /usr/local/src/downloads
    # wget http://some-apache-mirror-server/apache/httpd/httpd-2.0.54.tar.gz
    # wget http://some-php-mirror-server/get/php-4.3.11.tar.bz2/from/this/mirror
    # wget ftp://ftp.cac.washington.edu/mail/imap.tar.Z
    # wget http://some-sourceforge-mirror/some-path/squirrelmail-1.4.5.tar.bz2

    Unpack and install apache

    # cd /usr/local/src
    # tar -xzvf /usr/local/src/downloads/httpd-2.0.54.tar.gz
    # cd httpd-2.0.54
    # ./configure –prefix=/usr/local/apache –enable-module=so
    # make
    # make install

    Unpack and install php

    # cd /usr/local/src
    # tar –bzip2 -xvf /usr/local/src/downloads/php-4.3.11.tar.bz2
    # cd php-4.3.11
    # ./configure –prefix=/usr/local/php \
    > –with-apxs2=/usr/local/apache/bin/apxs
    # make
    # make install

    If you configure PHP compilation with –disable-all option, you must add –enable-session and –with-pcre-regex options.
    Add PHP support to apache

    <IfModule mod_php4.c>
    AddType application/x-httpd-php .php
    </IfModule>

    Restart apache and check if php is working

    /usr/local/apache/bin/apachectl graceful

    <?php phpinfo(); ?>

    Unpack and install imap server

    Unpack UW IMAP archive.

    # cd /usr/local/src
    # tar -xzvf /usr/local/src/downloads/imap.tar.Z

    Compile UW IMAP

    cd /usr/local/src/imap-<someversion>
    make port-name EXTRADRIVERS=” SSLTYPE=unix

    Replace port-name with name that matches your system. Check Makefile for possible values. If you haven’t installed OpenSSL libraries and headers, use SSLTYPE=none instead of SSLTYPE=unix.

    Install IMAP server binary

    strip imapd/imapd
    install -d /usr/local/libexec/
    cp imapd/imapd /usr/local/libexec/

    Enable IMAP server in inetd.conf

    imap2 stream tcp nowait root /usr/sbin/tcpd /usr/local/libexec/imapd

    Restart inetd

    Prepare SquirrelMail directories

    # mkdir /usr/local/squirrelmail
    # cd /usr/local/squirrelmail
    # mkdir data temp
    # chgrp nogroup data temp
    # chmod 0730 data temp

    Unpack SquirrelMail

    # cd /usr/local/squirrelmail
    # tar –bzip2 -xvf /usr/local/src/downloads/squirrelmail-1.4.5.tar.bz2
    # mv squirrelmail-1.4.5 www

    Configure SquirrelMail

    Start SquirrelMail configuration utility. Configure SquirrelMail with UW preset. Set data and attachment directories.
    Configure access to SquirrelMail in Apache

    Modify httpd.conf

    Alias /squirrelmail /usr/local/squirrelmail/www
    <Directory /usr/local/squirrelmail/www>
    Options Indexes
    AllowOverride none
    DirectoryIndex index.php
    Order allow,deny
    allow from all
    </Directory>

    Log into SquirrelMail

    After you add alias to SquirrelMail in apache configuration and restart apache, you should be able to access SquirrelMail by going to http://your-server/squirrelmail.

    Share/Save/Bookmark

  • Apache mod_rewrite

    Posted on July 21st, 2008 Admin No comments

    This module uses a rule-based rewriting engine (based on a regular-expression parser) to rewrite requested URLs on the fly. It supports an unlimited number of rules and an unlimited number of attached rule conditions for each rule to provide a really flexible and powerful URL manipulation mechanism. The URL manipulations can depend on various tests, for instance server variables, environment variables, HTTP headers, time stamps and even external database lookups in various formats can be used to achieve a really granular URL matching….

    Read the rest of this entry »

    Share/Save/Bookmark

  • Apache cannot be started with the error “(98)Address already in use: make_sock: could not bind to address [::]:443 no listening sockets available, shutting down

    Posted on July 9th, 2008 Admin No comments

    First of all make sure that “Listen” directive is specified only once in Apache configuration for one port. Chcek the httpd.conf and conf.d/* files in order to find it (on some OSes, like SUsE also /etc/apache2/* should be chacked).
    Read the rest of this entry »

    Share/Save/Bookmark

  • Apache failed to start with the error: “PHP Fatal error: [ionCube Loader] The Loader must appear as the first entry in the php.ini file in Unknown on line 0″

    Posted on July 9th, 2008 Dan No comments

    When you are trying to start Apache, the following error appears in console output and in apache error log:
    Read the rest of this entry »

    Share/Save/Bookmark

  • No space left on device

    Posted on July 9th, 2008 Dan No comments

    Apache cannot be started, error_log reports the following errors:

    Read the rest of this entry »

    Share/Save/Bookmark

  • Apache failed to start with the “could not open document config file” error

    Posted on July 9th, 2008 Dan No comments

    Apache failed to start with the error:

    # /etc/init.d/httpd start
    Starting httpd: httpd: could not open document config file /var/www/vhosts/DOMAIN/conf/httpd.include
    [FAILED]

    Read the rest of this entry »

    Share/Save/Bookmark