아파치의 DocumentRoot가 이상합니다....

jeje119의 이미지

안녕하세요
얼마전 데비안을 처음 접한 초보입니다.

다름이 아니라 리눅스 설치시에 아파치도 같이 설치되었는데요.
아파치의 DocumentRoot디렉토리가 /var/www/ 로 되어있습니다.
(phpinfo()로 확인했습니다)
그런데 실제 localhost로 접속해보면 /var/www/apache2-default/라는 디렉토
리 아래의 Index.html을 읽더라구요.. 셈플파일들도 다 그곳에 있구요..

그래서 apache2-default 디렉토리를 지우고 /var/www/index.html을 만들어서
접속해보니 apache2-default라는 디렉토리를 못찾는다는 에러가 나옵니다.

아무리 찾아바도 왜 apache2-default라는 폴더를 찾는지 알수가 없네요..
어디서 설정되어 있는지도 모르겠구요..

전 꼭 DocumentRoot를 /var/www/로 썼으면 하거든요..

혹시 알고 계신분 있다면 설명부탁드리겠습니다..

감사합니다.

codebank의 이미지

phpinfo를 보실 수 있다면 apache2handler의 설정값을 보세요.
Server Root라는 항목이 있습니다.
그곳에보면 conf라는 디렉토리가 있습니다.
그안에 httpd.conf(or apache2.conf, commonapache2.conf)를 보실 수 있을겁니다.

파일을 열면 DocumentRoot를 설정하는 곳이 있습니다. 그곳을 원하는 곳으로 바꾸어
주면 됩니다.
또한 Directory라는 섹션들을 보시면 그것이 어느 파일들을 지정하는것인지도 볼 수
있습니다.
그 값들은 http://oops.org/?t=lecture&sb=apache&n=2 이 사이트를 보시면
무엇을 해야할지 아실 수 있을겁니다.

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

jeje119의 이미지

아 아까 제 질문에 답해주신 분이군요?
계속해서 도움을 주셔서 정말 감사합니다.

제가 글을 올리기전에 ServerRoot의 apache.conf파일을 확인해 보았습니다.
DocumentRoot에 대한 내용이 없어서 /var/www로 추가해 주었지만 마찬가지 입니다.

어 그러니까 정확히 문제가 어떤것이냐 하면요..
실제 DocumentRoot의 값은 /var/www가 맞습니다.
www폴더 아래에 Index.html을 만들어 "http://localhost/index.html" 으로 열어보면 열립니다.. 그러니까 Root의 값은 /var/www/가 맞는것이겠죠..

그런데 "http://localhost/" 이렇게 열라고하면 주소창이 "http://localhost/apache2-default/" 이렇게 변하면서 apache2-default폴더가 없다고 에러가 납니다...-_-;;

아마도 그냥 주소로 접근할때에 /apache2-default/아래로 자동으로 옮겨주는 옵션이 있는것 같습니다. 먼지는 몰겠지만요 @.@

그냥 주소로 접근할때에도 /var/www/아래에 있는 Index.html을 읽도록 하고 싶습니다... ^^;;

nohmad의 이미지

제 데비안(시드) 설정을 참고하세요.

kaos:/etc/apache2# grep -Ir 'apache2-default' /etc/apache2/
/etc/apache2/sites-available/default:                # in /apache2-default/, but still have / go to the right place
/etc/apache2/sites-available/default:           # RedirectMatch ^/$ /apache2-default/
/etc/apache2/sites-enabled/000-default:                # in /apache2-default/, but still have / go to the right place
/etc/apache2/sites-enabled/000-default:         # RedirectMatch ^/$ /apache2-default/

RedirectMatch가 주석 처리 되어 있는 거 보이시죠? :)

jeje119의 이미지

휴~ 또한가지 문제가 바로 해결됐습니다.

점점 리눅스컴이 모양을 갖춰가네요 ^^;;

두분 정말 감사합니다. 꾸벅~

좋은 하루 되세요...

댓글 달기

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
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.