[vsftpd] 500 OOPS: chroot

카테고리 없음 2011. 12. 22. 21:22 Posted by Relipmoc
SELinux 해제하면 해결 됨.

system-config-securitylevel-tui
실행해서 비활성화에서 스페이스 누르고 확인

댓글을 달아 주세요

N104A 분해

카테고리 없음 2011. 12. 3. 16:03 Posted by Relipmoc


.. 방열판 좀 보소.

댓글을 달아 주세요

  1. 쿠나 2012.01.06 02:31  댓글주소  수정/삭제  댓글쓰기

    쬐그맣네염
    어린 레립나무같당

  2. ghd 2013.07.27 04:47  댓글주소  수정/삭제  댓글쓰기

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


SPEEDTEST.net MINI를 사용 했으며, 내부망으로 테스트 했기 때문에 손실은 거의 없다고 보면 된다.


Cisco Valet Plus. (CH 11)


Cisco WAP4410N. (CH 13)
 


Buffalo WZR-HP-G300NH. (CH 7)

버팔로만 OpenWRT고 다른 건 다 정펌.
단거리(<50cm)에서 측정했기 때문에 의미없는 벤치이긴 하지만.. 
(사실 단거리가 아닌 원거리에서 측정한 값이 더 중요하다. 시간 나면 언젠가..) 
 

댓글을 달아 주세요

Cisco Valet Plus Refurbished

카테고리 없음 2011. 12. 3. 15:30 Posted by Relipmoc


댓글을 달아 주세요

--- mod_python-3.3.1/src/connobject.c    2006-12-03 13:36:37.000000000 +0900
+++ mod_python-3.3.1_patched/src/connobject.c    2011-11-20 14:33:20.000000000 +0900
@@ -139,7 +139,7 @@
     bytes_read = 0;
 
     while ((bytes_read < len || len == 0) &&
-           !(b == APR_BRIGADE_SENTINEL(b) ||
+           !(b == APR_BRIGADE_SENTINEL(bb) ||
              APR_BUCKET_IS_EOS(b) || APR_BUCKET_IS_FLUSH(b))) {
 
         const char *data;

댓글을 달아 주세요

HotSaNIC diskio module diff

카테고리 없음 2011. 11. 9. 06:18 Posted by Relipmoc
diff -ur hotsanic-2.4/modules/diskio/platform/common.pm hotsanic-2.6/modules/diskio/platform/common.pm
--- hotsanic-2.4/modules/diskio/platform/common.pm	2004-02-27 10:23:49.000000000 +0100
+++ hotsanic-2.6/modules/diskio/platform/common.pm	2007-11-19 04:28:22.000000000 +0100
@@ -16,6 +16,7 @@
     my ($sysname, $nodename, $release, $version, $machine ) = uname;
     $MODARGS{KERNEL}="2.2" if $release =~ /^2\.[12]\./;
     $MODARGS{KERNEL}="2.4" if $release =~ /^2\.[34]\./;
+    $MODARGS{KERNEL}="2.6" if $release =~ /^2\.[56]\./;
     }
   return %MODARGS
   }
diff -ur hotsanic-2.4/modules/diskio/platform/linux.pm hotsanic-2.6/modules/diskio/platform/linux.pm
--- hotsanic-2.4/modules/diskio/platform/linux.pm	2004-02-29 16:29:36.000000000 +0100
+++ hotsanic-2.6/modules/diskio/platform/linux.pm	2007-11-20 03:40:58.000000000 +0100
@@ -23,6 +23,18 @@
       store_values($args{MODNAME},$num,$racc,$wacc,$rblk,$wblk,512);
       }
     }
