Jetserver – The Lazy Admin Blog
Home  /  cPanel  /  MSSQL SUPPORT FOR CPANEL SERVER (freetds / odbc)

MSSQL SUPPORT FOR CPANEL SERVER (freetds / odbc)

elialum April 28, 2016 Leave a Comment

This post will help you in configuring your cPanel server to support remote MS-SQL servers.

First step – Install freetdns / odbc

yum install  unixODBC unixODBC-devel
cd /usr/local/src
wget http://ibiblio.org/pub/Linux/ALPHA/freetds/stable/freetds-stable.tgz
tar zfvx freetds-stable.tgz
cd freetds-*
./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --enable-msdblib --enable-dbmfix --with-gnu-ld
make
make install
touch /usr/local/freetds/lib/libtds.a
touch /usr/local/freetds/include/tds.h
ln -s /usr/local/freetds/lib/  /usr/local/freetds/lib64

Next, edit the file: /var/cpanel/easy/apache/rawopts/all_php5

Add the following code –

--with-mssql=/usr/local/freetds
--with-unixODBC=/usr

Now we will need to re-build EasyApache, so it will implement the changes –

/scripts/easyapache

You can verify it is now supported using php –

php --info |grep  "mssql"
php -i | grep odbc

Edit the file “/usr/local/lib/php.ini” , and make sure odbc.so is listed like this:

extension=odbc.so

and not

extension = odbc.so

Restart your httpd service – /scripts/restartsrv_httpd

The remote MSSQL server you would like to connect to, should be listed in the “/usr/local/freetds/etc/freetds.conf” file, and whiltelisted in your cPanel server firewall.

Here is an example for the freetds.conf file –

[192.168.1.110]
        host = 192.168.1.110
        port = 1433
        tds version = 7.0
 
[192.168.1.111]
        host = 192.168.1.111
        port = 1433
        tds version = 7.0

(You can try tds version 8 if that doesn’t work)

Tags: cPanel, freetds, mssql, odbc
Previous Article
Next Article

About Author

elialum

Related Posts

  • cPanel :: Safely restore an account after enabling NGiNX

    cPanel :: Safely restore an account after enabling NGiNX

    May 23, 2019
  • Jetbackup :: Better safe then sorry

    Jetbackup :: Better safe then sorry

    January 20, 2019
  • cPanel – Preventing users from downloading / restoring accounts

    cPanel – Preventing users from downloading / restoring accounts

    September 16, 2018

Leave a Reply

Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Search Our Blog

Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages
Filter by Categories
Apache
CentOS
CloudLinux
cPanel
ESXI
iSCSI
JetBackup
Litespeed
MySQL
NGINX
Reduxio
SSL
Uncategorized
VMware
Wordpress
XEN

Tags

apache aspx backup CentOS cloudlinux cPanel CXS freetds google htaccess iscsi JetBackup Libmodsecurity litespeed modsec modsecurity mssql MySQL netapp nginx odbc php php.ini phpselector VMFS WHM xenserver

Popular Posts

  • How To Install & Configure a Galera Cluster with MySQL on Centos 7 February 6, 2018
  • Allow a cPanel server to run a VHOST from multiple IP addresses April 3, 2018
  • Libmodsecurity installation April 14, 2016
  • JetBackup Cheat Sheet :: Automatically Acknowledge Alerts November 15, 2018

Recent Posts

  • Dealing with aggressive bot scanners September 14, 2020
  • Litespeed Geo Location Redirect September 14, 2020
  • JetBackup :: Restore on steroids ! August 21, 2020
  • XENSERVER :: CONNECTING ISCSI SR NETAPP STORAGE September 4, 2019

Recent Comments

  • Khan on Allow a cPanel server to run a VHOST from multiple IP addresses
  • Khan on Allow a cPanel server to run a VHOST from multiple IP addresses
  • Oleg Drabkin on Allow a cPanel server to run a VHOST from multiple IP addresses
  • Khan on Allow a cPanel server to run a VHOST from multiple IP addresses
  • Daniel on How To Install & Configure a Galera Cluster with MySQL on Centos 7
אחסון אתרים | JetApps