Category Archives: Open source

Setting up Bugzilla in Ubuntu 14.04 ( trusty )

buggie
Setting up Bugzilla is fairly easy . This blog post is specific to Ubuntu 14.04  ( though it might work with older versions too )

In order to get Bugzilla up and running in Ubuntu 14.04, we are going to install Apache webserver ( SSL enabled ) , MySQL database server and also some tools that are required to  install and configure Bugzilla.

Login to the machine as a user that can do “sudo” commands. Here is the command you need to install required packages.
sudo apt-get install apache2 mysql-server libapache2-mod-perl2
libapache2-mod-perl2-dev libapache2-mod-perl2-doc perl postfix make gcc g++

Answer the questions asked by MySQL and postfix .

Setting up MySQL

Login with root access to MySQL and create a DB for Bugzilla. Change “secret_password” to anything you want. You will need it later when configuring Bugzilla too.


mysql -u root -p
password:
mysql > create database bugs;
mysql > GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* TO bugs@localhost IDENTIFIED BY ‘secret_password’;
mysql > flush privileges ;
mysql > quit

Setting up Apache

Now , we need to enable CGI and SSL for Apache. Since this is a in-house project, we are ok with a self-signed certificate.
sudo mkdir /etc/apache2/ssl
sudo a2enmod ssl
sudo a2enmod cgi
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/apache.key -out /etc/apache2/ssl/apache.crt

The last command will ask you to enter a few information about the country and email address etc. Now we have the certificate in /etc/apache2/ssl/apache.crt and the Key file in /etc/apache2/ssl/apache.key . Modify the /etc/apache2/sites-available/default-ssl.conf to properly mark these files.
SSLCertificateFile /etc/apache2/ssl/apache.crt
SSLCertificateKeyFile /etc/apache2/ssl/apache.key

Now to make the SSL site run, sudo a2ensite default-ssl.conf” Restart apache to make the changes effective. You can already test it with your browser pointing to https://your_server_ip/ .

Setting up Bugzilla – Stage 1

Download and extract the latest tar file from the internet. As of this writing , latest stable version is 4.4.5.
cd /var/www/html
sudo wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.4.5.tar.gz
sudo tar zxvf bugzilla-4.4.5.tar.gz
sudo mv bugzilla-4.4.5 bugzilla

Now we have Bugzilla extracted, let’s use a script provided by the developers to do further configurations.
cd /var/www/html/bugzilla
sudo ./checksetup.pl --check-modules

This will tell you most probably , there are lot of perl modules missing. Do not worry, you can install all of them with the below command.

cd /var/www/html/bugzilla
sudo perl install-module.pl --all

This will take some time to download and install all dependancies. Run the checksetup.pl –check-modules command again to verify there are nothing left.

Next step, run the checksetup.pl command without –check-modules option. This will generate a file called “localconfig” in the /var/www/html/bugzilla directory. Edit that file and include the following minimum things.

$webservergroup = 'www-data'
$db_pass = 'secret_password'

We will also create a local user account to run Bugzilla.

sudo useradd -d /home/bugs -m bugs
sudo passwd bugs

Now , run the sudo checksetup.pl again. It will connect to DB and also install proper files and permissions. If everything goes fine, it will ask for a Administrator user email and password. This is what you will use to setup more details in Bugzilla later.

Configure Apache to properly understand and execute scripts in Bugzilla , by adding the following to /etc/apache2/apache2.conf file.

<Directory "/var/www/html/bugzilla">
AddHandler cgi-script cgi
DirectoryIndex index.cgi
Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all

Now, restart apache ( sudo service apache2 restart ) and connect to https://server_ip/bugzilla .

Setting up Bugzilla – Stage 2

After you have successfully completed stage 1, you can now login to Bugzilla using the Administrator email and password you mentioned while running checksetup.pl.

You will be greeted with a special configuration page. You will need to go to parameters and set at least urlbase  as http://server_ip/bugzilla/ and cookie_path as /bugzilla/ . Also there is possibility to force SSL connections in that same page.

Now you need to got to “Administration” and configure Product, milestones, users, authentication, preferences etc. There are so many things you can configure from the “Administration” link , that is beyond the scope of this blog post. More information can be found here : http://www.bugzilla.org/docs/

Enjoy your very own Bugzilla !

 

