Thursday, February 22, 2007

Installing Apache2 web server with php4 and php5 support in Ubuntu

Apache HTTP Server is a free software/open source web server for Unix systems, Microsoft Windows, Novell NetWare and other platforms.It is also supported by several graphical user interfaces (GUIs) which permit easier, more intuitive configuration of the server.

Install apache2 in Ubuntu server

sudo apt-get install apache2 apache2-common apache2-mpm-prefork apache2-utils ssl-cert


This will complete the installation of apache2 web server and now you need to know where the configuration files and document root for your apache web server.


By default all your configuration files are located at /etc/apache2


Default document root for apache2 is /var/www.If you want to change the default document root you need to edit the /etc/apache2/sites-available/default file and look for this line “DocumentRoot /var/www/” here you can change where ever you want to change.For example if you want to change /home/wwww the above line looks like this “DocumentRoot/home/www/”.


The main configuration file located at /etc/apache2/apche2.conf.


By default, Apache2 to Listen on port 80. If this is not desired, please edit /etc/apache2/ports.conf as desired.after changing you need restart apache server.


For example if you want to change your apache webserver port to 78 you need to edit /etc/apache2/ports.conf


sudo nano -w /etc/apache2/ports.conf


Look for the following line

Listen 80

Replace with the following line

Listen 78

Save the edited file

sudo /etc/init.d/apache2 restart


Installing php and cgi support for apache2 in Ubuntu


you need to enable universe source list in your sources.list file


For php4 support


sudo apt-get install libapache2-mod-php4 php4-cli php4-common php4-cgi


For php5 support


sudo apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi


Next we edit /etc/apache2/apache2.conf file and check the index files are correct


DirectoryIndex index.html index.cgi index.pl index.php index.xhtml


If you want to enable some Apache modules (SSL, rewrite, suexec, and include)


sudo a2enmod ssl


sudo a2enmod rewrite


sudo a2enmod suexec


sudo a2enmod include


Restart Apache to make sure all is well.


sudo /etc/init.d/apache2 restart


Test your apache Server


You can access you apache using http://yourserverip/apache2-default/ it should appear the following screen


Test apache2 with PHP Support


To test php4 installed correctly or not create a test file using the following command

sudo nano /var/www/example.php

Insert the following line into the new file

Save this file

Now access this page http://yourserverip/example.php you should see the following screen


Sunday, January 28, 2007

upgrade ubuntu dapper to ubuntu edgy

Upgrading Ubuntu Dapper from ubuntu Edgy will takes a little time.I have tested it and It is working good for me.

If you are ready to take the plunge, run this command from a terminal or run box:

Run this command on the terminal:

gksu "update-manager -c -d"

A window Will Open like below:



Now Press Upgrade




You will see the progress dialog:



The upgrade process will determine all the packages required, and then prompt you again to click Start Upgrade (makes you wish there was a flag that says ” really upgrade me silently ” )




On my machine, I received this message, and I clicked the remove button, but you can skip the step if you are worried about it.



That’s all.You will be prompted to reboot the computer, at which point you will see that you are running Edgy Eft, and you will notice that your Firefox has been upgraded to the beta of Firefox 2.0

Here’s a another quick way to do it :

Goto terminal ( From Desktop, goto Applications->Accessories->Terminal )

user@desktop:~$ sudo sed -e 's/dapper/ edgy/g' -i /etc/apt/sources.list
user@desktop:~$ sudo apt-get update
user@desktop:~$ sudo apt-get dist-upgrade

Then lay back while your distro upgrades itself.