+  elsif ($args{KERNEL} eq "2.6") {
+    open FILE,"/proc/diskstats";
+    while (<FILE>) {
+      my ($num1, $num2, undef, @diskstats) = split; 
+      # HACK
+      next unless (defined $num1 && ($num1 == 8 || $num1 == 253));
+      $num=$num1."_".$num2;
+      store_values($args{MODNAME},$num,$diskstats[0],$diskstats[1],$diskstats[2],$diskstats[3],512) if (scalar @diskstats == 4);
+      store_values($args{MODNAME},$num,$diskstats[0],$diskstats[2],$diskstats[4],$diskstats[6],512) if (scalar @diskstats == 11);
+    }
+    close FILE;
+  }
   elsif ($args{KERNEL} eq "2.2") {
   # disk 1494755 377215 221577 144318
   # disk_rio 564538 286941 151189 77490

댓글을 달아 주세요

HotSaNIC ping module diff

카테고리 없음 2011. 11. 9. 06:07 Posted by Relipmoc
diff -ur hotsanic-2.4/modules/ping/diagrams.pl hotsanic-2.6/modules/ping/diagrams.pl
--- hotsanic-2.4/modules/ping/diagrams.pl	2003-10-16 12:25:38.000000000 +0200
+++ hotsanic-2.6/modules/ping/diagrams.pl	2007-11-20 04:01:47.000000000 +0100
@@ -71,7 +71,7 @@
 	if ($range eq "1h") {
           ($prints,$xs,$ys)=RRDs::graph $TEMPNAME, "-i", "-b","1000", "-v",$LEGEND,
             "-s","-$fullrange", "-w",$CONFIG{WIDTH}, "-h",$CONFIG{HEIGHT}, @OPTIONS, "-a", uc($IMGFMT),
-            "-u $UPPERBORDER", "-l $LOWBORDER", "--title", "ping-times to $dev - last $descr ($DATESTRING)",
+            "-u", $UPPERBORDER, "-l", $LOWBORDER, "--title", "ping-times to $dev - last $descr ($DATESTRING)",
             "DEF:min=rrd/$dev.rrd:min:AVERAGE",
             "DEF:avg=rrd/$dev.rrd:avg:AVERAGE",
             "DEF:max=rrd/$dev.rrd:max:AVERAGE",
@@ -82,16 +82,16 @@
             "LINE1:max#c00000:max",
             "GPRINT:max:MIN:  (min\\:%6.2lf%s /\\g",
             "GPRINT:max:AVERAGE: avg\\:%6.2lf%s /\\g",
-            "GPRINT:max:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+            "GPRINT:max:MAX: max\\:%6.2lf%s $LEGEND)\\n",
             "AREA:min#ffffff:",
             "LINE1:avg#000000:avg",
             "GPRINT:avg:MIN:  (min\\:%6.2lf%s /\\g",
             "GPRINT:avg:AVERAGE: avg\\:%6.2lf%s /\\g",
-            "GPRINT:avg:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+            "GPRINT:avg:MAX: max\\:%6.2lf%s $LEGEND)\\n",
             "LINE1:min#00c000:min",
             "GPRINT:min:MIN:  (min\\:%6.2lf%s /\\g",
             "GPRINT:min:AVERAGE: avg\\:%6.2lf%s /\\g",
-            "GPRINT:min:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+            "GPRINT:min:MAX: max\\:%6.2lf%s $LEGEND)\\n",
             "AREA:wrong#ffffa0:unreachable",
             "HRULE:0#000000";
           }
@@ -130,7 +130,7 @@
           else {
             ($prints,$xs,$ys)=RRDs::graph $TEMPNAME, "-i", "-b","1000", "-v",$LEGEND,
               "-s","-$fullrange", "-w",$CONFIG{WIDTH}, "-h",$CONFIG{HEIGHT}, @OPTIONS, "-a", uc($IMGFMT),
-              "-u $UPPERBORDER", "-l $LOWBORDER", "--title", "ping-times to $dev - last $descr ($DATESTRING)",
+              "-u", $UPPERBORDER, "-l", $LOWBORDER, "--title", "ping-times to $dev - last $descr ($DATESTRING)",
               "DEF:mini=rrd/$dev.rrd:min:MIN",
               "DEF:mina=rrd/$dev.rrd:min:AVERAGE",
               "DEF:minx=rrd/$dev.rrd:min:MAX",
@@ -144,17 +144,17 @@
               "AREA:maxx#ffc0c0:max",
               "GPRINT:maxi:MIN:  (min\\:%6.2lf%s /\\g",
               "GPRINT:maxa:AVERAGE: avg\\:%6.2lf%s /\\g",
-              "GPRINT:maxx:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+              "GPRINT:maxx:MAX: max\\:%6.2lf%s $LEGEND)\\n",
               "AREA:maxi#ffffff:",
               "AREA:avgx#c0c0ff:avg",
               "GPRINT:avgi:MIN:  (min\\:%6.2lf%s /\\g",
               "GPRINT:avga:AVERAGE: avg\\:%6.2lf%s /\\g",
-              "GPRINT:avgx:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+              "GPRINT:avgx:MAX: max\\:%6.2lf%s $LEGEND)\\n",
               "AREA:avgi#ffffff:",
               "AREA:minx#c0ffc0:min",
               "GPRINT:mini:MIN:  (min\\:%6.2lf%s /\\g",
               "GPRINT:mina:AVERAGE: avg\\:%6.2lf%s /\\g",
-              "GPRINT:minx:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+              "GPRINT:minx:MAX: max\\:%6.2lf%s $LEGEND)\\n",
               "AREA:mini#ffffff:",
               "LINE1:maxa#c00000:",
               "LINE1:mina#00c000:",
