
Apache2 서버에 CGI 셋팅
mkdir /var/cgi-bin
and create a file called /var/cgi-bin/echo.pl with the following content:
#!/usr/bin/perl
use strict;
use warnings;
print qq(Content-type: text/plain );
print "hi ";
chomd +x /var/cgi-bin/echo.pl
/var/cgi-bin/echo.pl
Content-type: text/plain
hi
Apache /etc/apache2/sites-enabled/000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
와 같은 형식에 내부에 아래 내용을 추가
ScriptAlias /cgi-bin/ /var/cgi-bin/
<Directory "/var/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
CGI 모듈 활성화
ls -l /etc/apache2/mods-enabled/ | grep cgi
ls -l /etc/apache2/mods-available/ | grep cgi
-rw-r--r-- 1 root root 115 Jul 20 2013 cgid.conf
-rw-r--r-- 1 root root 60 Jul 20 2013 cgid.load
-rw-r--r-- 1 root root 58 Jul 20 2013 cgi.load
-rw-r--r-- 1 root root 89 Jul 20 2013 proxy_fcgi.load
-rw-r--r-- 1 root root 89 Jul 20 2013 proxy_scgi.load
CGI 모듈 링크
ln -s /etc/apache2/mods-available/cgid.load /etc/apache2/mods-enabled/
ln -s /etc/apache2/mods-available/cgid.conf /etc/apache2/mods-enabled/
ls -l /etc/apache2/mods-enabled/ | grep cgi
lrwxrwxrwx 1 root root 37 Mar 19 14:39 cgid.conf -> /etc/apache2/mods-available/cgid.conf
lrwxrwxrwx 1 root root 37 Mar 19 14:39 cgid.load -> /etc/apache2/mods-available/cgid.load
서비스 재 시작
service apache2 reload
Leave Apache2 서버에 CGI 셋팅 to:
Read more #apache posts
Best Posts From skysparrow
We have not curated any of skysparrow's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From skysparrow
- linux iptables 설명
- python kalman filter install / 파이썬 칼만필터 설치 / 라즈베리파이
- [구동확인] RPI-AP Setting / DHCP Setting
- 라즈베리파이 - gpio 설치 / rasberry pi GPIO
- python TG9e 서버모터 구동
- Apache2 서버에 CGI 셋팅
- 파이썬 소켓통신 <=> L3G4200D 자이로센서 값 받기
- [검증완료] GPS-Module GY-GPS6MV2 셋팅 / NEO-6M / GPS 데이터 뽑아쓰기
- 라즈베리파이 해상도 옵션 / rasberry pi resolution option
- 라즈베리파이를 AP 로 / Rasberry Pi for AP (wifi AP)