Linux WEB

Debian 에서 mod_rewrite 활성화 하기

2008.12.12 22:31

jook 조회 수:21787

1. a2enmod 명령어로 rewrite 모듈을 활성화 한다.

 localhost:/etc# a2enmod rewrite
 Module rewrite installed; run /etc/init.d/apache2 force-reload to enable.

 a2enmod 를 실행 할 경우는 아래와 같이 /etc/apache2/mods-available/rewrite.load 파일이 /etc/apache2/mods-enabled/ 디렉토리로 링크가 생성된다.

 localhost:/etc/apache2/mods-enabled# ls -l /etc/apache2/mods-enabled/rewrite.load
 lrwxrwxrwx 1 root root 30 Dec 12 12:02 /etc/apache2/mods-enabled/rewrite.load -> ../mods-available/rewrite.load

 a2enmod 명령을 사용하지 않고 수동으로 링크를 생성해도 된다.


2. /etc/apache2/apache2.conf 파일에 아래의 내용을 추가한다.

 <IfModule mod_rewrite.c>
         RewriteEngine On
 </IfModule>



3. apache2.conf 파일의 <Directory> </Directory> 설정부분이나, 가상호스트 설정부분의 <Directory> </Directory> 설정 부분에서AllowOverride None 부분을 AllowOverride all로 수정한다.

        <Directory /home/jook/public_html/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride all
                Order allow,deny
                allow from all
                # This directive allows us to have apache2's default start page
                # in /apache2-default/, but still have / go to the right place
        </Directory>


4. apache 데몬 restart

번호 제목 글쓴이 날짜 조회 수
43 ZendOptimizer 3.3.9 설치 file 호스트웨이 2012.06.01 19379
42 Zend Guard Loader 설치 호스트웨이 2012.04.20 19719
41 CentOS 6.3 에 apache, php, mysql, phpmyAdmin(LAMP) 설치하기 #1 호스트웨이 2012.08.07 20605
40 nginx - redirect 설정 호스트웨이 2012.08.24 20971
39 [php] 세션 유지시간 설정하기 호스트웨이 2012.10.25 21317
» Debian 에서 mod_rewrite 활성화 하기 jook 2008.12.12 21787
37 apache internal dummy connection 로그 생성 방지하기 호스트웨이 2012.09.06 21943
36 server-status를 이용한 아파치 모니터링 방법 file 호스트웨이 2016.04.05 22069
35 mod_GeoIP를 이용한 국가 IP 확인 및 국가별 접속 제한 호스트웨이 2012.05.04 22155
34 Debian에서 apm 설치할때의 패키지 목록 jook 2008.12.27 22183
33 apache1.3 + mod_ssl - 보안서버 구축하기 sylee 2008.05.15 22343
32 설치된 서버 php에서 지원되는 함수 확인 하기 hostway 2008.05.14 22584
31 apache에서 cgi를 사용하기 위한 설정 방법 호스트웨이 2012.04.27 22680
30 Apache Max Client 값 수정 호스트웨이 2012.08.31 22984
29 httpd-2.x.x 에서의 SERVER_LIMIT 변경 hostway 2008.05.14 23239
28 Apache / PHP 최신버전 설치하기 호스트웨이 2015.09.25 23268
27 아파치 환경설정 파일분석 1번째 sylee 2008.05.14 23675
26 Apache 설치 후 WEB 403 Forbidden 에러 호스트웨이 2015.09.08 24287
25 SSL 패스워드 삭제 하기 호스트웨이 2012.09.05 24294
24 http://도메인/~계정으로 접근하기 sylee 2008.05.15 25265