Java CGI Tomcat Apache PHP MSQL on Ubuntu Easy Steps

Instead of giving introduction and speeches i would love to tell u only the steps
P.S : You have to be the root while executing the commands mentioned below

LAMP

1. apt-get update
2. sudo apt-get install apache2 php5 mysql-server-5.0 phpmyadmin
3. Wait till its done
4. sudo gedit /etc/apache2/apache2.conf
5. The step 4 will open a text file for you
6. Paste the below to the end of the file ,save and exit

# Enable PHPMyAdmin
Include /etc/phpmyadmin/apache.conf

7. sudo /etc/init.d/apache2 restart

Check if you where right till now :
http://127.0.0.1 ===>webpages
http://127.0.0.1/phpmyadmin ====>database administration

if(working)

CGI

1. sudo aptitude install libapache2-mod-perl2
2. sudo rm -r /usr/lib/cgi-bin
3. sudo mkdir /var/www/cgi-bin (if it fails use -p option)
4. cd /usr/lib/
5. sudo ln -s /var/www/cgi-bin/ cgi-bin

Check if you where right till now :
1. cd /var/www/cgi-bin
2. sudo gedit test.pl (a text file opens)
3. Paste the below ,save and exit

#!/usr/bin/perl -w
print "Content-type: text/html\r\n\r\n";
print "I love Linux\n";

4. sudo chmod a+x test.pl
5. Goto localhost/cgi-bin/test.pl in a browser

It must say I love Linux

Thats it :) Enjoy Programing :) Share this