Redirect webmail for Plesk Onyx

Recently I updated my Plesk server from v12.5 to Onyx v17. I had setup many custom configurations for SSL related matters like smtp/imap/pop and webmail. After upgrading to Onyx I found out that all of these custom configurations were not needed any more because everything could be configured from the plesk panel!

The way I had setup things was redirect webmail for all domains to the webmail of my central domain for which I had installed an SSL certificate (and also my hosting logo!). So this way everyone would only use an https site to login to their emails. I could not find an option to do this in Onyx panel but I found the “proper” way to do it so that my configs would never be overwritten!

What you have to do is create a custom template, copy the webmail template and change it according to your needs.

Disclaimer: Everything I say is valid for CentOS server and I can not be sure if all is true for other distributions!

Before setting up the redirect you have to setup SSL for a webmail!
Go to your domains list in plesk panel and select the domain that you will use for webmail.
Choose “SSL/TLS certificates”, select an avaiable certificate (or upload a new one) and press “Secure Webmail”

Now create the custom webmail template folder (if it does not already exist)

cd /usr/local/psa/admin/conf/templates/
mkdir -p custom/webmail

Copy the default webmail config file

cd custom/webmail
cp -a ../../default/webmail/webmail.php

Edit this file to add your redirect (I added below lines immediately after “UseCanonicalName Off”)

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/ [NC]
RewriteRule (.*) https://webmail.EXAMPLE.COM/

You can have each domain redirect to each own https site by using this rewrite rule instead of specific domain (last line above)

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

After saving this file you have to apply it for all your domains by using this command

/usr/local/psa/admin/sbin/httpdmng --reconfigure-all

Ready! Enjoy your https protected webmail!

Sources:
https://kb.plesk.com/en/129260
https://kb.plesk.com/en/123648

WSO2 for PHP installation on Centos 6

WSO2 for PHP is a Web Services framework that works as a PHP extension and provides support for key WS-* specifications. Using this framework one can easily create server and client side Web Service applications that can easily integrate with Java or .NET systems (which are both the most common languages used for building Web Services).

Installation of this framework on most linux systems used to be easier on earlier versions of WSO2 when rpm and deb packages were available for download. This is not the case anymore.

Continue reading “WSO2 for PHP installation on Centos 6”

Streaming to shoutcast with libshout

After setting up a shoutcast server I tried to find a way to stream my music through it. When I was a windows user winamp with the shoutcast DSP plugin was a nice solution. But now I wanted to stream music that resides on my linux home server. The Shoutcast Transcoder that can be used for this purpose requires a paid license for mp3 streaming. So libshout from Icecast with a perl binding comes to rescue!

Continue reading “Streaming to shoutcast with libshout”