rosh@rosh-desktop:~$ sudo apt-get install postgresql
Make a dicrectory to keep db sources (You don't have to have same path and directory name as I have):rosh@rosh-desktop:~$ mkdir /usr/local/pgsql/data
Change the owner of directory:rosh@rosh-desktop:~$ chown postgres /usr/local/pgsql/data
Also, you can change both the owner and the group information of 'data' directory if you want or need:rosh@rosh-desktop:~$ chown postgres:postgres /usr/local/pgsql/data
Switch user to postgres:rosh@rosh-desktop:~$ su - postgres
Initialize the DB server:postgres@rosh-desktop:~$ /usr/lib/postgresql/8.3/bin/initdb -D /usr/local/pgsql/data
Create new DB (You can pick any db name instead of using 'db'):postgres@rosh-desktop:~$ /usr/lib/postgresql/8.3/bin/createdb db
Create new user (You can pick any user name instead of using 'user'):postgres@rosh-desktop:~$ createuser -U postgres -d -P user
Exit from the DB and run it:: postgres@rosh-desktop:~$ exit
rosh@rosh-desktop:~$psql -s db
-s(--single-step): Run in single-step mode. That means the user is prompted before each command is sent to the server, with the option to cancel execution as well. Use this to debug scripts.
createuser-d(--createdb): The new user will be allowed to create databases.
-P(--pwprompt): If given, createuser will issue a prompt for the password of the new user. This is not necessary if you do not plan on using password authentication.
-U(--username): User name to connect as (not the user name to create).
rosh@rosh-desktop:~$ sudo apt-get install apache2
If you are running PHP you will also need to install the php and php module for apache:rosh@rosh-desktop:~$ sudo apt-get install libapache2-mod-php5
rosh@rosh-desktop:~$ sudo apt-get install php5
Then, restart the service.rosh@rosh-desktop:~$ sudo /etc/init.d/apache2 restart
Done!
rosh@rosh-desktop:~$ sudo apt-get install mysql-server
If you are running PHP you will also need to install the php module for mysql:rosh@rosh-desktop:~$ sudo apt-get install php5-mysql
Done!