fedora linux를 처음설치할때 기본으로 httpd,mysql,php 를 설치했을경우는 별도의 설정이 필요없습니다. mysql DB생성과 사용자를 인식하게 두가지만 설정해주면 됩니다.

처음설치에 포함안되있다면
아파치 서버 인스톨을 합니다.
apache1.x. 버젼과 달리 2.x.x버젼에서는 httpd라는 이름을 가지게 됩니다.

 - install httpd
아파치가 설치되있는지 알아봅니다. 
[root@www ~]# rpm -qa | grep httpd 
 아무것도 안나오면 설치되지 않은겁니다. 인제 설치합니다.

#설치 
[root@www ~]# yum -y install httpd

 # 테스트 페이지를 삭제합니다.
[root@www ~]# rm -f /etc/httpd/conf.d/welcome.conf
[root@www ~]#
rm -f /var/www/error/noindex.html

#Perl 링크를 만들어줍니다.
[root@www ~]#
rm -f /user/bin/perl /user/local/bin/perl

 - httpd 설정 http버젼에 따라 줄이 다를수 있지만 찾아보면 다 나옵니다.
설정파일을 vi,vim으로 열어줍니다.루트 사용자로..
[root@www ~]# vi /etc/httpd/conf/httpd.conf

# line 44: change
ServerTokens Prod

# line 76: change to ON
KeepAlive On

# line 262: Admin's address - 이메일주소변경
ServerAdmin root@jabcholove.tistory.com

# line 276: change to your server's name - 서버이름변경 없으면 localhost
ServerName www.jabcholove.com:80

# line 331: change (enable CGI and disable Indexes)
Options FollowSymLinks ExecCGI

# line 338: change
AllowOverride All

# line 402: add file name that it can access only with directory's name
DirectoryIndex index.html index.cgi index.php

# line 536: change
ServerSignature Off

# line 796: uncomment and add file-type that apache looks them CGI
AddHandler cgi-script .cgi .pl .php

#아파치웹서버를시작합니다.
 
[root@www ~]# /etc/rc.d/init.d/httpd start 
Starting httpd (via systemctl): Starting httpd: [ OK ]

[ OK ]
[root@www ~]# chkconfig httpd on 



- test 페이지 만들고 확인하기.

[root@www ~]# 
vi /var/www/html/index.html
<html>
<body>
<div style="width: 100%; text-align: center;">
teststssssssssssssssssssssssssssssssssssssssttttttttt+_+ 
</div>
</body>
</html>

흰패이지로 나오면 권한부여해줘본다.
[root@www ~]# chmod 705 /var/www/html/index.html
 


 Cgi 테스트 페이지만들고 웹브라우져로 확인하기
[root@www ~]# vi /var/www/html/index.cgi



#!/usr/local/bin/perl

print "Content-type: text/html\n\n";
print "<html>\n<body>\n";
print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n";
print "CGI Test Page";
print "\n</div>\n";
print "</body>\n</html>\n";




[root@www ~]# chmod 705 /var/www/html/index.cgi
 


+ Recent posts