DB/NoSQL/Mssql2014. 5. 21. 18:53

 

MS사이트 : http://www.microsoft.com/en-us/download/details.aspx?id=28160


1) 파일다운로드 ( centos6 64bit의 경우 Linux6을 선택 다운로드 안될때 MS사이트 URL확인 )

$ wget http://download.microsoft.com/download/6/A/B/6AB27E13-46AE-4CE9-AFFD-406367CADC1D/Linux6/sqlncli-11.0.1790.0.tar.gz

 

2) 압축풀고 build_dm실행

$ tar xvfz sqlncli-11.0.1790.0.tar.gz
$ cd sqlncli-11.0.1790.0

$ ./build_dm.sh //실행후 나오는 디렉토리 기준으로 make 실행
Enter 'YES' to have this script continue: YES
Verifying processor and operating system ................................... OK
Verifying wget is installed ................................................ OK
Verifying tar is installed ................................................. OK
Verifying make is installed ................................................ OK
Downloading unixODBC 2.3.0 DriverManager ................................... OK
Unpacking unixODBC 2.3.0 DriverManager ..................................... OK
Configuring unixODBC 2.3.0 DriverManager ................................... OK
Building unixODBC 2.3.0 DriverManager
...................................... OK
Build of the unixODBC 2.3.0 DriverManager complete.
Run the command 'cd /tmp/unixODBC.32631.28583.22057/unixODBC-2.3.0; make install' to install the driver manager.
PLEASE NOTE THAT THIS WILL POTENTIALLY INSTALL THE NEW DRIVER MANAGER OVER ANY
EXISTING UNIXODBC DRIVER MANAGER.  IF YOU HAVE ANOTHER COPY OF UNIXODBC INSTALLED,
THIS MAY POTENTIALLY OVERWRITE THAT COPY.

 

3) 위에 tmp 경로에서 make install 실행

$ cd /tmp/unixODBC.32631.28583.22057/unixODBC-2.3.0
$ make install

touch /etc/odbcinst.ini
touch /etc/odbc.ini
mkdir -p /etc/ODBCDataSources
/usr/bin/odbc_config --header > /usr/include/unixodbc_conf.h
make[2]: Leaving directory `/tmp/unixODBC.32631.28583.22057/unixODBC-2.3.0'
make[1]: Leaving directory `/tmp/unixODBC.32631.28583.22057/unixODBC-2.3.0'

 

4) install 실행
$ cd /root/sqlncli-11.0.1790.0
$ ./install.sh verify

Microsoft SQL Server ODBC Driver V1.0 for Linux Installation Script
Copyright Microsoft Corp.
Starting install for Microsoft SQL Server ODBC Driver V1.0 for Linux
Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ........................................ OK
unixODBC utilities (odbc_config and odbcinst) installed ..................... OK
unixODBC Driver Manager version 2.3.0 installed ............................. OK
unixODBC Driver Manager configuration correct .............................. OK*
Microsoft SQL Server ODBC Driver V1.0 for Linux already installed .... NOT FOUND
Install log created at /tmp/sqlncli.18759.30552.14202/install.log.
One or more steps may have an *. See README for more information regarding
these steps.

$ ./install.sh install
Enter YES to accept the license or anything else to terminate the installation: YES
Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ........................................ OK
unixODBC utilities (odbc_config and odbcinst) installed ..................... OK
unixODBC Driver Manager version 2.3.0 installed ............................. OK
unixODBC Driver Manager configuration correct .............................. OK*
Microsoft SQL Server ODBC Driver V1.0 for Linux already installed .... NOT FOUND
Microsoft SQL Server ODBC Driver V1.0 for Linux files copied ................ OK
Symbolic links for bcp and sqlcmd created ................................... OK
Microsoft SQL Server ODBC Driver V1.0 for Linux registered ........... INSTALLED
Install log created at /tmp/sqlncli.27629.13209.11572/install.log.
One or more steps may have an *. See README for more information regarding
these steps.

$ vi /etc/odbcinst.ini //odbc추가확인
[SQL Server Native Client 11.0]
Description=Microsoft SQL Server ODBC Driver V1.0 for Linux
Driver=/opt/microsoft/sqlncli/lib64/libsqlncli-11.0.so.1790.0
Threading=1
UsageCount=1

 

5) 최종 설치 결과확인

$ ./install.sh verify

Microsoft SQL Server ODBC Driver V1.0 for Linux Installation Script
Copyright Microsoft Corp.

Starting install for Microsoft SQL Server ODBC Driver V1.0 for Linux

