Install Apache Web Server on Ubuntu 9.10

This step-by-step howto shows a basic setup for Apache 2 web server. Apache is installed on Ubuntu 6.06 LTS Dapper, but instructions will probably work on any Ubuntu. This document is a work in progress, initially only required commands are listed without troughout explanations.
Install Apache
$ sudo apt-get install apache2
Test it
Surf to your own server on your own local computer:
$ firefox “http://localhost”

Install MySQL Server 5 on Ubuntu 9.10

Installing MySQL 5 Server on Ubuntu is a quick and easy process. It almost feels like it should be more difficult.

Open a terminal window, and use the following command:
sudo apt-get install mysql-server
If you are running PHP you will also need to install the php module for mysql 5:
sudo apt-get install php5-mysql
To create a new database, use the mysqladmin command:
mysqladmin create

Get Current URL


The PHP super global $_SERVER contains all the information you need to access various information about the URL and can even carry variables. Often you need to get the full URL of the page you are on and this requires piecing together several of the $_SERVER variables to get the whole URL.

Sometimes, you might want to get the current page URL that is shown in the browser URL window. For example if you want to let your visitors submit a blog post to Digg you need to get that same exact URL. There are plenty of other reasons as well. Here is how you can do that.
Add the following function to a page:
<?php
function currentPageURL()
{
$pageURL = $_SERVER['HTTPS'] == ‘on’ ? ‘https://’ : ‘http://’;
$pageURL .= $_SERVER['SERVER_PORT'] != ‘80′ ? $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"] : $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
return $pageURL;
}
?>

OR

<?php
function currentPageURL()
{
$pageURL = ‘http’; if ($_SERVER["HTTPS"] == “on”)
{
$pageURL .= “s”;
}
$pageURL .= “://”; if ($_SERVER["SERVER_PORT"] != “80″)
{
$pageURL .= $_SERVER["SERVER_NAME"].”:”.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else
{
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>


You can now get the current page URL using this:
<?php
echo currentPageURL();
?>

OR

<?php
function getCurrentAddress()
{
/* check for https */
$protocol = $_SERVER['HTTPS'] == ‘on’ ? ‘https’ : ‘http’;
/* return the full address */
return $protocol.’://’.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
}
/* How to Use */
echo getCurrentAddress();
?>
For current page name use the below code of lines:
<?php function currentPName()
{
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],”/”)+1); }
echo “The current page name is “.currentPName();
?>

Install Google Chrome In Ubuntu

How to install google chrome using wine .Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all Internet users to experience the web. The Chromium codebase is the basis for Google’s Chrome browser.
First you can use this tutorial to install chromium in Ubuntu using PPAs and after that you can try any one of the following methods.

First you need to download .deb package from here using the following command
wget http://media.codeweavers.com/pub/crossover/chromium/cxchromium_0.9.0-1_i386.deb

Now you have cxchromium_0.9.0-1_i386.deb package install this package using the following command
sudo dpkg -i cxchromium_0.9.0-1_i386.deb

Using Ubuntu PPA
First you need edit /etc/apt/sources.list file
gksudo gedit /etc/apt/sources.list

For ubuntu 9.10 (Karmic) Users add the following two lines
deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main

save and exit the file

Now add the GPG key using the following command
sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5
or For karmic users use the following command
sudo add-apt-key ppa:chromium-daily/ppa

Update source list
sudo apt-get update

Install chromium browser using the following command
sudo apt-get install chromium-browser
This will complete the installation

Recursive Permission Changes

To change the permissions of multiple files and directories with one command. Please note the warning in the chmod with sudo section and the Warning with Recursive chmod section.

Recursive chmod with -R and sudo

To change all the permissions of each file and folder under a specified directory at once, use sudo chmod with -R

user@host:/home/user$ sudo chmod 777 -R /path/to/someDirectory