Moved To A New Location

I have moved this wordpress.com blog to a new location powered by the same WordPress software from the wordpress.org website. Had to toil a bit to move the posts, comments and all that and get everything start working again. I will share my experiences, and the reasons for moving from here in the first place, at the new location:

http://beans.seartipy.com

Please update your bookmarks!

(I do plan to keep posting here for some more time, not frequently though, just to test out any new features introduced by wordpress.com) 

Leave a Comment

Apache + PHP + MySQL on Gentoo

This blog is moved to the new location: beans.seartipy.com

You can read the same article at its new location: Apache + PHP + MySQL on Gentoo

Most of the today’s web applications need the combo of Apache, PHP and MySQL packages to be first installed on the system. Installing these software on a Gentoo system should be a straightforward process. Below is the complete procedure.

First add apache2 and mysql to the USE flag in the /etc/make.conf file:

$ emacs -nw /etc/make.conf

USE=”gtk gnome qt kde dvd alsa cdr hal howl imap maildir mysql apache2

emerge the apache package:

$ emerge apache
$ /etc/init.d/apache2 start
$ rc-update add apache2 default

Test the installation by accessing the url http://localhost/ from a web browser. If you get a welcome message from apache, the installation is complete. More info here.

Now emerge PHP4 and the mod_php module for apache:

$ emerge dev-php/php mod_php

Add the configuration directive(-D PHP4) to /etc/conf.d/apache2 file and restart the apache web server:

APACHE2_OPTS=”-D DEFAULT_HOST -D PHP4

$ /etc/init.d/apache2 restart

Create a sample php script in the directory /var/www/localhost/htdocs with the following contents and access it from the web browser to test the php installation:

<?php
phpinfo();
?>

If you see a lot of information displayed about the version of PHP and other related things then PHP is installed and properly configured with the apache web server. Installation of PHP5 is also similar but be warned that still a lot of software runs only on PHP4(Eg: phpBB Bulletin Software). With a little bit of effort you can also run both PHP4 and PHP5 on the same system side by side.

Install MySQL and all the related tools:

Add the following lines to the /etc/portage/package.keywords file:

>=dev-db/mysql-administrator-1.1.5 ~x86
>=dev-db/mysql-query-browser-1.1.17 ~x86
>=dev-cpp/gtkmm-2.8 ~x86
>=dev-cpp glibmm-2.7 ~x86

$ emerge mysql mysql-administrator mysql-query-browser
$ emerge –config mysql-4.1.14
$ /etc/init.d/mysql start

Set a root password for mysql server when prompted by the ‘emerge –config’ command. You can administer the mysql server by using either the command line tools or using the graphical tool mysql-adminstrator. Similarly, the command line client mysql can be used to create and view the database schemas or the graphical tool mysql-query-browser can be used. I recommed you give these two graphical applications a try.

Other databases, like PostgreSQL, can be used instead of MySQL whenever the applications support it, but a majority of the applications support only the MySQL database. WordPress for example doesn’t support PostgreSQL.


				

Comments (7)

A NFS Story on Gentoo

I still carry the habit of storing all the large files in my Windows partitions from my bad old Windows days. That allows me to plug any kind of device into the computer and copy the files to/from it. Gnu/Linux supports all kinds of DVD writers and Pen drives too, but my friends sometimes carry such wierd devices(and mp3 players) that they can be connected to a computer using the Windows operating system only. Accessing files in the Windows OS from a linux partition is a time consuming and inefficient process – I do it using the excellent tool called Explore2FS, but its not an ideal tool for copying large amounts of files and directories. So it suits me well: store the files on the windows partitions and access them easily from both Windows and GNU/Linux(by using a simple mount command).

When I discovered that my old Debian Sarge installation was not detecting the USB port for some reason, and that its DVD-ROM has also died upon me, my only way to transfer some files to it was through the LAN. The files were contained in an ISO file on a Windows NTFS partition on a different machine. This is what I had to do to make the ISO file contents available to my USB-less, DVD-less Debian system:

