본문 바로가기

Coding

CGI Setting

Install FastCGI with PHP in Apache on CentOS 6


Step 1: Install Packages

First step is make sure we have the required packages installed. Assuming you already have the PHP module installed, we’ll just need to install a couple of extra packages:

Step 2: Create Execution Environment

Create a fastcgi-bin directory, copy php-cgi and ensure file permissions are correct.

Step 3: Configure Apache

By following the following steps, we’re not globally setting PHP to be handled php FastCGI. We’ll only be configure a single virtual host to use FastCGI to handle PHP.

Paying specific attention to the following:

Step 4: Restart Apache

Before restarting Apache we should quickly test the config for any errors:


test.cgi 작성 후 테스트 (실행권한 줘야 함) Ex, http://x.x.x.x/cgi-bin/test.cgi
#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "<HTML><HEAD><TITLE>CGI TEST</TITLE></HEAD>\n";
print "<BODY BGCOLOR=FFFFFF>\n";
print "<CENTER><H1>THIS IS A TEST PAGE</H1>\n";
print "</CENTER>";
print "</BODY></HTML>\n";
exit;


'Coding' 카테고리의 다른 글

색을 랜덤하게 뽑아서 출력합니다.  (0) 2017.01.07
php predefined variables  (0) 2017.01.06
주민번호 생성원리  (0) 2017.01.06
Vi(m) 사용시 ^M 없애기  (0) 2017.01.06
쉘프로그래밍 문법  (0) 2017.01.06