| 여러장의 이미지 간단히 합치기 | 움직이는GIF만들기 | 썸네일 쉽게 만들기
분류 전체보기 (85)
I am (0)
Today (1)
개발자이야기 (11)
나만의 유용한정보 (7)
서버관련 (40)
지름신 (5)
사진/여행 (1)
끄적끄적 (5)
골프 (11)
주식 (2)

«   2024/03   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Visitors up to today!
Today hit, Yesterday hit
daisy rss
티스토리 가입하기!
'아파치'에 해당되는 글 4건
2009. 9. 24. 16:30

 

<VirtualHost *>
        ServerName www.original.com
        ServerAlias original.com

        RewriteEngine on
        RewriteCond     %{HTTP_HOST}    ^original.com$        [OR]
        RewriteCond     %{HTTP_HOST}    com.$
        RewriteRule     ^/(.*)          http://www.somewhere.com/$1   [L,R]

</VirtualHost>

위와 같이 처리하면 서브URI까지 다 변경이 됨.
도메인변경등으로 서버변경등의 사유로 기존경로를 그대로 써야할경우 유용함.

2008. 8. 1. 13:45
아파치 2.2.9 에서 2.2.8에서 잘되던 configure 옵션에서 WARNING이 난다.

configure: WARNING: Unrecognized options: --enable-headers, --enable-rewrite

아주 간단한 옵션인데.. 구글한테 물어봐도 시원한 답변이 없고.
테스트해보니 문제없이 다 잘되긴하는데.. 아파치 2.2.9의 버그로밖에 생각할 수 없따아.

https://issues.apache.org/bugzilla/show_bug.cgi?id=45221


2008. 3. 4. 21:04
FreeBSD 에서 Apache2 + PHP 5.x 를 설치하는 방법

kldload accf_http
를 띄운다.

vi /boot/loader.conf 에
accf_http_load="YES"
추가하고 리부팅 한번 때려주거나,

커널옵션에
options ACCEPT_FILTER_HTTP
를 추가하고 커널컴팔 후 리부팅한다.

최신 아파치(현재는 2.2.8) 을 가져와서 소스를 푼다.

./configure --prefix=/usr/local/apache2 --enable-module=most --enable-shared=max --enable-rewrite --enable-headers --enable-rewrite --enable-deflate --enable-so --with-included-apr

PHP를 동적으로 컴파일해야 하기때문에  --enable-so는 반드시 있어야한다.
그외 옵션추가는 ./configure --help  로 참조한다.
설치디렉토리는 --prefix 의 경로로  변경이 가능하다.

make; make install

위의 과정으로 아파치 컴파일은 완료!

FreeBSD 6.x 의 경우 기본적으로 perl이 설치안되어 있으므로 perl을 설치하는것이 좋겠다.

cd /usr/port/lang/perl5.8
make install

최신의 PHP 소스롤 가져다가 푼다.

./configure  --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/apache2/conf --with-mysql=/usr/local/mysql --with-zlib-dir=/usr/local/zlib --enable-ftp --enable-sockets --enable-mbstring --disable-debug --with-config-file-path=/usr/local/lib --with-iconv

아파치 설치된 경로로 apxs 를 지정한다.
그외 gd를 설치하거나 기타 옵션을 주려면, 마찬가지로 ./configure --help를 참고한다.

make; make install

인스톨후
# php -v
PHP 5.2.5 (cli) (built: Nov  5 2007 16:11:19)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
와 같이 버젼이 제대로 나오는지 확인한다.

아파치 설치 디렉토리에서
vi /usr/local/apache2/conf/httpd.conf
후에 아래를 추가한다.
LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php

그외 아파치 설정파일은 아파치 문서를 참고한다.
.php 외의 확장자나 다른확장자로 php 스크립트를 만드려면 뒤에 추가해도 된다.
ex) AddType application/x-httpd-php .php .html .phps

/usr/local/apache2/bin/apachectl start

아파치를 구동한다.
2008. 1. 28. 20:46

/usr/local/apache2/bin/apxs -cia mod_evasive20.c
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic    -g -O2 -I/usr/local/apache2/include  -I/usr/local/apache2/include   -I/usr/local/apache2/include   -c -o mod_evasive20.lo mod_evasive20.c && touch mod_evasive20.slo
gcc: mod_evasive20.c: No such file or directory
gcc: No input files specified
apxs:Error: Command failed with rc=65536

.

/usr/local/apache2/bluild/libtool 을 사용하지 않고, 기본 OS의 libtool을 사용하니 에러가 없어지고

잘되는군... 황당.

/usr/local/apache2/bin/apxs -cia mod_evasive20.c
/usr/local/apache2/build/libtool --silent --mode=compile gcc -prefer-pic    -g -O2 -I/usr/local/apache2/include  -I/usr/local/apache2/include   -I/usr/local/apache2/include   -c -o mod_evasive20.lo mod_evasive20.c && touch mod_evasive20.slo
/usr/local/apache2/build/libtool --silent --mode=link gcc -o mod_evasive20.la  -rpath /usr/local/apache2/modules -module -avoid-version    mod_evasive20.lo
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' mod_evasive20.la /usr/local/apache2/modules
/usr/local/apache2/build/libtool --mode=install cp mod_evasive20.la /usr/local/apache2/modules/
cp .libs/mod_evasive20.so /usr/local/apache2/modules/mod_evasive20.so
cp .libs/mod_evasive20.lai /usr/local/apache2/modules/mod_evasive20.la
cp .libs/mod_evasive20.a /usr/local/apache2/modules/mod_evasive20.a
chmod 644 /usr/local/apache2/modules/mod_evasive20.a
ranlib /usr/local/apache2/modules/mod_evasive20.a
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apache2/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

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/apache2/modules/mod_evasive20.so

prev"" #1 next