윈도우 아파치 + python .py 파일 작동 > 윈도우

본문 바로가기

회원로그인

회원가입

윈도우

윈도우 아파치 + python .py 파일 작동

페이지 정보

profile_image
작성자 최고관리자
댓글 0건 조회 73회 작성일 22-08-16 14:53

본문

http.conf

1. 모듈 주석 풀기

LoadModule cgi_module modules/mod_cgi.so


2. DocumentRoot 에서, <Files ~~ 추가하기

<Directory "d:/www">

    <Files "*.py">
        Options ExecCGI
        AddHandler cgi-script .py
    </Files>   
 

</Directory>


3. httpd 재시작하기


4. sample.py

=============================================

#!python

print("content-type:text/html; charset=utf-8\n")
print("aaa")

=============================================


5. 브라우저로 접속확인하기

http://localhost/sample.py


댓글목록

등록된 댓글이 없습니다.