Thursday, August 31, 2006

Install/Update eAccelerator

eAccelerator v0.9.5-rc1 - http://eaccelerator.net/


eAccelerator is a free open-source PHP accelerator, optimizer, encoder and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times.

eAccelerator was born in December 2004 as a fork of the Turck MMCache project. Turck MMCache was created by Dmitry Stogov and much of the eAccelerator code is still based on his work.

eAccelerator stores compiled PHP scripts in shared memory and executes code directly from it. It creates locks only for a short time, while searching for a compiled PHP script in the cache, so one script can be executed simultaneously by several engines. Files that can't fit in shared memory are cached on disk only.

eAccelerator also contains a PHP encoder and loader. You can encode PHP scripts using encoder.php in order to distribute them without sources. Encoded files can be run on any site which runs PHP with eAccelerator. The sources of encoded scripts can't be restored because they are stored in a compiled form and the encoded version doesn't contain the source. Of course, some internals of the scripts can be restored with different reverse engineering tools (disassemblers, debuggers, etc.), but it is not trivial.


code:

wget http://www.web4host.net/tools/eaccelerator.sh
chmod 755 eaccelerator.sh
./eaccelerator.sh



when done you see link look like
quote:
/usr/local/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so

copy your like to add in php.ini

edit php.ini
code:
nano -w /usr/local/lib/php.ini


add this after Windows Extensions, in the list down.
code:
zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20020429/eaccelerator.so"
eaccelerator.shm_size="32"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"


save and restart apache
code:
/sbin/service httpd restart


*END*

test your work now

code:
php -v

if your install done you will see look like this
code:
> php -v
PHP 4.4.2 (cli) (built: Jul 29 2006 04:09:14)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
with eAccelerator v0.9.5-rc1, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by Zend Technologies
with Zend Optimizer v3.0.1, Copyright (c) 1998-2006, by Zend Technologies

Enjoy!

AwStats plugin for DirectAdmin

AwStats DA Plugin : v.2.1.9 09-Jan-2006 (GMT+1)
Awstats Version: (Auto-Update)

ALWAYS USE LATEST DA RELEASE - EXTRA FEATURES AREN'T ADDED ANYMORE, SO DON'T REQUEST

Use the above url in your DA Plugin Management to install (Admin-Level).

On user-level users, can activate awstats on their domain through the control panel.
It creates a /awstats for the specified domain. So you can browse to: http://www.yourdomain.com/awstats
and see the statistics.

Admin-level, choose wich users can access awstats plugin.

It features password protection and all other awstats functions.

If you want to install awstats to all domains, login as root on your machine and run: /usr/local/directadmin/plugins/awstats/hooks/alldomains.php

For use in a Cron
Add to cron: /usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats_updateall.pl now -awstatsprog=/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl

*OR*


Replace:-

10 0 * * * root echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue

With:-

10 0 * * * root /usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats_updateall.pl now -awstatsprog=/usr/local/directadmin/plugins/awstats/hooks/cgi-bin/awstats.pl && echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue


This size is in MB's and this will let the update only update the log's bigger as this SIZE. So : -rotated 99 will only update logs bigger as 99 MB. (For example da logrotate size)


I don't recommend upgrading the awstats.pl yourselfs as the original has a minor bug/feature in it, that would let you read any stats for any apache log file. (This is a customized version of AwStats and a customized version of the awstats_updateall.pl with some extra's in it).


Automaticaly give access to stats to new users

# cd /usr/local/directadmin/scripts/custom
# vi user_create_post.sh

Add the following to the new file or add the line if exists:

quote:


#!/bin/sh
echo $username >> /usr/local/directadmin/plugins/awstats/hooks/permissions.txt




# save the file VI command ( 'ESC' then ':' then 'wq!' )
# chmod a+x user_create_post.sh

This should now automaticaly add new users to the permissions file!


Use /usr/local/directadmin/plugins/awstats/update/update.sh to update your awstats, to the latest version!!

Wednesday, August 30, 2006

How to install Roundcubemail on Your server

WARNING: This application is ALPHA software. Use at your own risk

I found roundcube mail while searching projects on freshmeat. Already in Alpha stage is runs very nice, has a great template system and uses xhtml/css 2 (although the xhtml could be strict and much better) the default template is great. It currently lacks a search but that is coming in the future.

http://www.roundcube.net/

So lets get started.
=============================

1) Create a mysql db via direct admin. I called mine admin_webmail (you should all know how to do this!)

2) Download and unpack the package:

code:


cd /var/www/html

wget http://easynews.dl.sourceforge.net/...20051007.tar.gz

tar xvfz roundcube_webmail_0.1-20051007.tar.gz



3) Ensure proper permissions of the folders:

code:

chown -R root.root roundcubemail

cd roundcubemail

chown -R apache logs temp



4) Import their SQL file:

code:

cd SQL

//replace the following with the database username
and password you created in step 1

mysql -u admin_webmail -p
Enter Password: *******



Once in, import their SQL file:
code:

use admin_webmail

SOURCE mysql.initial.sql



now the import should be complete.

5) Setup db config variables

code:

cd ../config/

nano db.inc.php



all you have to do here is change the "$rcmail_config['db_dsnw'] = " config information, mine looks like this:

code:

$rcmail_config['db_dsnw'] = 'mysql://myWebmail:myPass@localhost/admin_webmail';



the format is: mysql://:@host/database_name

save that file and close it.

6) Setup the application config:

code:

nano main.inc.php



find this line:

code:

$rcmail_config['enable_caching'] = TRUE;



Replace with:

code:

$rcmail_config['enable_caching'] = FALSE;



next find:

code:

$rcmail_config['default_host'] = '';



replace with:

code:

$rcmail_config['default_host'] = 'localhost';



7) *optional* you may want to setup an apache alias, you can overwrite your current webmail one with the following:

Edit httpd.conf:

code:

nano /etc/httpd/conf/httpd.conf



Find this line:

code:

Alias /webmail /var/www/html/webmail/



Replace with:

code:

Alias /webmail /var/www/html/roundcubemail/



then restart apache
code:

/usr/sbin/service httpd restart



You are done!

Login @ http://www.domain.com/webmail/