Pages

05 November 2009

How to make Linux Debian based as Web Server

If you want to make your linux debian based as Web server, bellow is the way

Installing Apache 

apt-get install apache2

After that , do test HTTP Server:
Open a web browser and enter http://localhost or its IP Address http://ip-address.

Installing PHP

apt-get install php4
/etc/init.d/apache2 restart
vi /var/www/testphp.php

To test it, Insert this following line into testphp.php file.

<?php phpinfo(); ?>
Save this new file.
Open a web browser and enter http://IP-Address/testphp.php .

Install PostgreSQL

apt-get install libapache2-mod-auth-pgsql
apt-get install php4-pgsql
/etc/init.d/apache2 restart

Mapping URLs to folders outside /var/www/

vi /etc/apache2/conf.d/alias

Insert this following line into the new file.

 
Alias /URL-path /location_of_folder/

<directory /location_of_folder/>
   Options Indexes FollowSymLinks
   AllowOverride All
   Order allow,deny
   Allow from all
</Directory>

Save a new file.

Restart Apache
/etc/init.d/apache2 restart

finished :)