Friday, March 26, 2010

Ubuntu grub 2 edit

    I previously spoke about upgrade Ubuntu grub. I did it for do some fancy things like customize my grub such as adding a background picture, change colors. Then I came up with a serious issue. Actually after I found the solution it seemed very easy but finding the solution by my own took some serious time. That's why I thought to write this article.

    When we fully update our OS, it will show in our grub loading time. It shows not only the upgraded version but also the previous versions also. So after we did that several times,  our screen fill with those upgrade version details at the grub loading time. It seems unnecessary. If you are running some other OS with Ubuntu you will feel it badly, because you have to press down arrow key several times. In "GNU GRUB 0.97" version you can edit those information in menu.lst file which locate /boot/grub directory. All you have to do is comment those previous upgraded versions.

   Here is the thing, after you have upgraded the grub 0.97 to grub 1.96 it is no use of editing that menu.lst file. Now you have to edit grub.cfg file which locates in the same directory. But the contents little bit difference. You will be able to identify those changes when you see it, like "uuid" replace with "root".

As an example in menu.lst file you will be able to see a block of context similar to this:

#title        Ubuntu 9.04, kernel 2.6.28-17-generic
#uuid        62ddb71b-c0fb-4a3d-9f21-87649aef2712
#kernel        /boot/vmlinuz-2.6.28-17-generic root=UUID=62ddb71b-c0fb-4a3d-9f21-87649aef2712 ro quiet splash
#initrd        /boot/initrd.img-2.6.28-17-generic
#quiet


But that will display in grub.crg as follow:

#menuentry "Ubuntu, linux 2.6.28-17-generic" {
#    linux  /boot/vmlinuz-2.6.28-17-generic
#    root=UUID=eee7e530-9088-4a70-a70c-3a559164416d ro quiet splash
#    initrd  /boot/initrd.img-2.6.28-17-generic
#}

So now you can use grub2 with confidence.


*** Thank You ***

** /-\ |\| |_| _| /-\ **

Monday, March 22, 2010

Configure Apache server ready for PHP suport by using httpd.conf

    This article also relate to one of my previous article named as "Installing Apache...". There I have mentioned that I going to tell more about configuring httpd.conf file. Here is the secons article relate to that. In my previous article I have spoke about SSL configuration. Now we can talk about configuring PHP in our web server.

    Here are the steps that I have followed.


• First I downloaded the source from the following link.

  http://www.php.net/get/php-5.3.1.tar.gz/from/in.php.net/mirror

• Next extracted the source file by using following command

  tar -zxvf php-5.3.3.tar.gz

• Next go in to the extracted folder by using following command

  cd /path_to_the_extracted_source_directory/

• Then configure the source by using following command

  ./configure –with-apxs2=/usr/local/apache2/bin/apxs –prefix=/usr/local/apache2/php

• Next thing is to build the source files. To do that used the command,

  make

• After building they (php authorization) gave a license message and asked to run the following command,

  make test

• After that place build files to mentioned directory in “prefix” tag by using,

  make install

• The next thing I did is make a php file named it as “anu.php” and places it in the /usr/local/apache2/htdocs/ directory. The content of the php file is as follow,

            phpinfo();

• Next I had to check the libphp5.so is in my /usr/local/apache2/modules directory. Yes it was there.

• The next thing was placed php.ini file into /usr/local/apache2/php directory in the current directory I got php.ini-development file and I had to copy it in to that directory.

  cp -p php.ini-development /usr/local/apache2/php/php.ini

• Next step is edit httpd.conf file which is locate in /usr/local/apache2/conf directory Following lines are added further.

  LoadModule php_module modules/libphp5.so

  AddHandler php5-script php

  DirectoryIndex index.html index.php3

  AddType text/html php

  AddType application /x-httpd-php-source phps

• That's all I had to do. At last I start the Apache and from my browser I tried to access my anu.php file

  /usr/local/apache2/bin/apachectl start (in terminal)

  https://localhost/anu.php ( in browser address bar)


* Now you will be able to see the default php page with lots of details. That means you have done it correctly. *

*** Thank You ***  :-) ...

Saturday, March 20, 2010

Configure Apache server ready for SSL suport by using httpd.conf

    This is relate to one of my previous blog post named as "Installing Apache 2.2.14". Their I have mentioned that further editing for the httpd.conf will come later. This is one of that.

    This is about enabling SSL in Apache server by editing the httpd.conf file. Lets check how can we do that.

     There are several ways to configure SSL (Secure Sockets Layer) in Apache. The easiest way is reconfigure Apache with enable SSL. It can be done as follows.

• First we have to go into the source file which we have downloaded. We can do it by using the following command in our terminal. (relate to the above mentioned post)
cd /path_of_the_file_location/

• Then we have to configure the Apache tree with enable SSL. We can use the following command.

./configure –prefix=/usr/local/apache2 –enable-ssl

• Next we have to build and install Apache by using following commands

make

make install

• Next step is to edit our httpd.conf file which locates in /usr/local/apache/conf . The things we have to edit in that are written below.

Listen 0.0.0.0:443

SSLEngine on

SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt

SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key

• Although we gave ssl.crt and ssl.key files above, there are no such directories in the mentioned location as default. We have to make those directories. The commands are as follows.

mkdir /usr/local/apache2/conf/ssl.crt

mkdir /usr/local/apache2/conf/ssl.key

• Now I had to create a self-signed server certificate for test purposes. The complete command is,

openssl req -new -x509 -days 365 -keyout /usr/local/apache2/conf/ssl.key/server.key -out /usr/local/apache2/conf/ssl.crt/server.crt -subj '/CN=Test-Only Certificate'

• Eventually I able to start Apache with SSL support.

/usr/local/apache2/bin/apachectl startssl


*** That's all ***

But you may confused "actually is it over?" Yes, you can check it by your self.
First have to do is place a web page on the relavant directory and try to access that page from your web browser through localhost. Then click on the small icon at the begining of the address bar. Then you will get a small popup and then you can understand what had happened.

***  Thanks for reading this blog **