Configuring Apache with SSL

Apache is the most common web server used now a days, you would have already configured apache many times by now but what about configuring it with SSL i.e. using apache to service on the https protocol, i assume you have already configured the basic apache server and have also enabled the SSL module, if not refer to my previous post on Configuring Apache Web server.

The following post is an extremely simplified step by step guide to configure SSL in apache using Self Signed Certificates you can also use a real certificate issued by a CA if you have it

Prerequisites

1) Apache with SSL module enabled
2) openssl installed

Step 1) Generate a Private Key

We will use the openssl toolkit for generating a RSA Private Key and Certificate Signing Request, as the first step generate the key the command below will create a 1024bit key using 3des

Configuring BSNL EVDO Modem in Debian GNU/Linux

EVDO DeviceI recently shifted to Debian GNU/Linux (Lenny), and the first task included configuring my Internet Connection, i use BSNL EVDO Modem to connect to the internet which is not recognized my default in Debian so following is the process by which i configured my BSNL EVDO in Debian

Step 1) Checked for Modem, Vendor and Product ID

$ cat /proc/bus/usb/devices

You will find many entires in this just check for your modem entry in my case i found

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=fffe Rev= 0.00
S:  Manufacturer=ZTE, Incorporated
S:  Product=ZTE CDMA Tech

by this i know the following information

Whats in your MBR ??

Master Boot Record or the MBR max to 512 Kb but very essential have you ever looked at what your MBR contains most probably NO!!, so try out the following 2 commands as root and check your MBR Contents

# dd if=/dev/hda of=mbr.bin bs=512 count=1
# od -xa mbr.bin

This will display your MBR change hda to sda if u have an sda type disk, following is my MBR you might not understand anything from this but a careful look is required to know what is it :)

0000000 48eb d090 bc66 7c00 0000 c08e d88e e689
k H dle P f < nul | nul nul so @ so X ht f
0000020 bf66 0600 0000 b966 0100 0000 a5f3 23ea
f ? nul ack nul nul f 9 nul soh nul nul s % j #
0000040 0006 8000 80fa 057c fa80 7e87 b202 8880
ack nul nul nul z nul | enq nul z bel ~ stx 2 nul bs
0000060 4916 6607 bebf 0007 3100 66f6 04b9 0203
syn I bel f ? > bel nul nul 1 v f 9 eot etx stx
0000100 00ff 2000 0001 0000 0200 90fa f690 80c2

Restoring GRUB after a reinstall

You had just did a weekly install of some OS which did not detected Linux, Follow the steps mentioned below to get GRUB working again. Please note this would erase the current bootloader and install a new one for you if you are unsure of what you are doing do not try this

    1. Boot from a Linux Live CD ( ex ubuntu or knopix, i use Ubuntu)
    2. Open the terminal
    3. Follow the commands mentioned below
    • sudo grub

    if sudo doesnot works switch to root user and use grub drectly, Find the ROOT device you will get the values for X & Y which will be used later.

    • grub> find /boot/grub/stage1

    Set the root device from the information achieved from the above command

    • grub> root (hdX,Y)

    Install GRUB

    • grub> setup (hd0)

    Exit GRUB

    User / Group Disk Quotas A three Step Guide

    A disk quota is a limit set by a system administrator that restricts certain aspects of file system usage on modern operating systems. "Wikipedia"

    Requirements : Quota Package

    Where to get it : Quota package is generally available in majority of Linux Distros but still if your distro doesn't provide you with Quota compile it from http://sourceforge.net/projects/linuxquota/ :)

    Step 1) Installation :

    a) openSUSE : yast -i quota

    b) Ubuntu : sudo apt-get install quota

    c) Fedora : yum install quota

    d) Others : Use rpm or compile if not available

     

    Step 2) Enable Disk Quota

    Disk quota is generally applied on a user or a set of users to its recommended to enable Disk Quota on your Home partition dont enable quota on the root partition unless you are under the expert category

    How to reset the ROOT password?

    missed a ROOT password now what :(

    You can reset the root password if you have physical access to your machine some of the distributions allow you to login in single user mode and once you are logged in you can change the password but what about the distributions which asks me to enter password while logging in the single user mode? eg SUSE is there a solution. yes there is follow the simple steps below to reset your password

    [ad#460]

    top scheduling...

    tasks tasks and tasks... you always need to monitor them but how to schedule this monitoring so that i can get a file generated say every hour or four hours. You normally use the following command to transfer the output of top to a file

    $ top > filename

    and this works fine for you have you ever tried to add this entry as a cron job believe me it wont work i struggled a lot with it so finally whats the solution to schedule it The answer is use cron job, but i just said it wont work :) yes this wont work directly you need to add certain flags hey dont work you need not search them, below is the line which you can add as your cron job

    PXE : making your admins life easier

    Need to setup a lab/office with 200+ computers, very tiring job but look if you have machines identical in configuration why are you installing each of them why not install one and replicate it to others this will save a lot of time, But how will i do this?????????? Its very very simple you can do a dd of the source to all destination but this would be even difficult and a bit geeky, hey dont worry we have a solution for it use PXE. 

    Now what is this PXE??

    Wikipedia "The Preboot eXecution Environment (PXE, also known as Pre-Execution Environment, or 'pixie') is an environment to boot computers using a network interface independently of available data storage devices (like hard disks) or installed operating systems."

    Wi-fi Security

    Desclaimer:  The views expressed here are of the author alone, you may agree or disagree on any of them, code/commands given in the posts worked fine for the author please use them on your own risks they may damage your system.

    I am in Pune since more than a year now have attended countless conferences, un-conferences, camps and what not, learnt a lot and atleast i am able to blog, in almost every event security is one of the leading topics is it that big, oh YES !!!, i would like to quote Rohit's statement "Click one centimetre below then what you use to click you would be much more secure".

    Installing PostgreSQL on Ubuntu Intrepid (8.10)



    Installing majority of softwares on Ubutu is just a like away same is the case with PostgreSQL

    Installing PostgreSQL (8.3)

    $ sudo apt-get install postgresql


    Setting the password for the postgres user

    $ sudo -u postgres psql template1

    ALTER USER postgres WITH PASSWORD 'password-u-need';
    \q


    this installs and configues the password for the postgreSQL

    is this not easy with ubuntu

    and yes if you need to use postgreSQL with PHP on your apache server the install the php5-pgsql module using the following

    $ sudo apt-get install php5-pgsql