Category Archives: Apache

Home »  Apache

ubuntu 싱글모드

기본적으로 리눅스는 Grub 에서 편집모드로 들어가서 커널 구문 맨 뒤에 single 
이라는 구문을 추가시켜주면 싱글모드로 부팅된다. 하지만 우분투 8.04는 좀
달라서 애를 먹었다.

Gurb Recovery 모드로 부팅했다.

여기서 3번째를 선택했으나

Give root Password for maintenance

for type Control-D to continue:
이렇게 뜬다. 루트 패스워스를 묻는다…Root 패스워드 잊어서 왔는데 이거 머니!!!!

그래서 구글링을 했다.  역시 우분투 사이트에서 찾을수있었다.. 나랑 비슷한 사례를
당한 사람이 별루 없었나 약간 헤매어서 찾게되었다..

The Standard Way
 This procedure gives you a full root shell! You can damage your system if you are not careful!

When booting up press ESC at the grub prompt and use the arrow keys to select the rescue mode option and press enter.
This will boot the system in rescue mode and you should arrive at a prompt that looks like this

root@something

To reset your password type this in

passwd <username>
and then enter you new password.

Once you are done resetting your password you can than switch back to the normal GUI mode by putting this in

init 2

If if appears to boot normally, but you see a message […]

vsftpd 상세로그 남기기

컴프에 추가
/var/log 가믄 vsftpd.log 파일이생성됨
xferlog_enable=NO  // 기존엔 YES로되있음
dual_log_enable=YES
log_ftp_protocol=YES

php.ini 설정_ error_reporting 관련

php.ini 에서 error_reporting 기본 사항은
error_reporting = E_ALL | E_STRICT
 
;error_reporting = E_ALL | E_STRICT
;error_reporting = E_ALL & ~E_NOTICE
error_reporting = E_ERROR & ~E_NOTICE   // 에러만출력하게끔
이것땜시롱 사이트가 느려지는 경우 발생-0-

apache mpm worker 설정

* 현재 worker 모듈 설치 되었는지 확인법
– “httpd -l” 명령으로 현재 설치된 Apache가 worker방식으로 설치되었는지 확인할 수 있다.
============================================
# httpd -l
Compiled in modules:
core.c
worker.c
http_core.c
mod_so.c
============================================
또는, httpd -V 명령으로 확인 가능하다. (V는 대문자)
============================================
# httpd -V
Server version: Apache/2.2.15 (Unix)
Server built: Jun 30 2010 16:59:45
Server’s Module Magic Number: 20051115:24
Server loaded: APR 1.4.2, APR-Util 1.3.9
Compiled using: APR 1.4.2, APR-Util 1.3.9
Architecture: 32-bit
Server MPM: Worker
threaded: yes (fixed thread count)
forked: yes (variable process count)
Server compiled with….
-D APACHE_MPM_DIR=”server/mpm/worker”
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT=”/home/paint/apache-2.2.15″
-D SUEXEC_BIN=”/home/paint/apache-2.2.15/bin/suexec”
-D DEFAULT_SCOREBOARD=”logs/apache_runtime_status”
-D DEFAULT_ERRORLOG=”logs/error_log”
-D AP_TYPES_CONFIG_FILE=”conf/mime.types”
-D SERVER_CONFIG_FILE=”conf/httpd.conf”
=============================================
2. 설정
1) httpd.conf 수정
– 아래와 같이. “Include conf/extra/httpd-mpm.conf” 설정의 주석을 제거한다.(기본적으로 주석처리 되어 있음)
===============================

# Server-pool management (MPM specific)
Include conf/extra/httpd-mpm.conf

===============================
2) […]

httpd[23916]:general protection rip:306801ea1e rsp:45ab9c30 error:0

Jan 23 09:06:50 localhost kernel: httpd[23916] general protection rip:306801ea1e rsp:45ab9c30 error:0
Jan 23 09:07:17 localhost kernel: httpd[23384]: segfault at 0000000000000000 rip 000000306801ea1a rsp 000000004dcc6af0 error 4
INFO: task httpd:13593 blocked for more than 120 seconds.
“echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
httpd D ffffffff80156387 0 13593 9700 13594 13592 (NOTLB)
ffff8103e02d3c78 0000000000000086 0000000000000000 0000000000000000
0000000000000100 000000000000000a ffff8101d81ee080 ffff81043fe87100
00131dfba2e291fd 000000000000c456 ffff8101d81ee268 0000000f000000ca
Call Trace:
[] __mutex_lock_slowpath+0x60/0x9b
[] __d_lookup+0xb0/0xff
[] .text.lock.mutex+0xf/0x14
[] do_lookup+0xd1/0x227
[] __link_path_walk+0x9f4/0xf39
[] link_path_walk+0x45/0xb8
[] do_path_lookup+0x294/0x310
[] getname+0x15b/0x1c2
[] __user_walk_fd+0x37/0x4c
[] vfs_stat_fd+0x1b/0x4a
[] sys_newstat+0x19/0x31
[] vfs_read+0x13c/0x171
[] sys_read+0x60/0x6e
[] system_call+0x7e/0x83
> 메모리 점검필요..ㅠㅠ

