Categories
Unix Notes Web Serving

Getting to PHP 5

10.3.9 – no help beyond 4.3.11 from Marc Liyanage.

Apple’s 4.4 is of no help – no GD support, missing other things – PEAR, XML things, etc.

How do I make a compatible build?

Start with Apple’s configure command (use phpinfo() on a standard installation). It *will* screw up your system files nicely, so make sure you know what each of the files and directories means! I didn’t. I have an interesting mix of system/local files now.

Add extensions as needed. Test ./configure each time, and you might as well re-build each time.

Decide where to get libraries. I finally decided to use darwinports for the non-Apple standards. Look out for X11 when not installed!!!!

Use the built-in GD ‘–with-gd’ – no path. darwinports gd has issues (won’t build).

I wound up with this

configure –prefix=/usr –mandir=/usr/share/man –infodir=/usr/share/info –with-apxs –with-ldap=/usr –with-kerberos=/usr –enable-cli –with-zlib-dir=/usr –enable-trans-sid –with-xml –enable-exif –enable-ftp –enable-mbstring –enable-mbregex –enable-dbx –enable-sockets –with-iodbc=/usr –with-curl=/opt/local –with-config-file-path=/etc –sysconfdir=/private/etc –with-pear –with-mysql=/usr/local/mysql –with-openssl=/usr –with-gd –with-png=/opt/local –with-jpeg=/opt/local –with-expat=/opt/local –with-gettext=/opt/local –with-dom=/opt/local –with-dom-xslt=/opt/local –with-xslt-sablot=/opt/local –enable-xslt –with-xmlrpc –enable-wddx

I still need to figure out about IMAP support.

Categories
Unix Notes

macosxhints.com – Modify cursor movement keys in Terminal


macosxhints.com – Modify cursor movement keys in Terminal

The defacto standard in Terminal’s shells is meta-b (backward) and meta-f (forward) for word-by-word movement. In every other Cocoa app, however, it’s Option-left arrow and Option-right arrow. I wanted Terminal to behave the same way.

Categories
General Unix Notes Utilities Notes

palm-db-tools

configure.env-append LD=g++ CC=g++

darwinports

need to add that line after configure.args – elsewise it never loads
spent all day trying to figure this out

pdb2csv csv2pdb

Categories
Unix Notes

ipfw

from your terminal

man ipfw

the command to deny/drop packets for a host is simply

sudo ipfw add drop src-ip 217.59.146.158

which can be seen to be effective by doing this

teatime 5 # sudo ipfw show

Categories
Unix Notes

Date entertainment

get last month using bash and the date command

MON=`date +”%m”`
((MON=$MON-1))
-bash: ((: MON=09: value too great for base (error token is “09”)

So, do this

MON=`date +”10#%m”`
((MON=$MON-1))
echo $MON
8

How entertaining – bash treats the leading zero as an indicator of octal.

Same would need to be done for any of the `date` formats that return leading zero as part of the result.

to get the seconds since EPOCH for other reasons –

date -r $((`date ‘+%s’` – 86400))

This version has no problem with the boundary condition of month number 1

MYDATE=`date +”%Y%m”`
YEAR=${MYDATE:0:4}
MONTH=$((10#${MYDATE:4:2} – 1))
[[ $MONTH == 0 ]] && MONTH=12 && ((YEAR–))

theReport=Web-Report-Monthly-$YEAR-$MONTH.html

Categories
Unix Notes x.opus1.com

Postfix Virtual Domain Hosting Howto

Postfix Virtual Domain Hosting Howto

1 /etc/postfix/main.cf:
2 virtual_alias_domains = example.com …other hosted domains…
3 virtual_alias_maps = hash:/etc/postfix/virtual
4
5 /etc/postfix/virtual:
6 postmaster@example.com postmaster

Handy

Execute the command

“postmap /etc/postfix/virtual”

after changing the virtual file, and execute the command

“postfix reload”

after changing the main.cf file.

Categories
Mac OS X Server Unix Notes x.opus1.com

PHP enabling

often the PHP enabling (LoadModule AddModule) will be made correct during system update

we enable later

after system updates check and make sure that the PHP enabling is commented out in httpd.conf

we enable at the end – entropy

Categories
Unix Notes x.opus1.com

Stop Deleting web logs

/etc/periodic/daily
500.daily

comment out delete of old access log files – we want them and will manually delete them

Categories
Mac OS X Server Unix Notes x.opus1.com

postfix and ports

add access to port 2525 by changing /etc/postfix/master.cf – look in the .cf file for examples
restart the mail service

can be useful in deciding if ISP is blocking port 25 access.

Categories
Unix Notes

macosxhints – 10.3: Create Postfix mail user aliases

macosxhints – 10.3: Create Postfix mail user aliases

Now you should edit the /etc/aliases file. Using your favorite editor (mine is vi), edit the file:
sudo vi /etc/aliases

Aliases are rather simple to set up. You should add any aliases that you want under the heading: # Put your local aliases here. If you want to alias foo so that it is delivered to Bob’s account (bob), then you would do the following:
foo: bob

You can add as many aliases as you want for a person. When you are done, you MUST run the following command for Postfix to load the aliases (starting and stopping Postfix will NOT reload the aliases file):
sudo newaliases

mailq