nginx compile option

리눅스/어플리케이션 2013. 7. 27. 19:13 Posted by Relipmoc

./configure \

--prefix=/opt/nginx \

--sbin-path=/opt/nginx/sbin/nginx \

--conf-path=/opt/nginx/conf/nginx.conf \

--error-log-path=/opt/nginx/logs/error.log \

--pid-path=/var/run/nginx.pid \

--lock-path=/var/lock/subsys/nginx \

--user=nobody \

--group=nobody \

--http-log-path=/opt/nginx/logs/access.log \

--http-client-body-temp-path=/opt/nginx/client_body_temp \

--http-proxy-temp-path=/opt/nginx/proxy_temp \

--http-fastcgi-temp-path=/opt/nginx/fastcgi_temp \

--http-uwsgi-temp-path=/opt/nginx/uwsgi_temp \

--with-pcre \

--with-debug \

--with-http_ssl_module \

--with-http_realip_module \

--with-http_stub_status_module \

--with-http_flv_module \

--with-http_ssl_module \

--with-http_dav_module

댓글을 달아 주세요

  1. http://www.dort.jp/bk02.html 2013.10.17 03:52  댓글주소  수정/삭제  댓글쓰기

    마던Humans are creatures of habit. We’re predisposed to find routines, create schedules and return to behaviors over and over again. Even fashion, which encourages newness and exploration, becomes somewhat rote over time. Most fashion people find a uniform for themselves as they spend more and more time thinking about style and what makes them feel like themselves,birkenstock australia, and at least f적는

  2. YONGNAM 2015.09.17 14:12 신고  댓글주소  수정/삭제  댓글쓰기

    요새 누가 이런거 컴팔해서 쓰냐. rpm 걍 깔아서 쓰는게 백배는 편하지.

PostgreSQL chkconfig script

리눅스/어플리케이션 2013. 7. 27. 19:03 Posted by Relipmoc

댓글을 달아 주세요

  1. YONGNAM 2014.10.31 17:19 신고  댓글주소  수정/삭제  댓글쓰기

    개새끼가 내꺼 퍼갔네

  2. Relipmoc 2015.01.22 17:17 신고  댓글주소  수정/삭제  댓글쓰기

    블로그 터트렸잖아ㅡㅡ

CentOS 6에서의 "Development Libraries"

리눅스 2012. 7. 6. 01:27 Posted by Relipmoc

CentOS 6으로 넘어오면서 CentOS 5에서 "Development Libraries"라는 이름을 쓰던 group이 "Additional Development"로 바뀌었다.


yum groupinstall "Additional Development"


댓글을 달아 주세요

CentOS 버전별 epel rpm url

리눅스 2012. 3. 1. 21:20 Posted by Relipmoc

5: rpm -Uvh  http://ftp.sayclub.com/fedora-epel/5/i386/epel-release-5-4.noarch.rpm 
6: rpm -Uvh  http://ftp.sayclub.com/fedora-epel/6/i386/epel-release-6-8.noarch.rpm


댓글을 달아 주세요

  1. 쑥쑦쑦쑦차 2012.04.07 20:55  댓글주소  수정/삭제  댓글쓰기

    헤헷. 감사합니다.

./load envdir unix.a byte.a
/usr/bin/ld: errno: TLS definition in /lib64/libc.so.6 section .tbss mismatches non-TLS reference in envdir.o
/lib64/libc.so.6: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [envdir] Error 1

http://blog.nirkabel.org/2009/01/18/errnoh-problem/ 포스트를 참고했다.

src/conf-cc 파일을 다음과 같이 수정.



gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings



gcc -O2 -Wimplicit -Wunused -Wcomment -Wchar-subscripts -Wuninitialized -Wshadow -Wcast-qual -Wcast-align -Wwrite-strings -include /usr/include/errno.h

이래도 안 될 경우, -include 뒤의 변수를 errno.h path로 바꿔주면 된다

댓글을 달아 주세요

  1. ghd 2013.07.27 12:16  댓글주소  수정/삭제  댓글쓰기

    슬퍼서 우는거 아니야..바람이 불어서 그래..눈이 셔서..