apache 2.4.x 에 mod_cband 설치시 error ( 설정 포함 )

apache 2.4.x의 경우 cband 컨파일시 에러를 확인할 수있다.
> configure 옵션은 apxs만 넣어줫음-0-
./configure –with-apxs=/usr/local/apache/bin/apxs
============== error 내용 =========================
/usr/local/apache/bin/apxs -Wc,-Wall -Wc,-DDST_CLASS=3 -c src/mod_cband.c
/usr/local/apache/build/libtool –silent –mode=compile gcc -std=gnu99 -prefer-pic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -g -O2 -pthread -I/usr/local/apache/include -I/usr/local/apache/include -I/usr/local/apache/include -Wall -DDST_CLASS=3 -c -o src/mod_cband.lo src/mod_cband.c && touch src/mod_cband.slo
src/mod_cband.c:66: warning: type qualifiers ignored on function return type
src/mod_cband.c: In function ‘mod_cband_set_random_pulse’:
src/mod_cband.c:416: warning: cast to pointer from integer of different size
src/mod_cband.c: In function ‘mod_cband_set_limit’:
src/mod_cband.c:436: warning: pointer targets in passing argument 2 of ‘mod_cband_conf_get_limit_kb’ differ in signedness
src/mod_cband.c: In function ‘mod_cband_set_user_limit’:
src/mod_cband.c:651: warning: pointer targets in passing argument 2 of ‘mod_cband_conf_get_limit_kb’ differ in signedness
src/mod_cband.c: In function ‘mod_cband_set_class_limit’:
src/mod_cband.c:874: warning: pointer targets in passing argument 2 of ‘mod_cband_conf_get_limit_kb’ differ in signedness
src/mod_cband.c: In function ‘mod_cband_set_user_class_limit’:
src/mod_cband.c:899: warning: pointer targets in passing argument 2 of ‘mod_cband_conf_get_limit_kb’ differ in signedness
src/mod_cband.c: In function ‘mod_cband_get_dst’:
src/mod_cband.c:1281: error: ‘conn_rec’ has no member named ‘remote_ip’
src/mod_cband.c: In function ‘mod_cband_get_remote_host’:
src/mod_cband.c:1310: error: ‘struct conn_rec’ has no member named […]

디렉토리 목록 안보이게하기-0-

<Directory “/home/msnote”>
# Options Indexes MultiViews    // 인덱스페이지로 목록보기
Options IncludesNoExec              // 안보기 -0-
AllowOverride None
Order allow,deny
Allow from all
</Directory>
 

모바일 접속시 모바일페이지로!! (  mod_rewrite  )

/usr/local/apache/conf/httpd.conf
 
 
> 모듈 로드 확인
LoadModule rewrite_module modules/mod_rewrite.so
 
> 모바일 디바이스 선언
UnsetEnv MOBILE_DEVICE
SetEnvIfNoCase User-Agent “iphone” MOBILE_DEVICE=TRUE
SetEnvIfNoCase User-Agent “android” MOBILE_DEVICE=TRUE
SetEnvIfNoCase User-Agent “ipod” MOBILE_DEVICE=TRUE
SetEnvIfNoCase User-Agent “ipad” MOBILE_DEVICE=TRUE
SetEnvIfNoCase User-Agent “midp” MOBILE_DEVICE=TRUE
 
>vhost 설정
/usr/local/apache/conf/extra/httpd-vhosts.conf
RewriteEngine on
RewriteCond %{ENV:MOBILE_DEVICE} ^TRUE$
RewriteRule ^(.*)$ http://m.msnote.co.kr$1 [L]
 
> 끝!

wrong ELF class: ELFCLASS32

모듈 설치시 wrong ELF class: ELFCLASS32 에러발생원인
32비트 인지 64비트인지 운영체제 확인 후 모둘 로드할것

apache 2.X.X SSL 인증서 설치

apache 2.X.X SSL 인증서설치
vi /usr/local/apache/conf/httpd.conf
LoadModule ssl_module modules/mod_ssl.so < < 확인
Include conf/extra/httpd-ssl.conf << 주석해제
vi /usr/local/apache/conf/extra/httpd-ssl.conf
SSLCertificateFile << 도메인.crt
SSLCertificateKeyFile << 도메인.key
SSLCertificateChainFile << ca- .crt
위의 3가지 파일 경로 설정
설정
apache 2.X.X같은 경우 ssl암호 없이 제시작 가능하지만 혹시 모르니 로그인시 암호파일생성
SSLPassPhraseDialog exec:/usr/local/apache/ssl/ssl_password.sh << 700 퍼미션
스크립트 내용
#!/bin/sh
echo password
이상~~ 방화벽까지 설정하면 끝~~