The Lazy Admin Blog

Home  /  cPanel  /  MSSQL SUPPORT FOR CPANEL SERVER (freetds / odbc)

MSSQL SUPPORT FOR CPANEL SERVER (freetds / odbc)

April 28, 2016 cPanel 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

Related Posts

  • Convert JetBackup to cPanel structure

    Convert JetBackup to cPanel structure

    6th October 2022
  • Enable TLS 1.1/1.0 on cPanel servers

    Enable TLS 1.1/1.0 on cPanel servers

    30th September 2022
  • cPanel :: Safely restore an account after enabling NGiNX

    cPanel :: Safely restore an account after enabling NGiNX

    23rd May 2019

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
Post Type Selectors
Filter by Categories
Apache
CentOS
CloudLinux
cPanel
Emails
ESXI
iSCSI
JetBackup
Linux
Litespeed
MySQL
NGINX
Oracle
Reduxio
Security
SSL
Uncategorized
VMware
Wordpress
XEN

Tags

apache aspx backup bash CentOS cloudlinux cPanel CXS Emails freetds google htaccess IMAP InnoDB iscsi JetBackup Libmodsecurity litespeed modsec modsecurity mssql MySQL netapp nginx odbc Oracle php php.ini phpselector rsync ssh ssmtp systemd threads VMFS WHM Wordpress xenserver

Popular Posts

  • Convert JetBackup to cPanel structure 6th October 2022
  • How To Install & Configure a Galera Cluster with MariaDB on Centos 7 6th February 2018
  • Allow a cPanel server to run a VHOST from multiple IP addresses 3rd April 2018
  • rsync without prompting for password 10th October 2022

Recent Posts

  • Understanding Why More Threads Can Sometimes Slow Down Performance 9th October 2024
  • Set up a new systemd service 18th May 2024
  • Bash Arrays 7th November 2023
  • rsync without prompting for password 10th October 2022

Recent Comments

  • Sven on rsync without prompting for password
  • TheLazyAdmin on rsync without prompting for password
  • Sven on rsync without prompting for password
  • TheLazyAdmin on Convert JetBackup to cPanel structure
  • Chris on Convert JetBackup to cPanel structure
Privacy Policy • Contact