Bind 9.8.1-P1에서 pgsql 이나 mysql 드라이버와 함께 컴파일할 때
dlz_mysql_driver.o: In function `mysql_get_resultset':
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:279: 
undefined reference to `sdlzh_build_querystring'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:282: 
undefined reference to `sdlzh_build_querystring'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:285: 
undefined reference to `sdlzh_build_querystring'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:288: 
undefined reference to `sdlzh_build_querystring'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:291: 
undefined reference to `sdlzh_build_querystring'
dlz_mysql_driver.o:/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:294: 
more undefined references to `sdlzh_build_querystring' follow
dlz_mysql_driver.o: In function `mysql_create':
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:823: 
undefined reference to `sdlzh_get_parameter_value'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:833: 
undefined reference to `sdlzh_get_parameter_value'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:857: 
undefined reference to `sdlzh_build_sqldbinstance'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:902: 
undefined reference to `sdlzh_get_parameter_value'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:909: 
undefined reference to `sdlzh_get_parameter_value'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:916: 
undefined reference to `sdlzh_get_parameter_value'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:924: 
undefined reference to `sdlzh_get_parameter_value'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:925: 
undefined reference to `sdlzh_get_parameter_value'
dlz_mysql_driver.o:/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:926: 
more undefined references to `sdlzh_get_parameter_value' follow
dlz_mysql_driver.o: In function `mysql_create':
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:963: 
undefined reference to `sdlzh_destroy_sqldbinstance'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:861: 
undefined reference to `sdlzh_build_sqldbinstance'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:865: 
undefined reference to `sdlzh_build_sqldbinstance'
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:870: 
undefined reference to `sdlzh_build_sqldbinstance'
dlz_mysql_driver.o: In function `mysql_destroy':
/root/bind-9.8.1/bin/named/../../contrib/dlz/drivers/dlz_mysql_driver.c:1003: 
undefined reference to `sdlzh_destroy_sqldbinstance'
collect2: ld returned 1 exit status
make[2]: *** [named] Error 1
make[2]: Leaving directory `/root/bind-9.8.1/bin/named'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/root/bind-9.8.1/bin'
make: *** [subdirs] Error 1

이런 에러가 뜨면

diff -u -r1.3 sdlz_helper.c
--- contrib/dlz/drivers/sdlz_helper.c	14 May 2010 06:29:37 -0000	1.3
+++ contrib/dlz/drivers/sdlz_helper.c	5 Sep 2011 17:31:30 -0000
@@ -50,8 +50,6 @@
  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-#ifdef DLZ
-
 #include <config.h>
 
 #include <dns/log.h>
@@ -527,5 +525,3 @@
 
 	return isc_mem_strdup(mctx, value);
 }
-
-#endif

이 패치를 적용해 주면 된다

9.8.2 때 패치가 적용되서 나온다는 듯..

댓글을 달아 주세요

[Apache] mod_watch backup

리눅스/어플리케이션 2011. 8. 20. 06:12 Posted by Relipmoc

Apache Mod_Watch & Munin Graphs showing vhost accesses

While this is more of an apache topic than a munin one, the main reason I wanted to compile the mod_watch module for apache is so I can graph vhost usage and access. Munin will then show graphs of how much a vhost is used. Also, while there are other how-to websites out there for this, they seem to drop off and disappear after a few years.

mod_watch itself is not supported and is actually quite difficult to get a hold of. I was using this on Debian Etch and Lenny on a x32 system. Copying the mod_watch.so and running on x64 failed so I needed to recomiple on a x64 debian squeeze.

The main reference I used was: http://stubbedtoe.co.nz/index.php/2009/09/apache-vhost-monitoring-with-munin/ This worked perfectly. There was an issue with debian squeeze which will be sorted below.

Compile

apt-get install apache2-dev libcrypt-ssleay-perl libwww-perl make
wget http://wiki.kartbuilding.net/mod_watch-4.3_apache22_mod.tar.gz
#gunzip and tar -xvf
nano Makefile.dso
//change APXS location to:
APXS=/usr/bin/apxs2

make -f Makefile.dso build
make -f Makefile.dso install 

Add and config mod_watch apache module

vi /etc/apache2/mods-available/watch.load
//add in
LoadModule watch_module /usr/lib/apache2/modules/mod_watch.so

a2enmod watch
vi /etc/apache2/sites-enabled/01-default  (or whatever vhost you want)
       <Location /watch-info>
         SetHandler watch-info
           Order deny,allow
           Deny from all
           Allow from 127.0.0.1 ::1
       </Location>
       <Location /watch-list>
        SetHandler watch-list
           Order deny,allow
           Deny from all
           Allow from 127.0.0.1 ::1
       </Location>

/etc/init.d/apache2 restart

Checking mod_watch for errors

elinks http://localhost/watch-list
#check for output

mod_watch Errors received

in error.log with Debian Squeeze running 2.6.32-5-amd64

tail -f /var/log/apache2/error.log
//I noticed the following warns when I accessed any vhosts with mod_watch enabled
[Fri Mar 18 22:35:36 2011] [crit] (20014)Internal error: shGetLockedEntry(7fca84e5aae8, "SERVER") failed in watchPostReadRequestHash()
[Fri Mar 18 22:35:36 2011] [error] shVerifyString(7fca84e5aae8, 7fca83c946f8) failed!
[Fri Mar 18 22:35:36 2011] [crit] (20014)Internal error: shGetLockedEntry(7fca84e5aae8, "monitor2.burkesys.com") failed in watchLogHash()
[Fri Mar 18 22:35:36 2011] [error] shVerifyString(7fca84e5aae8, 7fca83c94718) failed!
[Fri Mar 18 22:35:36 2011] [crit] (20014)Internal error: shGetLockedEntry(7fca84e5aae8, "SERVER") failed in watchLogHash()

resolve mod_watch errors

Googling led me to http://forums.cacti.net/viewtopic.php?p=186639#p186639

cd /root/mod_watch-4.3_apache22_mod/
vi SharedHash.c
//on line 102 change to look like:
shVerifyString(struct shTable *tp, char *str)
{
   /* if ((char *) tp->shared <= str && str < (char *) tp->eshared) { */
   if ((char *) apr_shm_baseaddr_get(tp->shared) <= str && str < (char *) tp->eshared) {
       if (str + strlen(str) < (char *) tp->eshared)
           return str;
   }

So now browing various vhosts on the server showed no errors in error.log. Using elinks (apt-get install elinks) going to http://localhost/watch-list showed results.

Munin Plugin for Mod_Watch

cd /usr/share/munin/plugins
wget http://wiki.kartbuilding.net/apache_watch
chmod 755 apache_watch
vi apache_watch
//change my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://monitor2.burkesys.com:%d/watch-list"; to:
my $URL = exists $ENV{'url'} ? $ENV{'url'} : "http://server.com:%d/watch-list";

ln -s /usr/share/munin/plugins/apache_watch /etc/munin/plugins/apache_watch_requests

That should do it. Once mod_watch is working and accessible munin should pick it up ok. References: http://stubbedtoe.co.nz/index.php/2009/09/apache-vhost-monitoring-with-munin/ 
http://exchange.munin-monitoring.org/plugins/apache_watch_/version/1 
http://forums.cacti.net/about15475.html

This is a nice apache module. I'm surprised that there is no maintained similar apache module. I've seen another similar munin plugin that parses /var/log/apache2/vhost%_access.log to generate these graphs, however it requires separate log files for each vhost and parses the logs every so often. Any more info /queries / suggestions drop us a mail sburke[at]burkesys.com

댓글을 달아 주세요

[MRTG] 자동 설치 스크립트

리눅스/어플리케이션 2011. 8. 16. 19:48 Posted by Relipmoc
CentOS 5 기준이며, 다른 배포판일 경우 패키지 설치 명령어만 다르고 나머지는 같으.. ㄹ 겁니다
실사용 하실 때 설치 스크립트에서 주석은 달아 놨으니 변수부분만 바꿔주시면 되며, 이 스크립트는 MRTG 설치&설정 스크립트지 SNMP 설정은 하지 않습니다.

#!/bin/sh
# Author: Larry Kim <admin@relip.org>

# ============= 변수 선언 =============

MRTG_CFG_PATH="/etc/mrtg/local.cfg" # MRTG 설정파일 경로. 꼭 obsolute path 여야함!
MRTG_WORK_DIR="/data/www/www.relip.org/mrtg/" # 데이터, 그래프들을 저장할 경로
SNMP_VERSION="2" # SNMP 버전 
SNMP_HOST="localhost" # SNMP 데이터를 가져올 서버의 아이피 또는 도메인
SNMP_COMMUNITY="public" # SNMP 커뮤니티 이름

# ============= 변수 선언 끝 ==========

yum -y install mrtg
cfgmaker --snmp-options=:::::${MRTG_SNMP_VERSION} --global "WorkDir: ${MRTG_WORK_DIR}" --global 'Language: korean' --global 'Options[_]: bits,growright' --global 'Refresh: 300' --global 'WriteExpires: Yes' --output ${MRTG_CFG_PATH} ${SNMP_COMMUNITY}@${SNMP_HOST}
indexmaker ${MRTG_CFG_PATH} --output=${MRTG_WORK_DIR}/index.html
echo "*/5 * * * * root env LANG=C /usr/bin/mrtg ${MRTG_CFG_PATH}  > /dev/null 2>&1" >>  /etc/crontab 

참 쉽ㅈ.. 
TAG MRTG

댓글을 달아 주세요

그냥 복붙할 수 있도록 스크립트 형식으로 작성.


#기본적인 라이브러리/툴 설치:
yum groupinstall "Development Tools"
yum groupinstall "Development Libraries"

#mysql: Version: 5.5.15
# groupadd 가 안될 경우 밑의 주석을 풀어준다.
# export PATH=$PATH:/usr/sbin:/sbin
groupadd mysql
useradd mysql
wget http://mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.15.tar.gz/from/http://mirror.khlug.org/mysql/
tar zxvf mysql-5.5.15.tar.gz
cd mysql-5.5.15
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum -y install cmake

cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DMYSQL_DATADIR=/opt/mysql/data \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \
-DSYSCONFIGDIR=/etc \
-DWITH_EXTRA_CHARSETS=all \

-DWITH_DEBUG=0  
make
make install

cd ../

#apache: Version: 2.2.19
wget http://mirror.khlug.org/apache//httpd/httpd-2.2.19.tar.gz
tar zxvf httpd-2.2.19.tar.gz 
cd httpd-2.2.19
 ./configure --prefix=/opt/httpd --enable-modules=so --enable-module=shared --enable-mods-shared=all --enable-so --enable-ssl --enable-rewrite --enable-rule=SHARED_CORE --enable-mods-shared=ssl --with-ssl --with-mpm=prefork --enable-modules=unique_id
make
make install

cd ../

#php: Version: 5.3.6
wget http://www.php.net/get/php-5.3.6.tar.gz/from/kr.php.net/mirror 
tar zxvf php-5.3.6.tar.gz
cd php-5.3.6
yum install -y libjpeg-devel libpng-devel net-snmp-devel libmcrypt-devel libc-client-devel pcre pcre-devel openssl openssl-devel libxml2 libxml2-devel bzip2-devel gdbm gdbm-devel libcurl-devel reestype freetype-devel cyrus-sasl-ldap cyrus-sasl-ldap-devel openldap-devel libmcrypt-devel expat-devel
./configure  --prefix=/opt/php --with-apxs2=/opt/httpd/bin/apxs --with-config-file-path=/opt/httpd/conf --disable-debug --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-magic-quotes --enable-mbregex --enable-mbstring --enable-mod-charset --enable-sigchild --enable-soap --enable-sockets --enable-wddx --enable-zip --with-bz2 --with-curl=/usr --with-freetype-dir=/usr --with-gd --with-gdbm=/usr --with-gettext --with-iconv --with-imap --with-imap-ssl --with-jpeg-dir=/usr --with-kerberos --with-ldap --with-libexpat-dir --with-libxml-dir --with-mcrypt --with-openssl --without-sqlite --with-png-dir=/usr --with-snmp --with-xmlrpc --with-zlib --with-mcrypt --with-mysql=/opt/mysql --with-pdo-mysql=/opt/mysql
make
make install

cd ../ 


댓글을 달아 주세요

PHP Version: 5.2.13

이 오류가 나는 이유는, FreeTDS 를 패키지로 설치할 때, 라이브러리가 lib64에 복사되기 때문이다. 하지만 PHP 는 --with-mssql 옵션을 주면 /usr/lib 에서 라이브러리를 찾는다.


ln -s /usr/lib64/libsybdb.so /usr/lib/
./configure [중간 옵션] --with-mssql
make
make install


댓글을 달아 주세요

  1. ugg 2013.07.28 17:49  댓글주소  수정/삭제  댓글쓰기

    지금은 반짝반짝 빛이 나겠지,, 하지만 시간이 흐르면 그빛은 사라저버릴거야,지금 우리처럼