Archive for January, 2008

On shared hosting server’s you’ll probably find yourself blocked by other mail providers because of high mail volume or one of your users spamming. To change your exim IP for outgoing mail, you can edit your /etc/exim.conf file and locate this section:

remote_smtp:
driver = smtp

And below this add:

interface - xxx.xxx.xxx.xxx

Replace the x’s with the backup mail IP. Note that the backup mail IP needs to be added to the server, and should have a valid PTR and A-record.

Note:  On newer versions of cPanel where domainkeys are installed, you will need to add another interface line:

 dk_remote_smtp:
driver = smtp
dk_private_key = “/var/cpanel/domain_keys/private/${dk_domain}”
dk_canon = nofws
dk_selector = default
interface = xxx.xxx.xxx.xxx

Did you do something stupid on your server, and now you’re locked out and can’t get back in to fix it?  Luckily cPanel bundled in some autofixer scripts that you can use to correct some common problems directly from WHM if you don’t have SSH access to the server, or you don’t know how to fix them.  All the scripts can be called by accessing the following URL:

https://yourserverip:2087/scripts2/autofixer

Below are the script names that you may find the most handy:

iptablesflush - resets iptables on your server in case your firewall has locked you out from SSH

safesshrestart - restores your SSH configuration and restarts sshd in safe mode in case a change you made to the service has locked you out of SSH

yumduprpmfix - attempts resolve duplicate RPM issues within yum

You can find some more scripts here:

http://httpupdate.cpanel.net/autofixer/

These files will need to be downloaded to /usr/local/cpanel/src on your server.

Vanessa posted a full article on her site explaining what email spoofing is and how to generate an SPF record. This post will simply explain how to install your SPF record using WebHost Manager.

A general SPF record looks like this:

"v=spf1 a mx ~all"

In WHM, go to ‘Edit DNS Zone’ and click the domain that you wish to add the SPF to. Once you open the zone editor, go down the the bottom where you will see several blank spaces to add custom records. In the first box, you will put the domain name followed by a period:

domain.com

The second box will be the TTL, which can remain the same. The third box will be a drop down of record types. For an SPF record, you would use ‘TXT”.

The third box will be where you actually paste the SPF record, enclosed in quotes with no period at the end.

“v=spf1 a mx ~all”

Once you’ve installed this, save your changes and verify via the dig command that the changes were successful:

dig @nameserver domain.com TXT

Source: v-nessa.net

ffMPEG commonly consists of and includes the following software:

- Essential / MPlayer
- FLVtool2 (Requires a Ruby Core)
- LAME MP3 Encoder
- php-ffMPEG
- ffMPEG
- libOgg
- libvorbis

To start out, enter into a temporary source directory and download all the binaries:

cd /usr/src
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
wget http://www4.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.0.tbz2

*These are the latest stable versions at the time this article was written. If you are unable to download any of the above, you’ll need to visit the distributor’s site and download the latest stable version available.

Now extract everything:

bunzip2 essential-20061022.tar.bz2; tar xvf essential-20061022.tar
tar zxvf flvtool2-1.0.6.tgz
tar zxvf lame-3.97.tar.gz
bunzip2 ffmpeg-php-0.5.0.tbz2; tar xvf ffmpeg-php-0.5.0.tar
bunzip2 MPlayer-1.0rc2.tar.bz2 ; tar -xvf MPlayer-1.0rc2.tar

Create and import the Codecs directory:

mkdir /usr/local/lib/codecs/
mv essential-20061022/* /usr/local/lib/codecs/
chmod -Rf 755 /usr/local/lib/codecs/

Install Subversion and Ruby

yum install subversion
yum install ruby  (If you’re on cPanel you can alternatively use /scripts/installruby)
yum install ncurses-devel

Get ffMPEG and MPlayer from SVN:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer

Install LAME:

cd /usr/src/lame-3.97
./configure && make && make install

Install libOgg and libVorbis:

yum install libogg.i386
yum install libvorbis.i386
yum install libvorbis-devel.i386

Install flvtool2

cd /usr/src/flvtool2-1.0.6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

Install MPlayer:

cd /usr/src/MPlayer-1.0rc2
./configure && make && make install

Install ffMPEG:

cd /usr/src/ffmpeg/
./configure –enable-libmp3lame –enable-libvorbis –disable-mmx –enable-shared
make && make install

This is the typical configure line that I use, but you can customize this to what you need. For available configure options, type ./configure –help. Your custom configuration may require the installation of additional software on the server.

ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51

You may get an error about a library path not being found, if so, run

export LD_LIBRARY_PATH=/usr/local/lib

If this is being installed on a dedicated server, you might also get an error about the /tmp directory not be executable, which is common when installing on a dedicated server with a separate /tmp partition mounted noexec. In this case, you will need to create a tmp dir in the ffmpeg folder and use that as the tmp disk for now:

mkdir tmp
chmod 777 tmp
export TMPDIR=./tmp

Then run the configure command and set the TMPDIR variable back.

export TMPDIR=/tmp

Install ffMPEG-php

cd /usr/src/ffmpeg-php-0.5.0/
phpize
./configure && make && make install
ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg
ln -s /usr/local/bin/mplayer /usr/bin/mplayer

When the installation is complete, it will give you a long path to the shared libraries. This needs to be copied to the php.ini as so:

[ffmpeg]
extension=/usr/local/lib/php/extensions/no-debug-non-zts-20020429/ffmpeg.so

or in most cases where the extension_dir variable is set, just do:

extension=”/ffmpeg.so”

The ‘no-debug-non-zts-xxxxxxxx’ directory will be the one provided during installation. When this is done, restart Apache and check that the module is loaded in PHP:

/etc/init.d/httpd restart
php -r ‘phpinfo();’ | grep ffmpeg

Look for this:

ffmpeg
fmpeg support (ffmpeg-php) => enabled
ffmpeg-php version => 0.5.0
ffmpeg.allow_persistent => 0 => 0

If you only get output for the ‘PWD’ variables, make sure that the extension_dir path is correct in the phpinfo file. Sometimes there are two specified, and if that is the case then the incorrect one should be commented out.

Test out ffmpeg for errors just by typing ffmpeg at the command line. The most common error is:

ffmpeg: error while loading shared libraries: libavformat.so.51: cannot open…

To correct this, edit /etc/ld.so.conf and add the line

/usr/local/lib

then save and exit.

Now run this command to reload the library cache:

ldconfig -v

You’re all done…enjoy!



Site Navigation