채택완료

리눅스 index.html는 뜨는데 index.php가 접속이 안됩니다.

2016-02-13 (토) 07:22:11 6,707

index.html는 뜨는데 index.php페이지로 접속하면 아래처럼 나옵니다. 

퍼미션 변경해봐도 마찬가지고, 이리저리 해보다가 index.html를 올려보니까 index.html은 멀쩡하게 뜹니다.

 

php 파일은 모두 아래처럼 나옵니다.

 

Forbidden

You don't have permission to access / on this server.

httpd.conf 파일인데 어떻게 수정해야 하나요? 

    #AddType application/x-gzip .tgz

    #

    # AddEncoding allows you to have certain browsers uncompress

    # information on the fly. Note: Not all browsers support this.

    #

    AddType application/x-httpd-php .php .php3 .inc .asp .html

   # AddType application/x-httpd-php .php .htm .html

    AddType application/x-httpd-php-source .phps

    #

    # If the AddEncoding directives above are commented-out, then you

    # probably should define those extensions to indicate media types:

    #

    AddType application/x-compress .Z

    AddType application/x-gzip .gz .tgz


답변 2개 / 댓글 5개

채택된 답변
+20 포인트

혹시 ssl적용하셨나요?

그랬다면 포트넘버까지 url에 적용하지 않아 그런 에러메시지가 뜰 수도 있습니다.

답변에 대한 댓글 4개

2016-02-13 (토) 08:49:43
설치를 임대 업체에서 해준건데요 전에꺼는 이런문제가 없었는데 이번꺼는 이러네요

80포트 말씀하시는건가요?
2016-02-13 (토) 08:58:30
80포트는 디폴트로 주어진거니 그건 필요없구요,
웹호스팅의 경우 ssl신청하면 그곳에서 부여하는 포트넘버가 있습니다.
그걸 얘기하는 겁니다.
ssl적용하지 않으셨다면 이 문제는 아닌 듯 하구요...ㅎ
2016-02-14 (일) 03:45:56
DocumentRoot /home/aaa
<Directory "/home/aaa">
Options FollowSymLinks
DirectoryIndex index.php index.html index.htm index.jsp *.jsp *.php
AllowOverride None
Order deny,allow
Allow from all
</Directory>

DirectoryIndex index.php index.html index.htm index.jsp *.jsp *.php
httpd.conf 파일 하단에 이부분을 추가하니 정상적으로 접속이 되는데 이렇게 사용해도 되는건가요?
2016-02-15 (월) 13:07:27
네 그렇게 설정하시면 되겠네요.
잘되신다니 도움이 되어 드리지 못했지만 다행입니다 ㅎㅎ

지금 나오는 것은 퍼미션 에러인데요.. 

디렉토리 퍼미션을 변경 해야 해요.

아니면 방화벽

일단  php 코드 인식하려면 아래와 같이 하면 되요.

그런데 php 코드는 안해도 인식 될 텐데요.

AddType application/x-httpd-php .php .js .html .htm


답변에 대한 댓글 1개

2016-02-13 (토) 08:45:52
퍼미션 변경은 해봤어요 다 좁속이 안되는게 아니고 html은 접속이 되는데 php는 퍼미션 설정을 따로줘야 허나요?

답변을 작성하려면 로그인이 필요합니다.