diff -ur hotsanic-2.4/modules/ping/diagrams.pl hotsanic-2.6/modules/ping/diagrams.pl
--- hotsanic-2.4/modules/ping/diagrams.pl	2003-10-16 12:25:38.000000000 +0200
+++ hotsanic-2.6/modules/ping/diagrams.pl	2007-11-20 04:01:47.000000000 +0100
@@ -71,7 +71,7 @@
 	if ($range eq "1h") {
           ($prints,$xs,$ys)=RRDs::graph $TEMPNAME, "-i", "-b","1000", "-v",$LEGEND,
             "-s","-$fullrange", "-w",$CONFIG{WIDTH}, "-h",$CONFIG{HEIGHT}, @OPTIONS, "-a", uc($IMGFMT),
-            "-u $UPPERBORDER", "-l $LOWBORDER", "--title", "ping-times to $dev - last $descr ($DATESTRING)",
+            "-u", $UPPERBORDER, "-l", $LOWBORDER, "--title", "ping-times to $dev - last $descr ($DATESTRING)",
             "DEF:min=rrd/$dev.rrd:min:AVERAGE",
             "DEF:avg=rrd/$dev.rrd:avg:AVERAGE",
             "DEF:max=rrd/$dev.rrd:max:AVERAGE",
@@ -82,16 +82,16 @@
             "LINE1:max#c00000:max",
             "GPRINT:max:MIN:  (min\\:%6.2lf%s /\\g",
             "GPRINT:max:AVERAGE: avg\\:%6.2lf%s /\\g",
-            "GPRINT:max:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+            "GPRINT:max:MAX: max\\:%6.2lf%s $LEGEND)\\n",
             "AREA:min#ffffff:",
             "LINE1:avg#000000:avg",
             "GPRINT:avg:MIN:  (min\\:%6.2lf%s /\\g",
             "GPRINT:avg:AVERAGE: avg\\:%6.2lf%s /\\g",
-            "GPRINT:avg:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+            "GPRINT:avg:MAX: max\\:%6.2lf%s $LEGEND)\\n",
             "LINE1:min#00c000:min",
             "GPRINT:min:MIN:  (min\\:%6.2lf%s /\\g",
             "GPRINT:min:AVERAGE: avg\\:%6.2lf%s /\\g",
-            "GPRINT:min:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+            "GPRINT:min:MAX: max\\:%6.2lf%s $LEGEND)\\n",
             "AREA:wrong#ffffa0:unreachable",
             "HRULE:0#000000";
           }
@@ -130,7 +130,7 @@
           else {
             ($prints,$xs,$ys)=RRDs::graph $TEMPNAME, "-i", "-b","1000", "-v",$LEGEND,
               "-s","-$fullrange", "-w",$CONFIG{WIDTH}, "-h",$CONFIG{HEIGHT}, @OPTIONS, "-a", uc($IMGFMT),
-              "-u $UPPERBORDER", "-l $LOWBORDER", "--title", "ping-times to $dev - last $descr ($DATESTRING)",
+              "-u", $UPPERBORDER, "-l", $LOWBORDER, "--title", "ping-times to $dev - last $descr ($DATESTRING)",
               "DEF:mini=rrd/$dev.rrd:min:MIN",
               "DEF:mina=rrd/$dev.rrd:min:AVERAGE",
               "DEF:minx=rrd/$dev.rrd:min:MAX",
@@ -144,17 +144,17 @@
               "AREA:maxx#ffc0c0:max",
               "GPRINT:maxi:MIN:  (min\\:%6.2lf%s /\\g",
               "GPRINT:maxa:AVERAGE: avg\\:%6.2lf%s /\\g",
-              "GPRINT:maxx:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+              "GPRINT:maxx:MAX: max\\:%6.2lf%s $LEGEND)\\n",
               "AREA:maxi#ffffff:",
               "AREA:avgx#c0c0ff:avg",
               "GPRINT:avgi:MIN:  (min\\:%6.2lf%s /\\g",
               "GPRINT:avga:AVERAGE: avg\\:%6.2lf%s /\\g",
-              "GPRINT:avgx:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+              "GPRINT:avgx:MAX: max\\:%6.2lf%s $LEGEND)\\n",
               "AREA:avgi#ffffff:",
               "AREA:minx#c0ffc0:min",
               "GPRINT:mini:MIN:  (min\\:%6.2lf%s /\\g",
               "GPRINT:mina:AVERAGE: avg\\:%6.2lf%s /\\g",
-              "GPRINT:minx:MAX: max\\:%6.2lf%s $LEGEND)\\n:",
+              "GPRINT:minx:MAX: max\\:%6.2lf%s $LEGEND)\\n",
               "AREA:mini#ffffff:",
               "LINE1:maxa#c00000:",
               "LINE1:mina#00c000:",

댓글을 달아 주세요

[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 ../ 


댓글을 달아 주세요