August 24, 2006

[Redhat/Fedora] Sendmail smrsh ? Forwarding email to a program

Filed under: Unix Admin — HanaDaddy @ 11:50 pm

By default, Redhat & Fedora comes with smrsh activated.
In order to forward an email to a handler program, the handler program must be in /etc/smrsh (I am not sure if link is sufficient)

Refer to /etc/mail/sendmail.mc
Below line means that smrsh is used.

FEATURE(`smrsh',`/usr/sbin/smrsh')dnl

/etc/aliases

localemail:  |/etc/smrsh/mailhandler.sh

run newaliases to update the aliases db.

Also the /etc/smrsh/mailhandler.sh should read the input from the STDIN.

[redhat/fedora] Activate Sendmail

Filed under: Unix Admin — HanaDaddy @ 11:48 pm

If you want to activate sendmail (SMTP) Server…

/etc/mail/sendmail.mc file

uncomment by adding dnl in front of below line

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
</lang>
So it becomes
<pre lang="none">
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

(more…)

[php] PHP uploading problem

Filed under: Programming — HanaDaddy @ 11:40 pm

When you have problem with uploading large file to your PHP application, try to change below options in /etc/php.ini


;php.ini
max_execution_time = 0 ; unlimited
max_input_time = 0
memory_limit = 8M

;Maximum size of POST data that PHP will accept.
post_max_size = 240M ; Set this value to max upload file size that you want

file_uploads = On

; Maximum allowed size for uploaded files.
upload_max_filesize = 240M ; Set this value to max upload file size that you want

Also, if you use Apache 2.0 (Redhat) check if httpd.conf or /etc/httpd/cond.d/php.conf contains below option


LimitRequestBody 0 ; unit is bytes and 0 means unlimited.

[php] module compilation:Payflow Pro Verisign

Filed under: Programming — HanaDaddy @ 11:36 pm

I have my php already compiled and working perfectly, but I found that pfpro module was not compiled in.

I needed pfpro module, but I didn’t want to mess up with whole php recompilation…

First download linux SDK kit from verisign website. You need to create an account with verisign first.

Unzip/untar into /var/www/pfpro

So I decided with creating self-contained pfpro module.

1. make a directory and cd into it.
$mkdir mydir
$cd mydir

2. copy all files from php_source_dir/ext/pfpro to the new dir

$cp -rp /usr/src/redhat/SOURCES/php-x.x.x/ext/pfpro/* .

3. if you are using redhat, you need to install php-devel rpm package
Run

$phpize

4. Run
(php-config resides /usr/bin with redhat RPM, so you don't
need --with-php-config. /usr/bin is already in ENV)

$./configure --with-pfpro=shared,/var/www/pfpro/lib \
[--with-php-config=/path/to/php-config]

5. $make

6. $cp ./modules/pfpro.so /usr/lib/php4

7. insert below line into /etc/php.ini

extension=pfpro.so

8. restart httpd server

9. check with phpinfo()

NOTE: When you actaully code the php, you need to set environment variable n the php file before connecting to verisign. Of course you must provide the correct path.
putenv(”PFPRO_CERT_PATH=/var/www/pfpro/certs”);

[php] Installing addtional modules separately

Filed under: Programming — HanaDaddy @ 11:33 pm

Please refer to README.SELF-CONTAINED-EXTENSIONS from the original source distribution

—-from the readme file—-

Just to show you how easy it is to create a self-contained
extension, we will convert an embedded extension into a
self-contained one. Install PHP and execute the following
commands.

$ mkdir /tmp/newext
$ cd /tmp/newext

You now have an empty directory. We will copy the files from
the mysql extension:

$ cp -rp php-4.0.X/ext/mysql/* .

It is time to finish the module. Run:

$ phpize

You can now ship the contents of the directory - the extension
can live completely on its own.

The user instructions boil down to

$ ./configure \
[--with-php-config=/path/to/php-config] \
[--with-mysql=MYSQL-DIR]
$ make install

The MySQL module will either use the embedded MySQL client
library or the MySQL installation in MYSQL-DIR.

Page 4 of 8« First...«23456»...Last »
 

41 queries. 0.382 seconds. Powered by WordPress