Posts Tagged ‘FreeBSD’

18
Nov

FreeBSD forums launched!

   Posted by: Vinod Chacko    in FreeBSD

The FreeBSD project has announced the release of the FreeBSD forums

It will serve as a public channel for FreeBSD users around the world and as a complement to the great mailing lists.For me its a great relief because I rarely can keep trac of these emails :)

Tags:

6
Nov

Send Authenticated email using PHP

   Posted by: Vinod Chacko    in FreeBSD

This is a bit modified version which I found in net so that the destination address is selected from a database.

<?php
include(“Mail.php”);
/* mail setup recipients, subject etc */
$_dbHost = ‘localhost’;
$_dbUser = ‘mailer_user’;
$_dbPass = ‘emailtest’;
$_dbName = ‘mailer_db’;

$sqlGetFromAddress =’SELECT email_address FROM mailer_table’;

$_db = mysql_connect($_dbHost, $_dbUser, $_dbPass);
mysql_selectdb($_dbName, $_db);
$rs = mysql_query($sqlGetFromAddress, $_db);

while($row = mysql_fetch_assoc($rs)){
echo “\n Sending to : {$row['email_address']}”;
$recipients = $row['email_address'];
$headers["From"] = “from@yourmailaddress.net”;
$headers["To"] = $row['email_address'];
$headers["Subject"] = “Your Subject”;
$mailmsg = “Your test message”;
/* SMTP server name, port, user/passwd */
$smtpinfo["host"] = “Your.smtpserver.net”;
$smtpinfo["port"] = “25″;
$smtpinfo["auth"] = true;
$smtpinfo["username"] = “smtpusername”;
$smtpinfo["password"] = “smtppass”;
/* Create the mail object using the Mail::factory method */
$mail_object =& Mail::factory(“smtp”, $smtpinfo);
/* Ok send mail */
$mail_object->send($recipients, $headers, $mailmsg);
}
?>

Tags: ,

6
Nov

FreeBSD – Disk partitioning

   Posted by: Vinod Chacko    in FreeBSD

Recently I had an issue while installing FreeBSD. ie, the installation will finish with no issues. But the FreeBSD was not starting up. It will not go beyond the boot loader. There was hardly no hair heft on my head that I found the cause of the issue… :)

ie I provided the partitions in a different way than the default. The order should be…

/

swap

/tmp

/usr

/var

/var/db

/usr/home

Tags:

21
Oct

Installing eAccelerator on FreeBSD

   Posted by: Vinod Chacko    in FreeBSD

eAccelerator is a PHP caching system, which caches frequently used portions of PHP files to RAM to increase performance. This is especially great on high traffic websites such as forums. Performance gains of up to 1000% have been seen with eAccelerator. The following tutorial is how to install eAccelerator on FreeBSD using ports.

Using ports, compile and install:

cd /usr/ports/www/eaccelerator

make

make install

Make modifications to php.ini:

If you are using Zend:

vi /usr/local/etc/php.ini (this is the default location)

Add the following:

zend_extension=”/usr/local/lib/php/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″

Comment out the following lines:

zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.5.7
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.5.7

If you are not using Zend optimiser the add the following to your php.ini:

extension=”eaccelerator.so”
eaccelerator.shm_size=”16″
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″

Create the caching directory:

mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator

You can check if eAccelerator is working by copying the following file into your htdocs folder:

/usr/ports/www/eaccelerator/work/eaccelerator/eaccelerator.php

Tags: , , , ,

11
Oct

update the ports tree in FreeBSD

   Posted by: Vinod Chacko    in FreeBSD

Many of us have used the FreeBSD ports to install some thing or other in a FreeBSD server. and a few knows how to update it to the latest tree.

First of all, you have to choose to install the ports at the installation time. Then, after logging on to the machine as root or su’ing to root, we need to install cvsup, the program that will download the latest information from the FreeBSD servers.

$ cd /usr/ports/net/cvsup-without-gui
$ make install
$ make clean

Now, we need to configure the cvsup so that it knows what to download from the FreeBSD update servers.

cd /etc ; vi cvsupfile

add the following lines into the file and quit.

*default  host=cvsup2.FreeBSD.org
*default  base=/usr
*default  prefix=/usr
*default  release=cvs
*default  tag=none
*default  delete use-rel-suffix
*default tag=.
ports-all
doc-all

Thats it! the configuration is done.To update the ports tree, login to the server and issue the following command.

cvsup -g -L2 /etc/cvsupfile

Once you are done, you may need to issue cd /usr/ports ; make fetchindex to update the port index file.

Tags: ,