mod_rewrite 에 대한 질문입니다. 않되네요...

i09000의 이미지

<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 모듈을 사용하려면 또 다른 세팅이 필요 한건가요??

codebank의 이미지

에러내용은 mod_rewrite때문에 발생한게 아닌것 같아보입니다.
httpd.conf 52라인에 무엇이 있는지 모르겠는데 아마 ServerType이라는 항목 같은데
그부분이 문제인것 같네요.

------------------------------
좋은 하루 되세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.