Categories
Uncategorized

How to disable IPv6 for Exim4 that comes with Vesta Panel

I had a server which has both IPv4 and IPv6 and they were working perfectly fine. I had installed Vesta CP which is an amazing control panel application and it was working just great. But there was only one problem with Exim4. It was not sending emails properly to Gmail. Mails sent to gmail were bounced. I checked the log and the message was

message does not meet IPv6 sending guidelines regarding PTR records

Ok, that is pretty straight forward. The server’s IPv6 didn’t have a reverse DNS or PTR. To fix this problem I had to set it up. But then I was thinking how to tell Exim not touse IPv6 but IPv4. The problem begins

Exim in this server came with Vesta Panel, and in most forums people suggested to add a new entry as disable_ipv6=true in the /etc/exim4/update-exim4.conf.con file. I’ve added that and restarted exmi4, but there were no changes. Netstat shows that exim is still listening on port 25 against the IPv6 address.

[code lang=shell]
netstat -tulpn | grep :25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 7013/exim4
tcp 0 0 0.0.0.0:2525 0.0.0.0:* LISTEN 7013/exim4
tcp6 0 0 :::25 :::* LISTEN 7013/exim4
tcp6 0 0 :::2525 :::* LISTEN 7013/exim4
[/code]

Some people in different forum suggested that dc_local_interfaces should be set to 127.0.0.1 but it still didn’t make any change in exim.

Finally, finally, I noticed that there is a configuration template file /etc/exim4/exim4.conf.template. Curiously, I’ve added disable_ipv6=true directive over there, restarted exim and voila! It started working 🙂

[code lang=shell]
netstat -tulpn | grep :25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN 8110/exim4
tcp 0 0 0.0.0.0:2525 0.0.0.0:* LISTEN 8110/exim4
[/code]

I hope you will find this article useful, and save some time when you run into similar problem with exim and vesta panel.

Categories
centos PHP

Upgrading PHP to 5.5 in a CentOS 6 server with Vesta CP

Vesta CP comes with PHP 5.4 by default. If you want to upgrade it to 5.5, follow these steps

1. Stop Apache and Remove current PHP
[sourcecode language=”shell”]
service httpd stop
yum -y remove php
[/sourcecode]

2. Add remi repository
[sourcecode language=”shell”]
#For 32 Bit OS
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

#For 64Bit OS
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
[/sourcecode]

3. Enable Remi Repository
open /etc/yum.repos.d/remi.repo and add 1 beside enabled for both [remi] and [remi-php55], as shown in the screenshot
Screen Shot 2014-06-03 at 8.44.47 PM

4. Install PHP 5.5
[sourcecode language=”shell”]
yum -y install php php-bcmath php-cli php-common php-gd php-imap php-mbstring php-mcrypt php-mysql php-pdo php-soap php-tidy php-xml php-xmlrpc php-pecl-apc phpMyAdmin roundcubemail php-opcache php-xdebug
[/sourcecode]

Step 5: Cleanup, linking and finishing
[sourcecode language=”shell”]
mv -f /etc/php.ini.rpmsave /etc/php.ini
mv -f /etc/roundcubemail/db.inc.php.rpmsave /etc/roundcubemail/db.inc.php
mv -f /etc/roundcubemail/main.inc.php.rpmsave /etc/roundcubemail/main.inc.php
mv -f /etc/phpMyAdmin/config.inc.php.rpmsave /etc/phpMyAdmin/config.inc.php
mv -f /etc/httpd/conf.d/roundcubemail.conf.rpmsave /etc/httpd/conf.d/roundcubemail.conf
mv -f /etc/httpd/conf.d/phpMyAdmin.conf.rpmsave /etc/httpd/conf.d/phpMyAdmin.conf
service httpd start
[/sourcecode]

And you’re done 🙂 Enjoy!