Wednesday, August 12, 2009

Firefox-3.0.10 Installation on Puppy Linux OS (en)

Firefox

1. Download Firefox∞.
2. Install using the following code:

mv firefox* /usr/local/
cd /usr/local/
tar -zxvf firefox*
rm /usr/local/*.tar.gz

3. You will want to place a symbolic link to the Firefox executable in /usr/local/bin/ with a command similar to this:

ln -s /usr/local/firefox/firefox /usr/local/bin/firefox
Flash

1. Download Flash Player∞.
2. Decompress it, then copy libflashplayer.so to your Firefox plugins directory and flashplayer.xpt to your Firefox components directory.

Firefox | Opera | Seamonkey | Flock

CategoryApplicationVarious


=====================================================

PuppyLinuxOS-4.20 distro came with Mozilla SeaMonkey-1.1.15 as the default browser. Indeed, sea monkey is very nicely integrated with the email client, and html composer (the package that I used rarely). However, I’m not familiar with this SeaMonkey. So, I need to install it on my new Puppy. Below is my experience installing Firefox on Puppy Linux OS.

You can find firefox installation for PuppyLinux on this wiki. It follows default firefox installation. But on Puppy Linux, Firefox applications ant libraries should be placed on /opt/mozilla.org/lib/firefox-xxx folder. And then making a firefox softlink in directory /root/my-applications/bin/. In this article, I’ll also show you how to create firefox-3.0.10-i686.pet file.

Installation:

  1. Download firefox-3.0.10
  2. Extract Firefox-3.0.10.tar.gz to /opt/mozilla.org/lib directory . Rename it with firefox-3.0.10 (optional)
  3. Make softlink /opt/mozilla.org/lib/firefox-3.0.10/firefox file to /root/my-applications/bin/:
    ln-sf /opt/mozilla.org/lib/firefox-3.0.10/firefox /root/my-applications/bin/
  4. Edit moz_libdir in /opt/mozilla.org/lib/firefox-3.0.10/firefox file. It shoud be:
    moz_libdir=/opt/mozilla.org/lib/firefox-3.0.10
  5. type ‘firefox’ to run the program
===================================================

Want to make a pet file for this firefox-3.0.10? Follow these:

  1. Create a directory (for example, firefox-3.0.10-i686)
  2. Copy all firefox files and directories :cp --parent -av /opt/mozilla.org/lib/firefox-3.0.10/ ./firefox-3.0.10-i686
  3. Copy the /root/my-applications/firefox softlink (if /root/my-applications/firefox doesn’t exist, create it using step 3 on install instruction above):
    cp --parent -av /root/my-applications/bin/firefox ./firefox-3.0.10-i686
  4. Run the command:
    dir2pet firefox-3.0.10-i686
    Step1: press enter
    Step1b: (category) WebBrowser

    Step1c: (path, executable) firefox (because the /root/my-applications/bin directory is already in the path env)

    Step1d: (path, icon) /opt/mozilla.org/lib/firefox-3.0.10/icons/mozicon16.xpm

    Step1e: (name of application) Firefox

    Step2: (description) web browser

    Press enter 2 times

    Step3: (dependency) leave empty

    Step4: press enter

  5. Firefox-3.0.10-i686.pet file has been ready to be installed

Download Firefox pet files:

Click this thread post for detail.

Monday, August 10, 2009

How to update/reinstall grub boot loader

Way-01:-

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)

Code:
sudo grub
This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands

Code:
find /boot/grub/stage1
This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)

Code:
root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr

Code:
setup (hd0)
Finally exit the grub shell
Code:
quit
That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.
==============================

Way 2:

When the busted system is in a single ext3 root partition (say, /dev/sda5)...
mkdir /mnt/temp
mount /dev/sda5 /mnt/temp
grub-install --root-directory=/mnt/temp /dev/sda
When the busted system has separate ext3 boot and root partitions (say, /dev/sda5 and /dev/sda6)...
mkdir -p /mnt/temp/boot
mount /dev/sda6 /mnt/temp
mount /dev/sda5 /mnt/temp/boot
grub-install --root-directory=/mnt/temp /dev/sda
When the busted system has a separate ext3 boot partition (say, /dev/sda5), and the root partition is a logical volume (say, /dev/VolGroup00/LogVol00 according to lvdisplay)...
mkdir -p /mnt/temp/boot
vgchange -a y
lvdisplay
mount /dev/VolGroup00/LogVol00 /mnt/temp
mount /dev/sda5 /mnt/temp/boot
grub-install --root-directory=/mnt/temp /dev/sda
If grub-install fails with a read error or the boot loader still doesn't work, always try the GRUB shell (and vice versa). They both accomplish the same thing, but different things occur in the background. It's not necessary to mount partitions when using the GRUB shell commands in the LiveCD. Change x & y in the example to the busted system's boot partition...
/sbin/grub
grub> root (hdx,y)
grub> setup (hd0)
grub>quit


Restart & all are done.

Thursday, June 18, 2009

webserver -Apache2 With PHP, Ruby, Python in fedora 10

Apache2 With PHP, Ruby, Python
Now we install Apache with PHP5 (this is PHP 5.2.6):
yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml
php-xmlrpc php-eaccelerator php-magickwand php-magpierss php-mapserver php-mbstring
php-mcrypt php-mhash php-mssql php-shout php-snmp php-soap php-tidy curl curl-devel
perl-libwww-perl ImageMagick libxml2 libxml2-devel

Then edit /etc/httpd/conf/httpd.conf:
vi /etc/httpd/conf/httpd.conf

and change DirectoryIndex to
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl


Now configure your system to start Apache at boot time:
chkconfig --levels 235 httpd on

Start Apache:
/etc/init.d/httpd start

12.1 Disable PHP Globally
(If you do not plan to install ISP Config on this server, please skip this section!)
In ISPConfig you will configure PHP on a per-website basis, i.e. you can specify which website can run
PHP scripts and which one cannot. This can only work if PHP is disabled globally because otherwise all
websites would be able to run PHP scripts, no matter what you specify in ISPConfig.
To disable PHP globally, we edit /etc/httpd/conf.d/php.conf and comment out the AddHandler and
AddType lines:
vi /etc/httpd/conf.d/php.conf

Afterwards we restart Apache:
/etc/init.d/httpd restart

12.2 Ruby
Starting with version 2.2.20 , ISPConfig has built-in support for Ruby. Instead of using CGI/FastCGI,
ISPConfig depends on mod_ruby being available in the server's Apache.
For Fedora 10 , there's no mod_ruby pack age available, so we must compile it ourselves. First we
install some prerequisites:
yum install httpd-devel ruby ruby-devel

Next we download and install mod_ruby as follows:
cd /tmp

wget http://www.modruby.net/archive/mod_ruby-1.3.0.tar.gz
tar zxvf mod_ruby-1.3.0.tar.gz

cd mod_ruby-1.3.0/
./configure.rb --with-apr-includes=/usr/include/apr-1

make
make install

Finally we must add the mod_ruby module to the Apache configuration, so we create the file
/etc/httpd/conf.d/ruby.conf


vi /etc/httpd/conf.d/ruby.conf

... and restart Apache:
/etc/init.d/httpd restart

You can find more details about mod_ruby in this article.
12.3 Installing mod_python
To install mod_python, we simply run...
yum install mod_python

... and restart Apache afterwards:
/etc/init.d/httpd restart

13 ProFTPd
ISPConfig has better support for proftpd than vsftpd, so let's remove vsftpd and install proftpd:
yum remove vsftpd
yum install proftpd

Now we can create the system startup links for Proftpd and start it:

chkconfig --levels 235 proftpd on

/etc/init.d/proftpd start

14 Webalizer
To install webaliz er, just run
yum install webalizer

15 Synchronize The System Clock
If you want to have the system clock synchroniz ed with an NTP server do the following:
yum install ntp
chkconfig --levels 235 ntpd on

ntpdate 0.pool.ntp.org
/etc/init.d/ntpd start

16 Install Som e Perl Modules
ISPConfig comes with SpamAssassin which needs a few Perl modules to work. We install the required
Perl modules with a single command:
yum install perl-HTML-Parser perl-DBI perl-Net-DNS perl-Digest-SHA1 perl-ExtUtils-
AutoInstall

17 ISPConfig
The configuration of the server is now finished. You can now install ISPConfig on it, following these
instructions: http://www.ispconfig.org/manual_installation.htm
17.1 A Note On SuExec
If you want to run CGI scripts under suExec, you should specify /var/www as the web root for websites
created by ISPConfig as Fedora's suExec is compiled with /var/www as Doc_Root. Run
/usr/sbin/suexec -V

and the output should look like this:

[root@server1 ~]# /usr/sbin/suexec -V
-D AP_DOC_ROOT="/var/www"
-D AP_GID_MIN=100
-D AP_HTTPD_USER="apache"
-D AP_LOG_EXEC="/var/log/httpd/suexec.log"
-D AP_SAFE_PATH="/usr/local/bin:/usr/bin:/bin"
-D AP_UID_MIN=500
-D AP_USERDIR_SUFFIX="public_html"
[root@server1 ~]#

So if you want to use suExec with ISPconfig, don't change the default web root (which is /var/www) if
you use expert mode during the ISPConfig installation (in standard mode you can't change the web
root anyway so you'll be able to use suExec in any case).

Saturday, June 6, 2009

Squid in 5 minutes

Squid in 5 minutes
by Noah Gift

Why Squid? Why only five minutes?

There are many great tools that Squid has to offer, but when I need to redirect http traffic to a caching server for performance increases or security, squid’s my pick. Squid has built in proxy and caching tools that are simple, yet effective.

I recently used Squid for a secure subnet that did not allow outgoing port 80 http access to external IP addresses. Many organizations will block external port 80 access at the router level. This is a great way to eliminate a huge security hole, but a headache when a systems administrator needs to reach the outside world temporarily to download a file. Another scenario: redirect all computers in a home network to a local caching server to increase website query performance and save on bandwidth.

The situations described above are when the five minute Squid configuration comes in very handy. All requests for external http access can be handled by squid through a simple proxy configuration on each client machine. Sounds complicated? It isn’t. Let’s get into the details next.
Install

On a Red Hat® Enterprise Linux® or Fedora™ Core operating system, it is easy to check if Squid is installed using the rpm system. Type the command:

rpm -q squid


If Squid is already installed, you will get a response similar to:

squid-2.5.STABLE6-3.4E.12


If Squid isn’t installed, then you can use Yum to install it. Thanks to Yum the installation is quite easy.

Just type at a command line:

yum install squid


If you happen to have downloaded the rpm you can also type something like:

rpm -ivh squid-2.5.STABLE6-3.4E.12.i386.rpm


Configure

Squid’s main configuration file lives in /etc/squid/squid.conf. The 3,339 line configuration file is intimidating, but the good news is that it is very simple to setup a proxy server that forward http, https, and ftp requests to Squid on the default port of 3128 and caches the data.
Back up the configuration file

It is always good policy to backup a configuration file before you edit it. If you haven’t been burned yet, you haven’t edited enough configuration files. Make a backup from the command line or the gui and rename the original file something meaningful. I personally like to append a bck.datestamp. For example:

cp /etc/squid/squid.conf /etc/squid/squid.conf.bck.02052007

If it is the original configuration file you might choose to do:

cp /etc/squid/squid.conf /etc/squid/squid.conf.org.02052007


Edit the file

Open /etc/squid/squid.conf with your favorite text editor. I use vim, but nano is a good beginner’s command line text editor. If you do use nano, make sure you use the nano –nowrap option to turn off line wrapping when editing things like configuration files. A gui editor like Gedit will also work.
Five minute configuration

There are many fancy options for squid that we will not enable, specifically acls (access control lists) or authentication. We are going to set up a caching proxy server with no access control. This server would be suitable for a home network behind a firewall.

The default squid configuration is almost complete, but a few small changes should be made. You will need to either find and uncomment entries, or modify existing uncommented lines in the squid configuration file. Use your favorite text editor or a text find to quickly locate these lines:

visible_hostname machine-name
http_port 3128
cache_dir ufs /var/spool/squid 1000 16 256
cache_access_log /var/log/squid/access.log

In the acl section near the bottom add:

acl intranet 192.168.0.0/24
http_access allow intranet


Let me explain what each of these six lines means:

visible_hostname – Create this entry and set this to the hostname of the machine. To find the hostname, use the command hostname. Not entering a value may cause squid to fail as it may not be able to automatically determine the fully qualified hostname of your machine.

http_port 3128 – Uncomment this line but there is no need to edit it unless you want to change the default port for http connections.

cache_dir ufs /var/spool/squid 1000 15 256 – Uncomment this line. You may want to append a zero to the value 100 which will make the cache size 1000MB instead of 100MB. The last two values stand for the default folder depth the cache will create on the top and subdirectories respectively. They do not need modification.

cache_access_log – Uncomment this line. This is where all requests to the proxy server will get logged.

acl intranet 192.168.0.0/24 – This entry needs to be added. It should correspond to whatever your local network range is. For example, if your Fedora server is 192.168.2.5 then the entry should be acl intranet 192.168.2.0/24

http_access allow intranet – This allows the acl named intranet to use the proxy server. Make sure to put allow directives above the last ‘http_access deny all’ entry, as it will overide any allow directives below it.
Turning on squid

Enable the proper run levels:

chkconfig squid on

Start the service:

service squid start

Verify that squid isrunning:

service squid status


Note, if you have problems starting squid, open a separate shell and run:

tail -f /var/log/messages


Then start the squid service in your original window:

service squid start


The tail command should show an error for squid that can help you solve the problem. One common error is that the swap (cache) directory doesn’t exist. To solve this problem, run squid with the -z option to automatically create the directories:

/usr/sbin/squid -z


Make sure that squid has write permission to the swap directory or this command won’t work.
Configuring the clients

If you are using Firefox or Mozilla you will need to add the proxy server as follows:

Go to Preferences>Network>Settings

Add the name of your new proxy server and port 3128 to the http proxy field (under manual configuration).

Open a shell to your proxy server so you can observe the log file being written to. Use tail, as before:

tail -f /var/log/squid/access.log


Now surf the web through your proxy server. You should see entries flying by in real time as you surf different http addresses. Congratulations, you now have a caching proxy server setup!
Summary

Quick recap:You installed squid with a simple yum command. You backed up the default configuration file, then edited just 6 lines. You started the proper run level. You started the squid service. You configured a client to use the proxy server, and then you verified it was working properly by tailing the log. To top it all off, you did it in 5 minutes. Now who says Linux isn’t fun?

This entry was posted by Noah Gift on Wednesday, April 11th, 2007 at 9:01 am and is filed under technical. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Wednesday, May 27, 2009

How to install microsoft core fonts

Microsoft Core Fonts

These fonts need to be built from the web so you will build an rpm package based on a SPEC file.

su -c 'yum install wget rpmdevtools rpmbuild cabextract ttmkfdir'
  • Then create the rpmdev directory
rpmdev-setuptree
  • Switch to your SPECS directory that you created in the previous step.
cd ~/rpmbuild/SPECS/
  • Download the spec file.
wget http://dl.atrpms.net/all/chkfontpath-1.10.1-2.fc9.x86_64.rpm
wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
  • run the following command to build the rpm
rpmbuild -bb msttcorefonts-2.0-1.spec
  • Move to where the msttcorefonts rpm was created
cd ~/rpmbuild/RPMS/noarch/
  • Download and install the msttcorefonts and dependencies
su -c 'rpm -ivh chkfontpath-1.10.1-2.fc9.x86_64.rpm'
su -c 'rpm -ivh msttcorefonts-2.0-1.noarch.rpm'
  • Then run the following code to restart the font server.
su -c '/sbin/service xfs reload'

Or

su -c '/etc/init.d/xfs reload'