Checking for 64 bit Linux compatible OS ..................................... OK
Checking required libs are installed ........................................ OK
unixODBC utilities (odbc_config and odbcinst) installed ..................... OK
unixODBC Driver Manager version 2.3.0 installed ............................. OK
unixODBC Driver Manager configuration correct .............................. OK*
Microsoft SQL Server ODBC Driver V1.0 for Linux already installed .... INSTALLED

 

6) isql 이용한 접속테스트

$ vi /etc/odbc.ini

-------------------------

[MSSQLTEST]
driver=SQL Server Native Client 11.0
server=192.168.0.0
port=1433
database=DBNAME

-------------------------

$ isql -v MSSQLTEST userid userpassword

+---------------------------------------+
| Connected!                           
|                                       
| sql-statement                         
| help [tablename]                      
| quit                                  
|                                       
+---------------------------------------+

 

※ PHP에는 PDO ODBC에는 odbcinst.ini에 등록된 이름으로 odbc.ini처럼 지정해주면됨
 => odbc:DRIVER=SQL Server Native Client 11.0;Server=192.168.0.0;
port=1433;database=dbname;

 

※ C컴파일에러시 gcc설치할것!!
view /tmp/unixODBC.19411.11370.8462/build_dm.log
yum install gcc


※ ODBC 정보확인은 아래와 같이

$ odbcinst -j

unixODBC 2.2.14

DRIVERS............: /etc/odbcinst.ini

SYSTEM DATA SOURCES: /etc/odbc.ini

FILE DATA SOURCES..: /etc/ODBCDataSources

USER DATA SOURCES..: /root/.odbc.ini

SQLULEN Size.......: 8

SQLLEN Size........: 8

SQLSETPOSIROW Size.: 8

 

Posted by 시니^^
Programming/PHP2014. 5. 21. 17:33

PHP Yum 설치  http://webtatic.com/

 

버젼별 설치 방법

http://webtatic.com/packages/php53/

http://webtatic.com/packages/php54/

http://webtatic.com/packages/php55/

http://webtatic.com/packages/php56/

 

1)  저장소 등록( PHP5.5기준 / Centos6 )

$ rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm

$ ll /etc/yum.repos.d

-rw-r--r--  1 root root  888 Jul  8  2013 webtatic-archive.repo
-rw-r--r--  1 root root  790 Jul  8  2013 webtatic.repo
-rw-r--r--  1 root root  888 Jul  8  2013 webtatic-testing.repo

2) php패키지 확인

$ yum search php55w

3) PHP 설치

$ yum install php55w php55w-fpm php55w-mysqlnd php55w-odbc php55w-opcache php55w-pdo php55w-mcrypt php55w-mbstring

$ php -v
PHP 5.5.12 (cli) (built: May  1 2014 20:34:46)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

 

4) 웹서버에 PHP 적용

Apache : httpd.conf 에 PHP Module 추가

Nginx : php-fpm (/etc/init.d/php-fpm start) 실행 후  conf.d의 conf파일에 FastCGI server listening 설정

 

 

PHP 소스설치

1) 파일 다운로드

    http://www.php.net/downloads.php

2) php net에 웹서버별 메뉴얼 참조

    http://www.php.net/manual/en/install.unix.php

 

3) 필요한 라이브러리 경우 각 라이브러리 메뉴얼 참조해서 컴파일 옵션에 추가

예시) pdo  odbc의 경우 http://us.php.net/manual/en/ref.pdo-odbc.php 

./configure --with-pdo-odbc=unixODBC,/usr/local
위와 같이 unixODBC librarie 경로 지정 해줘야됨 yum으로 보통 /usr/lib or /usr/lib64이므로 아래와 같이하면됨
./configure --with-pdo-odbc=unixODBC,/usr

기타 기본 탑재 라이브러리는 --enable-mbstring --enable-fpm 형태로 적용하면됨

 

 

Posted by 시니^^
SERVER/Nginx2014. 5. 21. 15:01

http://wiki.nginx.org/Install


Nginx yum install( CentOS6 )


1) nginx 에서 제공해주는 저장소 등록

$ rpm -Uvh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

Retrieving http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

warning: /var/tmp/rpm-tmp.U4wAT5: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY

Preparing...                ########################################### [100%]

   1:nginx-release-centos   ########################################### [100%]

$ ll /etc/yum.repos.d/

-rw-r--r--  1 root root  113 Oct 14  2011 nginx.repo

$ yum repolist

nginx                                                              nginx repo                                                                        56

===================================================================================================

