‘ WEB SERVER ‘

[1] Install Apache2, and in addition to it, Install PHP too.
www:~#

aptitude -y install apache2 php5 libapache2-mod-php5 php5-common php-pear

www:~#

ln -s /usr/bin/perl /usr/local/bin/perl
[2] Configuration Apache2
www:~#

vi /etc/apache2/apache2.conf

ServerTokens

Prod
// line 214: change

ServerSignature

Off
// line 224: change

AddHandler cgi-script .cgi

.pl
// line 512: add type for CGI
DirectoryIndex index.html index.cgi index.php

// bottom: add file type

www:~#

a2dissite default

Site default disabled; run /etc/init.d/apache2 reload to fully disable.
www:~#

cp /etc/apache2/sites-available/default /etc/apache2/sites-available/debian

www:~#

vi /etc/apache2/sites-available/debian

ServerAdmin

webmaster@server-linux.info
// line 3: change address

DocumentRoot

/var/www/html/
// line 5: change document root

<Directory

/var/www/html/

>

// line 10: change

Options

FollowSymLinks ExecCGI
// line 11: change

AllowOverride

All
// line 12: change
#

RedirectMatch ^/$ /apache2-default/

// line 17: make it comment

ServerSignature

Off
// line 35: change

www:~#

mkdir /var/www/html

www:~#

a2ensite debian

Site debian installed; run /etc/init.d/apache2 reload to enable.
www:~#

/etc/init.d/apache2 restart

Forcing reload of web server (apache2)….

[3] Make HTML test page and make sure apache is working normally. It’s OK if following screen is shown.
www:~#

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 make sure apache is working normally. It’s OK if following screen is shown.
www:~#

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;

www:~#

chmod 705 /var/www/html/index.cgi

[5] Make PHP test page and make sure apache is working normally. It’s OK if following screen is shown.
www:~#

vi /var/www/html/index.php
<html>
<body>
<div style=”width:100%;font-size:40px;font-weight:bold;text-align:center”>
<?php

print Date(“Y/m/d”);

?>
</div>
</body>
</html>

About muzayyanah

apa adanya " be your self "
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s