Ubuntu : installing Apache, PHP, MySQL, PostgreSQL

I have been installing above packages time to time, but because of I’m lack in memory, I have to search google again and again to find out the installation instructions :-).Yes, it is a simple apt-get install stuff, but think there are few additional things to remember, so I’m writing down them here.

Apache 2 First

user@server:~$ sudo apt-get install apache2

After the installation, create a configuration file for apache, to find out its Fully Qualified Domain Name (FQDN).Otherwise apache will complain you each time you restart it.

To do that, simply create a file as follows.

user@server: $ sudo vim /etc/apache2/conf.d/fqdn

Then enter following line in the newly created file.

ServerName localhost

Restart apache and it is done.

keerthi@lapi: $ sudo /etc/init.d/apache2 restart

PHP 5 Next

user@server: $ sudo apt-get install php5

MySQL Server with Apache and PHP Modules.

user@server: $ sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql php5-pgsql

PostgreSQL Installation

user@server: $ sudo apt-get install postgresql

This will install the postgres server on your machine. Then install the PgAdmin 3.

user@server: $ sudo apt-get install pgadmin3

Create a super user for Postgres, then you can manage your server through PgAdmin easily.

First switch to “postgres” user. Then use createuser util to create new user. Remember my new admin user name is ‘root’ and it has nothing to do with Linux root user.

user@server: $ sudo su postgres

postgres@server:/home/user$ createuser root -s -P

(-s for create a super user and -P for prompt the password for new user)

Now open PgAdmin 3 and connect to the server by using new user.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s