Fedora 14
Sponsored Link

Install/Configure httpd
2010/11/06
  Install httpd and Configure Web Server.

[1] Install httpd
[root@www03 ~]#
yum -y install httpd


# remove test page

[root@www03 ~]#
rm -f /etc/httpd/conf.d/welcome.conf

# remove test page

[root@www03 ~]#
rm -f /var/www/error/noindex.html

# create a link for Perl

[root@www03 ~]#
ln -s /usr/bin/perl /usr/local/bin/perl

[2] Configure httpd.
[root@www03 ~]#
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@srv.world


# line 276: server's name

ServerName
www03.srv.world:80


# line 331: change (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 759: make it comment

#
AddDefaultCharset UTF-8

# line 796: uncomment and add file-type that apache looks them CGI

AddHandler cgi-script .cgi
.pl


[root@www03 ~]#
/etc/rc.d/init.d/httpd start

Starting httpd:
[ OK ]

[root@www03 ~]#
chkconfig httpd on

[3] Make HTML test page and access to it with web browser. It's OK if following page is shown.
[root@www03 ~]#
vi /var/www/html/index.html


<html>
<body>
<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">
Test Page
</div>
</body>
</html>
[4] Make CGI test page and access to it with web browser. It's OK if following page is shown.
[root@www03 ~]#
vi /var/www/html/index.cgi


#!/usr/local/bin/perl

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


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

Matched Content
 
Tweet