[완료] fedora apache 로 웹서버 구축 초기 질문 입니다.

yukani의 이미지

fedora 에서 아파치를 설치후

http://localhost/ 혹은 http://IP주소/로

Index.php 파일은 잘 보여집니다.

main.html 파일을 만들어서,

http://IP주소/main.html로 외부에서 접근 해도 잘들어 가집니다만...

1.jpg 로 그림파일을 하나 복사해서 index, main 파일이 있는 홈폴더에 넣었습니다.

그후 http://IP주소/1.jpg 로 접근을 하면, 외부에서든 내부에서든 전부

Forbidden you don't have permission to access/1.jpg on this server. 이라고 나옵니다.

그림파일을 웹으로 띄우고 싶습니다.(윈서버에서는 홈폴더에 그림을 넣으면 주소에/그림이름을 치면 그림이 띄워지거나, 파일을 올리면 파일이 다운 받을수 있엇는데, 리눅스에서도 그렇게 하고싶습니다.)

1.jpg에 소유자는 root로 index,main과 같고 퍼미션은 777로 되어있습니다.

index, main은 접근이 가능하기에 홈폴더 권한 문제도 아닌것 같습니다. 755로 되어있습니다.

파일에 대한 권한은 아닌것 같습니다.

혹시 아시는분 계시다면 답변 주시면 감사하겠습니다.

ydhoney의 이미지

http://www.google.co.kr/search?q=%22Forbidden+you+don%27t+have+permission%22

/var/log/messages

아파치의 error.log

정도를 다시 한번 확인해 보세요.

allowoverride 문제일수도 있고..하여간 로그랑 설정을 좀 보셔야 할 듯.

yukani의 이미지

messages.log 의 해당 1.jpg로 접근시 로그 입니다.
localhost setroubleshoot: SELinux is preventing /usr/sbin/httpd "read" access on 1.jpg. For complete SELinux messages. run sealert -l 53e3d300-214a-4ec5-8808-7a5bcc6a67af

httpd/error.log 의 해당 1.jpg로 접근시 로그 입니다.
[error] [client 210.x.x.x] (13)Permission denied: file permissions deny server access: /var/www/html/1.jpg

httpd.conf 에서 AllowOverride 검색시

AllowOverride None으로 나옵니다. (5개)

이렇게 나오는데 어떻게 해결하면 좋을까요?
혹시 더 필요한 설정이 있으시다면 알아보겠습니다.

yukani의 이미지

확인을 해보았습니다만 저의 실력으로 해결책을 찾기가 힘드네요.
한번 봐주시기를 바랍니다.

messages.log 의 해당 1.jpg로 접근시 로그 입니다.
localhost setroubleshoot: SELinux is preventing /usr/sbin/httpd "read" access on 1.jpg. For complete SELinux messages. run sealert -l 53e3d300-214a-4ec5-8808-7a5bcc6a67af

httpd/error.log 의 해당 1.jpg로 접근시 로그 입니다.
[error] [client 210.x.x.x] (13)Permission denied: file permissions deny server access: /var/www/html/1.jpg

httpd.conf 에서 AllowOverride 검색시

AllowOverride None으로 나옵니다. (5개)

ydhoney의 이미지

selinux를 끄면 되겠네요.

yukani의 이미지

selinux를 끄니 되네요.
정말 감사합니다.
혹시 selinux를 끄지 않고도 설정을통해 가능한 방법이있나요?
selinux에 대해 자세히 알지 못해서
이게 실행이 되지않으면 보안상 안좋은것 인가요?

ydhoney의 이미지

selinux를 일일이 만져대는 노동때문에 벌어지는 서비스 차질 및 보안상의 크리티컬이 더 클겁니다.

보통 일반적으로 selinux를 끕니다. selinux를 제대로 만질 줄 아는 사람이 얼마 되지도 않구요. 무슨 미 국방성 납품할때나 좀 쓰면 되지 일반적인 경우까지 selinux를 적용할 필요는 없을겁니다.

yukani의 이미지

자세한 답변 감사드립니다 ^^

댓글 달기

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