perl 설정에 관하여

koku_ma의 이미지

Perl로 짜진 소스가 있어서 어쩔 수 없이 perl을 사용하려 합니다.
레드헷 리눅스 7.3을 설치할 때 웹서버 설치를 선택해서 리눅스가 설치될때 아파치도 같이 설치가 되었습니다.

# perl -v 이케 하면 버젼 5.6.1 이라고 나옵니다.

/etc/httpd/conf/httpd.conf 파일의

<IfModule mod.per.c>
Alias /perl /var/www/perl
<Directory /var/www/perl>
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
</Driectory>
</IfModule>

이 부분의 주석을 풀고
perl을 테스트 하기 위하여 hello.pl을 만들고
/var/www/perl 이 디렉토리 밑에 hello.pl을 두었습니다.

물로 hello.pl 은 잘 돌아 갑니다.

문제는 /var/www/perl 이 디렉토리 안에 test.html 파일을 만들어 두고 브라우저에서 확인을 하니

Forbidden
You don't have permission to access /perl/test.html on this server.

이런 에러가 납니다.
혹 퍼미션 문제인가 해서 chmod 777 /var/www/perl/test.html 했습니다.
그랬더니

An error occured while loading http://203.241.56.139/perl/test.html:
Connection to host 203.241.56.139 is broken

이렇게 에러가 납니다.

원래 perl 파일과 html 파일을 같은곳에 둘 수 없는 것입니까?
아니면 따로 설정파일을 수정하여야 합니까?

cjh의 이미지

위처럼 하면 Directory 지시어 때문에 해당 디렉토리의 모든 파일에 지정한 핸들러가 걸립니다.

.pl에 대해서만 FilesMatch 지시어를 쓰도록 하는게 좋을것 같네요.

--
익스펙토 페트로눔

koku_ma의 이미지

죄송한데요.

FilesMatch 지시어를 사용하는 방법을 모르겠습니다.

<Directory /var/www/perl>
<FilesMatch ".(pl)$">
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
Order allow,deny
Allow from all
</FilesMatch>
</Driectory>

이렇게 바꾸어 보았는데 결과는 똑같습니다.

FilesMatch 지시어를 어떻게 사용 하는지 가르쳐주시면 감사하겠습니다.

koku_ma의 이미지

도움부탁드립니다.

koku_ma의 이미지

# 특정 디렉토리에서 확장자가 .pl로된 파일만 골라서 perl 컴파일러로 넘김
    <Directory /var/www/html/blast>
        <FilesMatch ".(pl)$">
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
        </FilesMatch>
    </Directory>
    
# 특정 디렉토리 밑의 모든 파일을 perl 컴파일러로 넘김
    <Directory /var/www/html/blast>
        SetHandler perl-script
        PerlHandler Apache::Registry
        Options ExecCGI
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    
# 모든 디렉토리의 .pl 파일을 perl 컴파일러로 넘김
    <FilesMatch ".(pl)$">
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options ExecCGI
    Allow from all
    </FilesMatch>

이런식으로 해서 성공은 했습니다.

그런데 몇가기 옵션 중 궁굼한게 있는데요.

AllowOverride None 이 옵션이 뭐하는 옵션인지요?

FollowSymlinks과 MultiViews 이 옵션은 뭐하는 옵션인가요?

PerlSendHeader On 이건 또 무슨 옵션 인가요?

gilsion의 이미지

Document 를 보시고 예시를 보시는게 더 이해가 빠르시겠네요

http://search.apache.org/index.cgi?query=FollowSymlinks&what=docs1&brief=1&submit=Search%21

등등 검색하시면 줄줄 나옵니다.

댓글 달기

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