I use Gentoo as my primary operating system on my personal desktop. The first job for me was to mount the local Windows partition(hda7) that contained the needed ISO file in the Gentoo filesystem.
$ mkdir /mnt/win_d
$ mount /dev/hda7 /mnt/win_d
$ ls /mnt/win_d/*.iso

The ISO file was visible. I tried to export the /mnt/win_d directory using NFS and then tried to mount the ISO file on the Debian system, but it didn't work out that way to me. Not in a mood to loose too much time over it, I mounted the ISO file on my Gentoo System itself and then exported this mounted directory:

$ mkdir /mnt/myiso
$ mount -o loop /mnt/win_d/myiso.iso /mnt/myiso
$ ls /mnt/myiso

All the files contained in the ISO file were visible. The next job is to install the NFS server and the related tools if they are already not available, and then export the /mnt/myiso directory using it.

$ emerge nfs-utils

Put the following line /etc/exports:

/mnt/myiso 192.168.0.0/255.255.255.0(async, no_subtree_check, ro, no_squash_root)

I have specified a range of IP addresses to export the directory to all the machines within the subnet. Only one IP address or a different IP address range can also specified there. Note that there should be NO space between the IP address/IP address range and the opening paranthesis that follows it. To learn more about the different options and their meanings that can be specified in the line, head on to this.

Start the nfs and portmap daemons and add them to the default runlevel(so that they start automatically at the boot time).

$ /etc/init.d/nfs start
$ rc-update add nfs default
$ /etc/init.d/portmap start
$ rc-update add portmap default

If you ever make changes to the /etc/exportfs file, then export all your changes using:

$ exportfs -ra
$ /etc/init.d/nfs reload
$ exportfs

The last command shows you all the directories that are currently exported.

Now go to the other machine(Debian in my case) and use a simple mount command to access the exported directory.

$ mkdir /mnt/remote
$ mount 192.168.0.7:/mnt/myiso /mnt/remote
$ ls /mnt/remote

You should see all the files from the exported directory. The IP address above is of the host system(Gentoo in my case) which is running the nfs daemon. Now you can use the /mnt/remote directory as any other directory on the local gnu/linux system. If the exported directory were a linux partition or a Windows FAT partition, then the write options could also have been ebabled by using the "rw" option in the /etc/exportfs file in place of the "ro" option. The following line can be added to the /etc/fstab file to mount this directory automatically at the boot time:

192.168.0.7:/mnt/myiso /mnt/remote nfs ro 0 0

The IP address, as above, is of the host system. You may be interested in this: NFS in Gentoo

Leave a Comment

Direct Server to Server Copy using FXP

FTP is still the best way to upload or download the files/folders from a website. I use gFTP to upload the files to my webspace, and its quite efficient at the job. even if the connection gets interrupted in the middle of a transfer, it automatically reconnects and completes the job. it has many other useful features too. one feature that i thought was lacking in it, is the ability to move a folder from one location to the other, within the same server. other people had complained for its lack of abilitiy to move a file from one server to another server without involving the local machine in the process. though many FTP clients support such a feature(including gFTP, as i discovered later on), i started searching for a dedicated FXP client. but what is FXP? from wikipedia:

File eXchange Protocol (FXP) is a method of data transfer which uses the FTP protocol to transfer data from one remote server to another without routing this data through the client’s connection.

note that FXP transfers need relevant support on the server side too(they must support PASV mode and PORT commands) – otherwise the FXP client can’t do anything about it. to install a FXP client on Gentoo:

  1. Add the following line to the file /etc/portage/package.keywords :
    >=net-ftp/gtkfxp-0.5 ~x86
  2. Emerge the package and run it:
    $ emerge gtkfxp
    $ gtkfxp

click the “Connect” button on the left side and fill the settings of the first server in the popped up dialog box, then click the “Connect” button on the right side and fill out the settings of the second server. you can now start transferring the files in between these two servers without involving your local machine. you can enter the information about the same server in both the dialog boxes if you want to transfer the files within the same server. note that this software is buggy and very crash prone. gFTP too supports FXP transfers but it is seriously lacking in the documentation.

Leave a Comment

Installing C++ Boost on SuSE and Fedora

C++ Boost on SuSE:

its simple to install C++ Boost on a SuSE system by using its YaST package manager.

  1. Run YaST and select "Software" from the left pane. Now select "Software Management" from the right pane and search for "boost" using the Search box.
  2. Select the boost packages that you want to install from the right pane(you atleast need boost – 1.33.0-3) and press the "Accept" button.

You can now test the boost installation by compiling the two programs i had mentioned in my earlier post, using the following commands:

$ g++ -o first first.cpp
$ g++-o second second.cpp -lboost_filesystem

C++ Boost on Fedora:

Installing C++ Boost on RedHat Fedora systems is also along the same lines. first download the boost-1.33.1-5.i386.rpm RPM file from the internet. you can search for a different version of the file if you are not using the fedora core 5 system. install it using the following command(you can directly click on the file):

$ rpm -ivh boost-1.33.1-5.i386.rpm

you can also install it using the yum package manager of Fedora. test the installation just as mentioned in the case of SuSE.

Leave a Comment

Java 1.5 and Eclipse in Gentoo – Part II

This blog is moved to the new location: beans.seartipy.com

You can read the same article at its new location: Java 1.5 and Eclipse in Gentoo – Part II

my previous post discussed the installation of Java on a Gentoo system. its all well as long as you want to run the default supported version of java on the Gentoo system – you install blackdown-jdk 1.4, Eclipse 3.0, and maybe Eclipse CDT too. but if you want to install java 1.5(Tiger), then you need to unmask the package and remember to make blackdown(or sun) jdk 1.4 as the default JVM for the system. you can keep sun jdk 1.5 as the default JVM for the user. the procedure is like this:

$ java-config -L

[sun-jdk-1.5.0.06] “Sun JDK 1.5.0.06″ (/etc/env.d/java/20sun-jdk-1.5.0.06) *
[blackdown-jdk-1.4.2.03] “Blackdown JDK 1.4.2.03″ (/etc/env.d/java/20blackdown-jdk-1.4.2.03)

this shows you all the installed jdks on your system. use the name as given under the brackets to set that particular jvm as your system default:

$ java-config -S blackdown-jdk-1.4.2.03
$ /usr/sbin/env-update && source /etc/profile

this sets the blackdown jdk 1.4 as the system jvm, which is the recommended option. you can set the sun jdk 5.0 as the user default jvm though:

$ java-config -s sun-jdk-1.5.0.06
$ echo source ~/.gentoo/java-env >> ~./bash_profile
$ source ~/.gentoo/java-env

this sets the sun jdk 1.5 as the user jvm and it is safe this way. but don’t make 1.5 version as the default jvm for the system unless you are ready to break a lot of java applications.

Best way to install Java on Gentoo OS:

but this still is not an ideal setup from my point of view; the installed Eclipse version doesn’t support the Java 1.5 version. if you want to use the latest versions of all the java software without going through all of these hassles, then you need to install everything related to java manaully in the user home directory. this won’t affect your normal portage structure.

first download the latest versions of java sdk and the eclipse ide from the internet and copy them into the home directory.

download sun jdk 1.5.0 update 6 from here and copy it into the home directory. you will have to accept the license to be able to download this. be sure to download the .bin version of the file, and not the rpm version.

download the latest version of the eclipes ide from here and copy it in the home directory. the latest build available currently is Eclipse 3.2M5a. If you plan to use Eclipse CDT plugin to create C++ applications, then you have to be content with the Eclipse 3.1.2 version.

(all the above links are for the gnu/linux, 32-bit operating system. finding similar package files for 64-bit systems shouldn’t be too difficult)

install jdk as a normal user:

$ chmod +x jdk_1_5_0_06-linux-i586.bin
$ ./jdk_1_5_0_06-linux-i586.bin
$ tar xvzf eclipse-sdk-3,1,2-linux-gtk.tar.gz

rename the directory to which the above files are extracted to something simple, like “eclipse”.

now add the following lines to your user profile( eg ~/.bash_profile ):

JDK_HOME=~/jdk1.5.0_06
JAVAC=~/jdk1.5.0_06/bin/javac
PATH=~/jdk1.5.0_06/bin:~/jdk1.5.0_06/jre/bin:~/eclipse:$PATH MANPATH=$MANPATH:~/~/jdk1.5.0_06/man
JAVA_HOME=~/jdk1.5.0_06

source the profile once and start the eclipse IDE:

$ source ~./bash_profile
$ eclipse

Go to Windows menu and select Preferences from it. Select Java -> Installed JREs from the left pane and click on the “Add” button on the right pane. browse to and select jdk1.5.0_06/jre directory from your home directory. enter “JDK1.5.0_06″ in “JRE Name:” field. click on Java -> Compiler item from the left pane and select “5.0” from the “Compiler Compliance Settings:” selection list. Click OK button to dismiss the dialog box.

Now you can create java 1.5 applications on your Gentoo system using the Eclipse IDE.
just extract the Eclipse CDT tar file in the eclipse folder to get the C++ support in Eclipse. (contents of ‘features’ directory from downloaded package should go into the ‘features’ directory in eclipse, and contents of ‘plugins’ directory should go into the ‘plugins’ directory in eclipse).


				

Comments (1)

Java on Gentoo

The simplest way to get started with Java development in Gentoo is to install the Blackdown JDK-1.4.2 along with the Eclipse IDE:

$ emerge blackdown-jdk eclipse-sdk

if you want to install the sun's version of the jdk, instead of blackdown jdk, you can get the 1.4.2 version of it using:

$ emerge sun-jdk java-sdk-docs

to install the 1.5 version of the jdk, you need to unmask it first. add the following two lines to your /etc/portage/package.keywords file:

>=dev-java/sun-jdk-1.5.0 ~x86
>=dev-java/java-sdk-docs-1.5.0 ~x86

now do the emerge:

$ emerge sun-jdk java-sdk-docs

you can also install both of these versions at the same time, and then make one of them as the default jdk. if you need java support in other applications too(like web browser etc), then make sure to add the relevant keywords in the /etc/portage/package.use file:

=dev-java/sun-jdk-1.4.2.10-r2 X alsa browserplugin doc examples jce mozilla nsplugin

this also installs the documentation and the examples. change the version number if you are installing the 1.5 version of the jdk.

if you want to use Eclipse IDE to create C++ programs, you need the eclipse-cdt package. first unmask it by placing the following line in /etc/portage/package.keywords file:

>=dev-util/eclipse-cdt-2.0 ~x86

now do the emerge:

$ emerge eclipse-cdt

here is more information on installing java 1.5 and eclipse 3.x on Gentoo OS.

Comments (3)

Older Posts »
Follow

Get every new post delivered to your Inbox.