워드프레스 Unable to connect to the Disqus API servers 워드프레스에 댓글에 Disqus를 연동하려고 Disqus Comment System 플러그인을 설치하였는데. 플러그인 활성화후 아무리 로그인을 해도 자꾸만 Unable to connect to the Disqus API servers 라고 메세지가 나온다. 열뻗친다.! 검색해보니 사용하는 호스팅에서 disqus.com 이나 disqus.net 연결 80 포트를 호스팅에서 차단해서 일것이라고 한다. 이럴경우 플러그인 설치말고 직접 코드를 붙이는 작업을 하면 된다고 […]
openssl 업그레이드
openssl 업그레이드 CENTOS 5.11 에 openssl RPM은 0.9.8버전까지 밖에 없다. 그래서 소스설치로 업그레이드 하였다. wget https://www.openssl.org/source/openssl-1.0.2h.tar.gz $ tar -zxf openssl-1.0.1g.tar.gz $ cd openssl-1.0.1g $ ./config $ make $ make test $ make install $ openssl version 이렇게 버전확인 했는데 command not found 면 기존 RPM버전과 충돌로 인한것이다. 아래처럼 실행하자 $ mv /usr/bin/openssl /root/ $ […]
cURL 업그레이드 하기
curl -V 로 버전확인 curl -V curl 7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Protocols: tftp ftp telnet dict ldap http file https ftps Features: GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz curl 업그레이드 몇비트 시스템인지 확인 getconf LONG_BIT 다운로드 https://curl.haxx.se/download.html 여기에서 Redhat RHEL5 i386 RPM 클릭해서 들어가면 다양한데 i386중에서 rhel5가 cetos5라고 생각하면 된다. wget […]
array_search를 활용한 접근ip 설정
배열에 있는 IP가 아닌경우 차단하기. $ip_allow_arr = array("1.234.56.78", "100.1.2.4", "200.22.33.55"); $key = array_search($_SERVER['REMOTE_ADDR'], $ip_allow_arr); if(!$key){ exit; } array_search 와 배열을 이용해 간단하게 접근가능한 IP를 설정하는 방법
워드프레스 에서 어드민 로그인 하려고 할때 에러 You don’t have permission to access
워드프레스 wp-admin 로그인시 에러 문제 You don’t have permission to access /wp-login.php on this server. 갑자기 이런 에러가 나와서 아파치 나 권한 문제라고 생각했다. 아파치의 error_log를 확인해보니 mod_security에서 발생하는 문제였다. [Fri May 20 12:14:52 2011] [error] [client 121.000.xxx.123] ModSecurity: Access denied with code 403 (phase 2). Pattern match “=(http|https|ftp)\\\\:/” at REQUEST_URI. [file “/usr/local/apache2/conf/modsecurity_krcert.conf”] [line “72”] […]
tinydns (djbdns) 설정 샘플 예제
tinydns (djbdns) 설정 샘플 예제 설정 샘플 #define the authoritative nameserver .example.com::ns1.example.com #mail exchanger @example.com::mail.example.com #IP for machine1,2,3,4,5 =machine1.example.com:1.2.3.1 =machine2.example.com:1.2.3.2 =machine3.example.com:1.2.3.3 =machine4.example.com:1.2.3.4 =machine5.example.com:1.2.3.5 #machine5 is also known as ns1 +ns1.example.com:1.2.3.5 #machine1 is our mailserver +mail.example.com:1.2.3.1 #and our webserver +www.example.com:1.2.3.1 설정 참고 . SOA, NS, A & NS, A @ MX, A = PTR, A […]
what is mysql-bin.000 files
what is mysql-bin.000 files mysql data 폴더에 쌓여있는 것들 꽤 많은 용량을 차지하고 있다. 이것들은 MySQL 만들어내는 바이너리 로그이고 계속 자동으로 rotate 된다. 파일을 줄이려면 my.cnf에 설정하자. [mysqld] expire-logs-days=3 그리고 접속해서 mysql> SET GLOBAL expire_logs_days = 3; 그리고 MySQL restart 참고: http://dba.stackexchange.com/questions/41050/is-it-safe-to-delete-mysql-bin-files http://www.cyberciti.biz/faq/what-is-mysql-binary-log/
워드프레스 도메인 변경방법
워드프레스 도메인 변경시 해야하는 것들 wp-config.php // define('WP_HOME','http://example.com'); define('WP_SITEURL','http://example.com'); // 테마의 function.php 에 // update_option( 'siteurl', 'http://example.com' ); update_option( 'home', 'http://example.com' ); // 게시글 Post 들의 이미지 경로 변경을 위해 SQL 쿼리 실행 UPDATE wp_options SET option_value = replace(option_value, 'oldurl', 'newurl') WHERE option_name = 'home' OR option_name = 'siteurl'; UPDATE wp_posts SET guid = replace(guid, […]
How to error while loading shared libraries: libmysqlclient.so 해결방법
MySQL을 업그레이드 하고 PHP를 문제가 있어 재설치시 make 하는데 아래와 같은 에러가 나옴. /usr/local/INSTALL_PACKAGE/php-5.5.35/sapi/cli/php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory 원인은 아마도 MySQL 업그레이드 이후 생기는 문제 같은데 lib 파일의 위치 때문인 것으로 추정된다. 해결방법 중 하나 vim /etc/ld.so.conf 열어보니 include ld.so.conf.d/*.conf /lib /usr/lib /usr/local/lib […]
PHP5.5 에서 date.timezone 에러 문제
서버의 PHP버전을 5.3에서 5.5로 업그레이드 하였다. 그리고 났더니 이런 에러가 나온다. It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function php.ini 파일에 아래처럼 설정을 했지만 에러는 계속나온다. [Date] ; Defines the default timezone used by the date functions ;date.timezone = date.timezone = […]
PHP mcrypt 설치방법. DSO방식
리눅스 서버에서 PHP mcrypt 모듈 설치방법. 기존에 설치한 PHP 소스파일이 있다면 바로 진행하고, 없으면 php.net에서 같은 버전으로 다운로드를 받는다. // cd /php-5.3.8 cd ext/mcrypt /usr/local/php/bin/phpize ./configure –with-php-config=/usr/local/php/bin/php-config make make install // 설치완료되면 Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/ 이곳에 파일이 생성되었다고 나온다. 그러면 php extension 폴더 위치로 복사해줘야 한다. (위치 모르면 php.ini 에서 extension_dir 로 검색) // […]
PHP 문자열 변경하기 str_replace
PHP 문자열 변경하기 특정 문자를 원하는 문자로 변경 // $str = "Tom likes the cat"; echo str_replace('cat', 'dog', $str); //