APACHE 2.4에 SSL을 적용 후 재구동하였을때 아래와 같은 메세지가 나왔다

AH00526: Syntax error on line 92 of /usr/local/apache/conf/extra/httpd-ssl.conf:

SSLSessionCache: 'shmcb' session cache not supported (known names: ). Maybe you need to load the appropriate socache module (mod_socache_shmcb?).

위 에러는 모듈을 로드 해줘야 한다

httpd.conf 를 열어 아래의 모듈을 추가 해주자

LoadModule socache_shmcb_module modules/mod_socache_shmcb.so

추가 후 APACHE를 재구동 해주면 정상작동되는 것을 확인 할 수 있다.


출처 : https://note-it.tistory.com/29

ssh 로그인할때 로그인이 느려지는 현상
로그인을 할때 로그를 보면
john dbus[7254]: [system] Failed to activate service 'org.freedesktop.login1': timed out

로그인 timed out 이 뜨면서 계속 지연이 발생이 된다. 이걸 해결하기 위해서는
# systemctl restart systemd-logind
위 명령어를 입력해서 재구동 해주면 정상적으로 빠르게 로그인이 된다.

출처 : https://algo79.tistory.com/1277

 

Apache 2.4.x 서버에서 mod_cband  (트래픽 사용량 제어 모듈) 설치시 다음과 같은 오류 메세지가 출력됩니다.

[ SUN(11.123) , /usr/local/src/mod-cband-0.9.7.5 ] > make

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/usr/local/apr/build-1/libtool –silent –mode=compile gcc -std=gnu99 -prefer-pic -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -I/usr/local/apr-util/include/apr-1 -Wall -DDST_CLASS=3 -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function ‘mod_cband_create_traffic_size’:
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c: In function ‘mod_cband_get_dst’:
src/mod_cband.c:1333: error: ‘conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c: In function ‘mod_cband_get_remote_host’:
src/mod_cband.c:1362: error: ‘struct conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c:1363: error: ‘struct conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c:1365: error: ‘struct conn_rec’ has no member named ‘remote_addr’
apxs:Error: Command failed with rc=65536
.
make: *** [src/.libs/mod_cband.so] 오류 1

mod_cband.c 파일을 편집합니다.

vi /usr/local/src/mod-cband-0.9.7.5/src/mod_cband.c

이때, src/.libs/mod_cband.c 라는 파일이 존재 않은 상태에서 작업해야 합니다.

빨간색은 수정 이전 라인, 파란색은 수정 이후 라인입니다.

1333번 라인
p.add.sin.s_addr = inet_addr(r->connection->remote_ip);
p.add.sin.s_addr = inet_addr(r->connection->client_ip);

1342번 라인
   fprintf(stderr,”%s leaf %s\n”,r->connection->remote_ip,leaf);
   fprintf(stderr,”%s leaf %s\n”,r->connection->client_ip,leaf);

1362~1365번 라인
if (c->remote_ip != NULL)
addr = inet_addr(c->client_ip);
else
addr = c->remote_addr->sa.sin.sin_addr.s_addr;

if (c->client_ip != NULL)
addr = inet_addr(c->client_ip);
else
addr = c->client_addr->sa.sin.sin_addr.s_addr;

위와 같이 수정한 다음 make 명령을 내리면 정상적으로 컴파일이 진행됩니다.

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/usr/local/apr/build-1/libtool –silent –mode=compile gcc -std=gnu99 -prefer-pic -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -I/usr/local/apr-util/include/apr-1 -Wall -DDST_CLASS=3 -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function ‘mod_cband_create_traffic_size’:
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
/usr/local/apr/build-1/libtool –silent –mode=link gcc -std=gnu99 -o src/mod_cband.la -rpath /usr/local/apache/modules -module -avoid-version src/mod_cband.lo

write “make install” to install module

 

