Unix/Solaris10

아파치2

ForceCore 2006. 7. 1. 06:39
http://meljr.com/~meljr/apache2_Sol10.html
이곳을 컨닝했다. 솔라리스10에는 이미 설치되어 있으니
단순히 켜기만 한다는 것이 요지.

1. 일단 설정파일을 복사한다.
cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf

2. /etc/apache2/httpd.conf를 적절히 수정한다.

3. svcadm enable apache2
로 서비스 on!

설정이 결국 문제다.

엇? 설정을 하고 나니 아파치가 돌아가고 있지 않다.

xvcadm -x apache2
라고 치면 적절한 정보를 얻을 수 있고, 어느 파일에
로그가 덤프되었는지 알려줄 것이다.

로그를 보니까 설정이 잘못되어 있다 -0-;;
필자가 모르고 ServerRoot를 이상하게 바꿔서 그랬다.
그냥 디폴트로 놔뒀어야 함.

원래 example설정과 필자의 설정이 뭐가 다른지 diff명령어로 확인해보았다.
diff httpd.conf httpd.conf-example

ServerAdmin
ServerName
DocumentRoot
<Directory "/export/http_pub">
<Directory /export/home/*/public_html>
DirectoryIndex index.html index.html.var index.htm

대충 이것들이 바뀌었군.


사용자 디렉토리를 통해 개별적으로
http://xxxyyyzzz/~ID
접근할 수도 있게 설정이 되어있다.
하지만... ~자를 없애고 싶은데 -0-..

http://www.novell.com/coolsolutions/tip/15832.html
이곳을 컨닝하면 httpd.conf에 저것을 적절한 위치에 붙여넣으면 된다고 한다.

<ifModule mod_rewrite.c>
 <ifModule mod_proxy.c>
    RewriteEngine  on

    # Make the needed exceptions

    RewriteCond    %{REQUEST_URI}         ^.*/icons/.*
    RewriteRule    ^(.*)$                 $1           [PT,L]

    RewriteCond    %{REQUEST_URI}         ^.*/error/.*
    RewriteRule    ^(.*)$                 $1           [PT,L]

    # Make /username work, remember: each paren is a $#, sequentially

    RewriteRule    ^/([a-z0-9]+)$         /$1/         [R]
    RewriteRule    ^/([a-z0-9]+)/$        /~$1/        [PT]
    RewriteRule    ^/([a-z0-9]+)/(.*)$    /~$1/$2      [PT]

 </ifModule>
</ifModule>

음... 뜻은 잘 모르겠다 OTL 문법과 저런 ^나 . operator를 통 못알아 듣겠으니 말이다.

Note:세팅이 어딘가 변화 되었을때 svcadm restart명령으로 아파치를 재시작 하면 세팅 변화를 다시 읽지 않으니 disable enable로 재시작 시키라.