inicio mail me! sindicaci;ón

Archive for March, 2009

Changing SMTP Port to 587 (ISP Blocking and SASL)

I got tired of ISPs blocking outgoing port 25, so I moved our SMTP for clients to port 587. Unfortunately, when migrating our new server, I couldn’t remember how to do this.

After some Googling, I found the answer; add this line in /etc/postfix/master.cf, substituting your port number for 25000:

25000 inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes

I left port 25 on too, so users can try either from their ISP. If you want to turn off port 25, just comment out this line:

smtp    inet    n       -       n       -       -       smtpd -o smtpd_sasl_auth_enable=yes

Remember to open up the port in your server firewall as well!

“undefined function mysql_connect()” While Migrating Virtualmin

While migrating virtualmin to our shiney new CentOS 5  box, I ran into this error on all our PHP sites:

If I look at php info, it shows –with-mysql, but there is no mysql section farther down. It looked like PHP’s Apache module was having trouble finding the mysql.so file. I immediately thought to check for the php-mysql module (there is no php5-mysql for CentOS 5, I noted) and found it installed:

[root@server apf]# yum install php-mysql
...
Parsing package install arguments
Package php-mysql - 5.1.6-20.el5_2.1.i386 is already installed.
Nothing to do

After a short dive into the php.ini settings, I noted that all the restored sites had this in their php.ini file:

extension_dir=/usr/lib/php5/modules

But that dir doesn’t exist. Connecting the dots, I realized that CentOS 5 has moved all the PHP 5 data to the default. So the dir is now at /usr/lib/php/modules. And this solved the rest:

[root@server lib]# ln -s /usr/lib/php /usr/lib/php5
[root@server lib]# ls -ld /usr/lib/php*
drwxr-xr-x 4 root root 4096 Jul 16  2008 php
lrwxrwxrwx 1 root root    3 Mar 30 21:01 php5 -> php
[root@server lib]# /etc/init.d/httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Yay!

Syntax Highlighting in MediaWiki

I wanted to put syntax highlighting in the new ztdev wiki. So off to google I went.

I checked out Extension:Syntax_Highlighting, but it required a pear extension to run and doesn’t produce great output, so I checked it back in again.

I also looked at Extension:Geshi, but I didn’t care for the absurd tags needed to make this run. Plus, the installation required pear extensions and other mediawiki extensions to be installed. Yarr. So I reported back to Google.

Then I found Extension:GeSHiHighlight . GeSHi based, so you know the highlighting is awesome, and it uses simple tags like <php>, etc to enforce the highlighting. Yay!

Installation was a sinch–4 steps listed in plain english. Do note the WARNING at the bottom about <div> and <css> tags! You may need to rename those as suggested in the wiki.

Adding Nav Links and Sidebars in MediaWiki

I tried to edit my nav links on a new MediaWiki page today. Yikes.   It’s not exactly click-to-edit, but it’s not impossible either, once you’ve waded through the mis-information available about how this is done.

  1. 1. Type MediaWiki:Sidebar into the search box
  2. 2. Click Go
  3. 3. Click on the edit tab. If this page has never been visited, there may not be an edittab; Click on create instead.
  4. 4. Make changes as desired.

Editing Other Bars

To edit other components on the sidebars, try the following pages:

Search Sidebar: MediaWiki:Search
Toolbox Sidebar: MediaWiki:Toolbox