Linux_ Apache
Wed Aug 14 12:28 Authored by kanto501

Installing on a LAMP  

  1. The first thing you need to do is install the Lamp software. A good tutorial can be found here:How to install a LAMP server
  2. Once you have LAMP set up it is time to install The Bug Genie. In most cases you will want to install the Buggenie in it's own directory under the WWW directory.
    You can use the Bug Genie Root Install Information link for this install.

Installing Linux + Apache + Postgres + Php  
This tutorial shows how you can install an Apache2 webserver on an Ubuntu 12.10 server with PHP5 support (mod_php) and Postgresql support. I do not issue any guarantee that this will work for you!

1 Preliminary Note - In this tutorial I use the hostname with the IP address These settings might differ for you, so you have to replace them where appropriate. I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root:
sudo su
2 Installing Postgresql Make sure you installed python-software-properties
$sudo apt-get install python-software-properties
update your system apt:
$sudo apt-get update
Finally install postgresql-9.1:
$sudo apt-get install postgresql phppgadmin
if you get an error here, make sure you have installed libpq-dev. The libpq-dev package is for compiling wrappers/clients against libpq.
$sudo apt-get install postgresql-9.1 libpq-dev
Now check out if the installation is successful or not.
$ locate postgresql
If done!!!, Cheers ………….. Check the install version.
$psql -V
Now let’s take a look at the postgres console
$su postgres
(a) Setup the Root User ‘postgres’ (or name it something else if you want)
$sudo passwd postgres
give the postgres user a (unix) password,Now we can switch to the user postgres using command
$ su postgres

That’s it for postgres installation. If you want to access postgres remotely, Meaning localhost. You need to perform some addition setting to postgres conf file. First we edit the file postgresql.conf:
$ cd /etc/postgresql/9.1/main
List all files in the main folder
$ ls -la
total 80
drwxr-xr-x 2 postgres postgres 4096 2012-05-17 18:05 .
drwxr-xr-x 3 postgres postgres 4096 2012-04-07 12:44 ..
-rw-r–r– 1 postgres postgres 316 2012-04-07 12:44 environment
-rw-r–r– 1 postgres postgres 143 2012-04-07 12:44 pg_ctl.conf
-rw-r—– 1 postgres postgres 4653 2012-05-17 18:05 pg_hba.conf
-rw-r—– 1 postgres postgres 4649 2012-04-09 19:29 pg_hba.conf.bak.original
-rw-r—– 1 postgres postgres 1636 2012-04-07 12:44 pg_ident.conf
-rw-r–r– 1 postgres postgres 19235 2012-04-07 12:44 postgresql.conf
-rw-r–r– 1 postgres postgres 19235 2012-04-09 19:29 postgresql.conf.bak.original
-rw-r–r– 1 postgres postgres 378 2012-04-07 12:44 start.conf
You need to make a backup of these files now.
$ cp pg_hba.conf pg_hba.conf.bak.original
$ cp postgresql.conf postgresql.conf.bak.original
Make changes to pg_hba.conf (authentification methods). host all all trust # md5 -> trust You make changes in the config file, Then restart your postgres
$sudo /etc/init.d/postgresql restart
  • Restarting PostgreSQL 9.0 database server

3 Installing Apache2

Apache2 is available as an Ubuntu package, therefore we can install it like this:

apt-get install apache2

Now direct your browser to, and you should see the Apache2 placeholder page (It works!):

Click to enlarge

Apache's default document root is /var/www on Ubuntu, and the configuration file is /etc/apache2/apache2.conf. Additional configurations are stored in subdirectories of the /etc/apache2 directory such as /etc/apache2/mods-enabled (for Apache modules), /etc/apache2/sites-enabled (for virtual hosts), and /etc/apache2/conf.d.

4 Installing PHP5

We can install PHP5 and the Apache PHP5 module as follows:

apt-get install php5 libapache2-mod-php5

We must restart Apache afterwards:

/etc/init.d/apache2 restart

5 Testing PHP5 / Getting Details About Your PHP5 Installation

The document root of the default web site is /var/www. We will now create a small PHP file (info.php) in that directory and call it in a browser. The file will display lots of useful details about our PHP installation, such as the installed PHP version.

vi /var/www/info.php

<?php phpinfo(); ?>

Now we call that file in a browser (e.g.

Click to enlarge

As you see, PHP5 is working, and it's working through the Apache 2.0 Handler, as shown in the Server API line. If you scroll further down, you will see all modules that are already enabled in PHP5. MySQL is not listed there which means we don't have MySQL support in PHP5 yet.



Attachments 0

Comments 0

Expand, collaborate and share
Post a comment and get things done