make install

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -i -a -n cband src/mod_cband.la
/usr/local/apache/build/instdso.sh SH_LIBTOOL=’/usr/local/apr/build-1/libtool’ src/mod_cband.la /usr/local/apache/modules
/usr/local/apr/build-1/libtool –mode=install install src/mod_cband.la /usr/local/apache/modules/
libtool: install: install src/.libs/mod_cband.so /usr/local/apache/modules/mod_cband.so
libtool: install: install src/.libs/mod_cband.lai /usr/local/apache/modules/mod_cband.la
libtool: install: install src/.libs/mod_cband.a /usr/local/apache/modules/mod_cband.a
libtool: install: chmod 644 /usr/local/apache/modules/mod_cband.a
libtool: install: ranlib /usr/local/apache/modules/mod_cband.a
libtool: finish: PATH=”/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/java/bin:/root/bin:/sbin” ldconfig -n /usr/local/apache/modules
———————————————————————-
Libraries have been installed in:
/usr/local/apache/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-
chmod 755 /usr/local/apache/modules/mod_cband.so
[activating module `cband’ in /usr/local/apache/conf/httpd.conf]

출처 : http://idchowto.com/tip-apache-2-4-x-%EC%84%9C%EB%B2%84%EC%97%90%EC%84%9C-mod_cband-%EC%84%A4%EC%B9%98%EC%8B%9C-%EC%98%A4%EB%A5%98-%EB%A9%94%EC%84%B8%EC%A7%80-%EC%B2%98%EB%A6%AC%EB%B0%A9%EB%B2%95/


[증상]


CentOS7 서버에 FTP를 구축하여 처음 연결을 시도하였는데 아래와 같이 

500 OOPS vsftpd: refusing to run with writable root inside chroot()라는 메시지와 함께 

Critical error가 뜨면서 연결이 되지를 않았다.

원인은 chroot내에 쓰기 권한이 없어서 발생한 문제로써, 설정을 바꿔주면 해결되는 문제다.

 

 

[해결책]

vi /etc/vsftpd/vsftpd.conf

allow_writeable_chroot=YES 구문을 적당한 위치에 추가해 준다.

systemctl restart vsftpd.service


 

증상 : configure: error: DBA: Could not find necessary library.
해결 : ln -s /usr/lib64/libgdbm_compat.so /usr/lib/libdbm.so

 

증상 : checking for DB4 major version... configure: error: Header contains different version.

해결 1 : yum install db4 db4-devel (db4 와 db4-devel 을 설치한 뒤에도 안되면 아래 참고)

해결 2

/usr/include/db.h 가 /usr/include/libdb/db.h 로 연결되어 있을 경우
unlink /usr/include/db.h   (기존 db.h 링크 해제)

cd /usr/include
ln -s /usr/include/libdb4/db.h db.h

 

make 과정에서

/home/segio_php/php-5.2.17/ext/dom/node.c: In function ‘dom_canonicalization’:

/home/segio_php/php-5.2.17/ext/dom/node.c:1953:21: error: dereferencing pointer to incomplete type

/home/segio_php/php-5.2.17/ext/dom/node.c:1955:5: error: dereferencing pointer to incomplete type


오류가 발생한다면

 

[root@localhost] wget -O php.patch  https://mail.gnome.org/archives/xml/2012-August/txtbgxGXAvz4N.txt

[root@localhost] cd php-5.2.17

[root@localhost] patch -p0 -b < php.patch


patching file ext/dom/node.c

Hunk #1 succeeded at 1950 (offset 55 lines).

patching file ext/dom/documenttype.c

Hunk #1 succeeded at 215 (offset 10 lines).

patching file ext/simplexml/simplexml.c

Hunk #1 succeeded at 1343 (offset -74 lines).


patch 명령어를 찾을 수 없다고 할 경우 yum -y install patch

위와 같이 패치를 적용한 후 컴파일을 하면 문제없이 진행된다.


CentOS 5 버전에서 더이상의 업데이트 지원이 중단된 시점에 아래와 같은 오류가 발생할 때는

# yum install packagename    
gpg key retrieval failed errno 14 http error 404 not found


yum install이 안되면서 gpg key retrieval failed errno 14 http error 404 not found 이런 에러가 나는 경우 해결책이다.


# rpm --import http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

gpg key라는 CentOS RPM signing key가 없으므로 이를 받아온 뒤에 yum 명령어를 실행하면 잘 될꺼다!


밑의 링크 두군데 중 한개를 import 하면 된다!



출처: http://junp.tistory.com/155?category=325188 [Software Engineer in Park]


cgi 기반의 프로그램 실행시 Internal Server Error 가 발생하여

로그를 확인해보니 아래와 같은 에러 메시지가 발견되었다.

error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory

이런 경우

yum -y install compat-libstdc++-296

해주면 정상적으로 cgi가 실행될 것이다.


 

tail -f /var/log/maillog 를 실행 하고, outlook에서 로그인메뉴에서 계속 권한 요청이 반복되는 오류를 확인
아래와 같은 오류 발생

localhost dovecot: pop3-login: Login: user=<abc>, method=PLAIN, rip=115.68.62.13, lip=192.168.1.24, mpid=27289
localhost dovecot: pop3(abc): Error: chown(/home/abc//mail/.imap/INBOX, -1, 12(mail)) failed: Operation not permitted (egid=501(abc), group based on /var/mail/abc)

localhost dovecot: pop3(abc): Error: mkdir(/home/ponstory//mail/.imap/INBOX) failed: Operation not permitted
localhost dovecot: pop3(abc): Error: Couldn't open INBOX: Internal error occurred. Refer to server log for more information. [2014-01-12 16:16:38]
localhost dovecot: pop3(abc): Couldn't open INBOX top=0/0, retr=0/0, del=0/0, size=0

해결
/var/mail 밑에 계정들에 대한 권한은 chmod를 이용해 0600으로 변경한다.
ex)chmod 0600 변경할 계정 입력


Apache 2.4 이상 버전에서 403 에러를 만났고,

error.log 를 보니 다음과 같은 에러가 있다면,


[Tue Dec 11 17:49:19.350384 2012] [authz_core:error] [pid 5308:tid 1576] [client 127.0.0.1:53603] AH01630: client denied by server configuration: /DOCUMENT_ROOT

mod_authz_core 에러일 가능성이 높다.

이럴 경우 <Directory> 접근 제한을 해제해야 하는데, 이전 버전과 다르다.


이전 버전은

<Directory /DOCUMENT_ROOT>

   ~~~

    Order allow,deny

    Allow from all

</Directory>

이런 식이었는데, 

아래처럼 바뀌었다.

<Directory /DOCUMENT_ROOT>

    ~~~

    Require all granted

</Directory>


참조: http://httpd.apache.org/docs/2.4/upgrading.html



출처: http://bloodguy.tistory.com/entry/Apache-24-버전에서-403-에러시-authzcoreerror-AH01630-client-denied-by-server-configuration [Bloodguy]


1. Apache 2.4 에 mod_cband 설치시 발생하는 에러

make 과정에서 아래와 같은 메시지 출력

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/usr/local/apr/build-1/libtool –silent –mode=compile gcc -std=gnu99 -prefer-pic -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -I/usr/local/apr-util/include/apr-1 -Wall -DDST_CLASS=3 -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function ‘mod_cband_create_traffic_size’:
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c: In function ‘mod_cband_get_dst’:
src/mod_cband.c:1333: error: ‘conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c: In function ‘mod_cband_get_remote_host’:
src/mod_cband.c:1362: error: ‘struct conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c:1363: error: ‘struct conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c:1365: error: ‘struct conn_rec’ has no member named ‘remote_addr’
apxs:Error: Command failed with rc=65536
.
make: *** [src/.libs/mod_cband.so] 오류 1


mod_cband.c 파일을 편집합니다.

vi /usr/local/src/mod-cband-0.9.7.5/src/mod_cband.c

이때, src/.libs/mod_cband.c 라는 파일이 존재 않은 상태에서 작업해야 합니다.

빨간색은 수정 이전 라인, 파란색은 수정 이후 라인입니다.

1333번 라인
p.add.sin.s_addr = inet_addr(r->connection->remote_ip);
p.add.sin.s_addr = inet_addr(r->connection->client_ip);

1342번 라인
   fprintf(stderr,”%s leaf %s\n”,r->connection->remote_ip,leaf);
   fprintf(stderr,”%s leaf %s\n”,r->connection->client_ip,leaf);

1362~1365번 라인
if (c->remote_ip != NULL)
addr = inet_addr(c->client_ip);
else
addr = c->remote_addr->sa.sin.sin_addr.s_addr;

if (c->client_ip != NULL)
addr = inet_addr(c->client_ip);
else
addr = c->client_addr->sa.sin.sin_addr.s_addr;

위와 같이 수정한 다음 make 명령을 내리면 정상적으로 컴파일이 진행됩니다.

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/usr/local/apr/build-1/libtool –silent –mode=compile gcc -std=gnu99 -prefer-pic -DLINUX -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include -I/usr/local/apr/include/apr-1 -I/usr/local/apr-util/include/apr-1 -Wall -DDST_CLASS=3 -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c: In function ‘mod_cband_create_traffic_size’:
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1054: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
src/mod_cband.c:1058: warning: comparison with string literal results in unspecified behavior
/usr/local/apr/build-1/libtool –silent –mode=link gcc -std=gnu99 -o src/mod_cband.la -rpath /usr/local/apache/modules -module -avoid-version src/mod_cband.lo

write “make install” to install module

 

make install

/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -i -a -n cband src/mod_cband.la
/usr/local/apache/build/instdso.sh SH_LIBTOOL=’/usr/local/apr/build-1/libtool’ src/mod_cband.la /usr/local/apache/modules
/usr/local/apr/build-1/libtool –mode=install install src/mod_cband.la /usr/local/apache/modules/
libtool: install: install src/.libs/mod_cband.so /usr/local/apache/modules/mod_cband.so
libtool: install: install src/.libs/mod_cband.lai /usr/local/apache/modules/mod_cband.la
libtool: install: install src/.libs/mod_cband.a /usr/local/apache/modules/mod_cband.a
libtool: install: chmod 644 /usr/local/apache/modules/mod_cband.a
libtool: install: ranlib /usr/local/apache/modules/mod_cband.a
libtool: finish: PATH=”/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/java/bin:/root/bin:/sbin” ldconfig -n /usr/local/apache/modules
———————————————————————-
Libraries have been installed in:
/usr/local/apache/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR’
flag during linking and do at least one of the following:
– add LIBDIR to the `LD_LIBRARY_PATH’ environment variable
during execution
– add LIBDIR to the `LD_RUN_PATH’ environment variable
during linking
– use the `-Wl,-rpath -Wl,LIBDIR’ linker flag
– have your system administrator add LIBDIR to `/etc/ld.so.conf’

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
———————————————————————-
chmod 755 /usr/local/apache/modules/mod_cband.so
[activating module `cband’ in /usr/local/apache/conf/httpd.conf]
You have new mail in /var/spool/mail/root



[출처] http://idchowto.com/?p=17012