Adobe Reader on Ubuntu 13.10 (Saucy Salamander) 64 Bit

I will try to keep this short and simple. Adobe reader is needed only if you need to do forms and such advanced things in PDF files. Otherwise, Ubuntu comes with default tools such as evince to do all kind of usual reading of PDF files. If your system is a very old one, you can even try installing xpdf package.

That being said, let’s go ahead and install Adobe reader. First, download the .bin file from adobe website : http://get.adobe.com/reader/ . Once the file is downloaded, issue the following commands to install it.

Inside a terminal :

chmod a+x acro...bin
./acro...bin

and follow on-screen instructions.

If you are running a 64 Bit version of Ubuntu, you might need to install a few 32 bit libraries to get it working. Specially if you are facing errors like : “acroread: error while loading shared libraries: libgdk_pixbuf_xlib-2.0.so.0: cannot open shared object file: No such file or directory

sudo aptitude install libgdk-pixbuf2.0-0:i386
sudo aptitude install libgtk2.0-0:i386

Adobe Reader should work fine now. Enjoy 🙂

HTTPS in RHEL and PHP in less than 5 minutes !

Enabling HTTPS will give your application an added layer of security. The SSL layer will encrypt all communication that happens between the customer’s browser and your application. In this article, I am not describing things in detail about each security option. This is good enough to get started in most of the cases.

Login to Redhat Linux as user root and run the below commands to install apache ( with ssl support ) and PHP version 5.

#yum install httpd mod_ssl openssl php5
#service httpd restart

You should be able access your server via HTTPS now using the browser like https://yourservername.domain/application/login.php . You are now using a self signed certificate for the server. Your browsers might warn you about this , but it is safe to accept it and continue.

If your server was using HTTP only and you recently upgraded it to HTTPS, Here’s a quick and dirty method in PHP to detect if your users are still using HTTP and redirect them to HTTPS. All you need to do is include this code in the start of your php file.

< ?php
$loginURL="https://yourserver/application/login.php" ;
if($_SERVER['HTTPS']){
echo <<<REDIRECT
Redirecting to ... $loginURL 
<script>
window.location($loginURL);
</script>
REDIRECT;
}
?>

As you see, a little time spent can go great lengths towards securing your website and applications. Feel free to comment. 🙂

Weekend Project with OpenSource

Here’s another story about how open source helped me.

I have a USB disk at home where I store all my photos, videos, movies, songs etc.  The disk is connected to a desktop computer at home and shared across the network. Making it available on network helped me to backup my laptop data also to the disk using wireless connection. So far so good.

But what about watching movies or listening to songs or viewing pictures? I can do it from my laptop, but it will be only me. What’s the fun in that? I wanted to enjoy them with family and friends in my TV in the living room. Here’s how I did it.

In old Laptop, I installed PinGuy Linux (http://pinguy-os.sourceforge.net/ ) . I also updated all softwares to the latest version.

Now the problem is that I have a CRT TV. It supports only RCA input. My laptop had a  S-Video output. I bought a S-Video to RCA Cable and connected the laptop. It did not work !. Then I bought a VGA to RCA cable , that also failed. I did some research and ended up buying a VGA to RCA Converter box from the local electronics market. It gives 640×480 resolution that is probably the maximum my TV can do, anyways.. it worked.  🙂

Here’s the box.

So now, My TV shows only a part of the laptop screen because laptop is running at 1024×768 and TV can do only 640×480. Then I started XBMC , the Media Center Application. It gives a nice GUI to configure settings and also to manage the Media. I configured it to run in Window mode and dragged and re-sized the window to 640×480 resolution and placed it on the corner of the screen so that it covers fully what is shown on my TV.

Rest of the operation was simple, connected to my USB disk over network, added those files to XBMC. I also configured XBMC to show weather information and play Youtube videos.

I am now able to watch all my photos, videos and listen to songs in my USB disk via my TV. Hurray !

Wishlist :Infrared Remote for Laptop. Also a HD capable TV in future 🙂

Firefox 4 Released

Firefox 4 is now available for download. Click here to see what’s new.

I installed it on my laptop. It has improved a lot. Specially the way tabs are organized and the visual layout overall has been totally streamlined. It is also loading webpages faster. Unlike the previous versions, Firefox 4 is using less RAM on my system.

So what are you waiting for? Give it a try. 🙂