mod_rewrite 에 대한 질문입니다. 않되네요... <수정..>
<VirtualHost 211.233.37.57>
DocumentRoot /usr/local/apache/htdocs
ServerName clubmo.com
</VirtualHost>
NameVirtualHost 211.233.37.57
<VirtualHost 211.233.37.57>
ServerAdmin info@clubmo.co.kr
DocumentRoot /home/hobby/public_html
ServerName hobby.clubmo.com
ErrorLog logs/hobby_clubmo-error_log
CustomLog logs/hobby_clubmo-access_log common
</VirtualHost>
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#
<VirtualHost 211.233.37.57>
ServerAdmin info@clubmo.co.kr
ServerName *.linkmo.co.kr
DocumentRoot /home/linkmo/public_html/
DirectoryIndex index.php index.html index.htm
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
RewriteEngine On
# for Debug
# RewriteLog "/home/asp/public_html/rewrite.log"
# RewriteLogLevel 9
RewriteRule ^/cgi-bin(/.*)$ /cgi-bin$1 [L,PT]
RewriteRule ^(.*) %{HTTP_HOST}$1
RewriteCond /home/asp/public_html/%{HTTP_HOST} -d
RewriteRule ^(.+) /home/asp/public_html/$1 [s=4,E=VIRTUAL_DO
CUMENT_ROOT:/home/asp/public_html/%{HTTP_HOST}/]
RewriteCond /home/asp/public_html/www.%{HTTP_HOST} -d
RewriteRule ^(.*) http://www.$1
[L,R]
RewriteCond %{HTTP_HOST} !^www\..+$
RewriteCond /home/asp/public_html/www.$2 -d
RewriteRule ^([^.]+.)([^/]+)(.+)$ http://www.$2$3
[L,R]
RewriteCond /home/asp/public_html/$2 -d
RewriteRule ^([^.]+.)([^/]+)(.+)$ http://$2$3
[L,R]
RewriteRule ^([^/]+/)(.*) %{DOCUMENT_ROOT}$2
[s=1]
RewriteCond $1$2 ^.*[^/]$
RewriteCond $1$2 -d
RewriteRule ^(/home/asp/public_html/)(.+[^/])$ http://$2/
[L,R]
RewriteCond $1$2 ^.*[^/]$
RewriteCond $1$2 -d
RewriteRule ^(/home/linkmo/public_html/)(.+[^/])$ http://%{HTT
P_HOST}/$2/ [L,R]
HostNameLookups off
</VirtualHost>
상단처럼 httpd.conf 를 세팅하였습니다..
mod_rewrite 의 세팅은 지리스 님의 세팅법을 보고 배낀거거덩요!~
(지리스님 감사합니다.... 헤헤헤...)
근데 아파치를 리스타팅을 아래 처럼 해보니...
[root@www bin]# ./apachectl restart
./apachectl restart: configuration broken, ignoring restart
./apachectl restart: (run 'apachectl configtest' for details)
요런 메세지가 떠서요
[root@www bin]# ./apachectl configtest
Syntax error on line 969 of /usr/local/apache/conf/httpd.conf:
Invalid command 'RewriteEngine', perhaps mis-spelled or defined by a module not
included in the server configuration
요런 메세지가 뜨네요....
rewrite 모듈을 사용하려면 또 다른 세팅이 필요 한건가요??
RewriteEngine On 에서 에러가 나는것 같은데요....
복잡복잡복잡.......
LoadModule mod_rewrite 모듈경로를 추가해 보세요.
LoadModule mod_rewrite 모듈경로
를 추가해 보세요.
LoadModule mod_rewrite libexec/mod_rewri
LoadModule mod_rewrite libexec/mod_rewrite.so
요렇게 설정을 해줬는데 요기서 에러가 나네요....
libexec 디랙토리에는 아무 파일도 없었어서~
다른곳에 있었던...mod_rewrite.so 파일을
복사해 넣었거든요....
그랬더니...
[root@www bin]# ./apachectl configtest
Syntax error on line 206 of /usr/local/apache/conf/httpd.conf:
Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not inc
luded in the server configuration
에러가 요렇게 나네요.....
앙~~~ 이제 슬슬지처가요....어카죠???
감사합니다.
댓글 달기