CentOS 5.x :

wget http://nginx.org/packages/centos/5/noarch/RPMS/nginx-release-centos-5-0.el5.ngx.noarch.rpm

rpm -Uvh nginx-release-centos-5-0.el5.ngx.noarch.rpm

CentOS 6.x :

wget http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm

rpm -Uvh nginx-release-centos-6-0.el6.ngx.noarch.rpm

===================================================================================================


2) yum install

$ yum install nginx

=================================================================================================================

 Package                           Arch                             Version                                     Repository                         Size

=================================================================================================================

Installing:

 nginx                             x86_64                           1.6.0-1.el6.ngx                             nginx                             335 k


3) conf 설정파일

$ vi /etc/nginx/nginx.conf

$ vi /etc/nginx/conf.d/default.conf


4) Nginx 실행 및 명령어

$ /etc/init.d/nginx 

Usage: nginx {start|stop|restart|condrestart|try-restart|force-reload|upgrade|reload|status|help|configtest}

$ /etc/init.d/nginx start

Starting nginx: [  OK  ]

$ ps aux | grep nginx

root     30106  0.0  0.0  45040  1124 ?        Ss   14:52   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf

nginx    30107  0.0  0.0  45412  1732 ?        S    14:52   0:00 nginx: worker process  


 

 

 

※ 소스설치

소스파일 다운로드 : http://nginx.org/en/download.html 

컴파일 옵션 참조 : http://wiki.nginx.org/InstallOptions





Posted by 시니^^
SERVER/Etc2014. 5. 21. 11:22

미디어 위키 갤러리페이지 보니까 너무 느려서 답답하고 브라우져가 뻗음......


확인결과 썸네일 기능이 전혀 사용하지 않아서 원본이미지가......ㄷㄷㄷ


그래서 찾아보니 썸네일 기능을 제공하는 듯하다


http://www.mediawiki.org/wiki/Manual:Installing_third-party_tools

Image thumbnailing

Image thumbnailing requires either ImageMagick or GD library. ImageMagick is recommended since it produces better quality thumbnails. It can be downloaded from http://www.imagemagick.org. GD can be downloaded fromhttp://boutell.com/gd.

ImageMagick

MediaWiki can be configured to use ImageMagick to do dynamic resizing and thumbnailing of images. ImageMagick is available for Windows, Unix, Mac OS, and Linux from http://www.imagemagick.org/script/index.php. Once ImageMagick is installed, you must enable ImageMagick and point MediaWiki to the convert or convert.exe program on your computer in LocalSettings.php like this:

$wgUseImageMagick = true;
#$wgImageMagickConvertCommand = 'C:/ImageMagick/convert.exe'; # for windows
$wgImageMagickConvertCommand = '/usr/bin/convert'; # for linux

For information on configuring MediaWiki for images in general see Manual:Image Administration and Manual:Configuration settings#Images. For information on installing ImageMagick on Windows, see Manual:Newcomers guide to installing on Windows#ImageMagick.


보니까  ImageMagick 깔려있어야되는 듯함


※ 설치과정

1) ImageMagick 설치

yum install ImageMagick

========================================================================================================= Package                      Arch                  Version                               Repository              Size

=========================================================================================================

Installing:

 ImageMagick                  x86_64                6.5.4.7-7.el6_5                       updates                1.7 M

=========================================================================================================


2) 홈디렉토리에 LocalSettings.php 설정파일에서 썸네일 기능 활성화 주석제거

$wgUseImageMagick = true; 
$wgImageMagickConvertCommand = "/usr/bin/convert";

//리눅스 프로세스 리스트 보니까....썸네일 자체가 백엔드에서 Shell 로 돌는듯하다.

//window서버의 경우 위에 for windows 참조


3) 썸네일 불가 에러 발생 이미지 용량 너무큼.. thumbnail Shell 처리시 사이즈가 설정 메모리 용량 초과

$wgMaxShellMemory라는 게 있다!! 아래 링크참조

http://www.mediawiki.org/wiki/Manual:$wgMaxShellMemory


그래서 LocalSettings.php 에 아래 MaxShellMemory 변수값 추가함

$wgMaxShellMemory = 1024000;

//Note: 102400 KB = 100 MB, 307200 KB = 300 MB, etc.

//나 같은 경우 MaxUploadSize 와 동일하게 맞추어주었다

//회사 내부적이나 공개용이 아닌 일부 소수 사용자간에 사용되는 위키라면 넉넉하게 설정해 놓는 게 좋을듯함


Posted by 시니^^