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

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

    Enable TLS 1.1/1.0 on cPanel servers

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

    cPanel :: Safely restore an account after enabling NGiNX

    May 23, 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 October 6, 2022
  • How To Install & Configure a Galera Cluster with MariaDB on Centos 7 February 6, 2018
  • Allow a cPanel server to run a VHOST from multiple IP addresses April 3, 2018
  • rsync without prompting for password October 10, 2022

Recent Posts

  • Understanding Why More Threads Can Sometimes Slow Down Performance October 9, 2024
  • Set up a new systemd service May 18, 2024
  • Bash Arrays November 7, 2023
  • rsync without prompting for password October 10, 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