Skip to content


LAMP Optimization Tips

Below are couple of good points about LAMP optimization. I have figured that out after doing some googling and reading some PDF..

Disable unwanted Apache Modules:

  • Disable all the apache modules like perl,python,proxy etc except php,mysql which are required for your application.
  • Enable only mod_php and mod_rewrite
  • Disable everything else (java, python)

Tune MaxClients

  • Too low: you can’t serve a traffic spike
  • Too high: your memory cannot keep up with the load, and you start swapping (server dies!)

KeepAlive

  • 5 to 10 seconds
  • More than that, it ties up procesess

AllowOverrides

  • You can set to None and move Drupal’s .htaccess contents to vhosts
  • Less filesystem accesses
  • mod_gzip/mod_deflate

Compromise of CPU usage vs. Bandwidth usage

  • nginx
  • use Nginx if possible, its very fast and stable.

Mysql

  • USE MyISAM Engine wherever is possible – Its has good read speed

Query cache

  • Probably the most important thing to tune
  • Table cache
  • Also important Key buffer

PHP

  • Use a recent version
  • Install an Op­code cache / Accelerator
  • eAccelerator
  • APC
  • Xcache
  • Zend (commerical)

Op­code cache Benefits

  • Dramatic speed up of applications, specially complex ones like Drupal
  • Significant decrease in CPU utilization
  • Considerable decrease in memory utilization
  • The biggest impact on a busy site
  • Drawbacks:
  • May crash often
  • Use logwatcher to auto restart Apache

Note: eAccelerator uses the least memory and provides the most speed

Hope above point helps you in understanding what is important for your environment.

Posted in Linux.


Install and Configure Bandwidthd – IP Bandwidth Monitor

It is important to know traffic usage of your client if you’re a Linux network administrator.

You can monitor your client in text mode, graphic mode or html exported like mrtg, cacti

but bandwidthd is very good bandwidth monitoring tool…………..

You don’t need any database or snmp connection to monitor all of your client on bandwidthd,

all you need just libcap, libpng, libgd and apache installed on your Linux system. And other

good news is bandwidthd monitor all of your connected client per IP and per connection protocol.

Link to the download area on SourceForge: Download BandwidthD

[root@Ryan]# tar xvfz bandwidthd-2.0.1.tgz

[root@Ryan]# cd bandwidthd

Configure and install the Bandwidthd source:

[root@Ryan]# ./configure && make install

Please make sure you have:
libpcap from http://www.tcpdump.org/
libpng from http://www.libpng.org/
libgd from http://www.boutell.com/gd/

Or

# yum install libbap Or # apt-get install libcap

# yum install libpng Or # apt-get install libpng

# yum install apache Or # apt-get install apache2

Edit /usr/local/bandwidthd/etc/bandwidthd.conf

to suit your network environment. …..
Save your config and start bandwidthd using /usr/local/bandwidthd/bandwidthd.

Point your Apache Virtual Host to

/usr/local/bandwidthd/htdocs for browse
the bandwidthd graph

Alias /bandwidthd “/usr/local/bandwidthd/htdocs”

Order Allow,Deny
Allow from All

Save your work and restart apache. Next open your browser and point to http://yourserverip/bandwidth.

Posted in Linux.


Ten Qualities of an Effective Team Player

If you were choosing team members for a business team in your organization, who would the best team players be? Assuming that people have the right technical skills for the work to be done, what other factors would you use to select your team members?
Teams need strong team players to perform well. But what defines such people? Read on. (Also, check out How to Hire the Best Brains for the Best Team for some tips on putting a team together.)
Demonstrates reliability
You can count on a reliable team member who gets work done and does his fair share to work hard and meet commitments. He or she follows through on assignments. Consistency is key. You can count on him or her to deliver good performance all the time, not just some of the time.
Communicates constructively
Teams need people who speak up and express their thoughts and ideas clearly, directly, honestly, and with respect for others and for the work of the team. That’s what it means to communicate constructively. Such a team member does not shy away from making a point but makes it in the best way possible — in a positive, confident, and respectful manner.
Listens actively
Good listeners are essential for teams to function effectively. Teams need team players who can absorb, understand, and consider ideas and points of view from other people without debating and arguing every point. Such a team member also can receive criticism without reacting defensively. Most important, for effective communication and problem solving, team members need the discipline to listen first and speak second so that meaningful dialogue results.
Functions as an active participant
Good team players are active participants. They come prepared for team meetings and listen and speak up in discussions. They’re fully engaged in the work of the team and do not sit passively on the sidelines.
Team members who function as active participants take the initiative to help make things happen, and they volunteer for assignments. Their whole approach is can-do: “What contribution can I make to help the team achieve success?”
Shares openly and willingly
Good team players share. They’re willing to share information, knowledge, and experience. They take the initiative to keep other team members informed.
Much of the communication within teams takes place informally. Beyond discussion at organized meetings, team members need to feel comfortable talking with one another and passing along important news and information day-to-day. Good team players are active in this informal sharing. They keep other team members in the loop with information and expertise that helps get the job done and prevents surprises.
Cooperates and pitches in to help
Cooperation is the act of working with others and acting together to accomplish a job. Effective team players work this way by second nature. Good team players, despite differences they may have with other team members concerning style and perspective, figure out ways to work together to solve problems and get work done. They respond to requests for assistance and take the initiative to offer help.
Exhibits flexibility
Teams often deal with changing conditions — and often create changes themselves. Good team players roll with the punches; they adapt to ever-changing situations. They don’t complain or get stressed out because something new is being tried or some new direction is being set.
In addition, a flexible team member can consider different points of views and compromise when needed. He or she doesn’t hold rigidly to a point of view and argue it to death, especially when the team needs to move forward to make a decision or get something done. Strong team players are firm in their thoughts yet open to what others have to offer — flexibility at its best.
Shows commitment to the team
Strong team players care about their work, the team, and the team’s work. They show up every day with this care and commitment up front. They want to give a good effort, and they want other team members to do the same.
Works as a problem-solver
Teams, of course, deal with problems. Sometimes, it appears, that’s the whole reason why a team is created — to address problems. Good team players are willing to deal with all kinds of problems in a solutions-oriented manner. They’re problem-solvers, not problem-dwellers, problem-blamers, or problem-avoiders. They don’t simply rehash a problem the way problem-dwellers do. They don’t look for others to fault, as the blamers do. And they don’t put off dealing with issues, the way avoiders do.
Team players get problems out in the open for discussion and then collaborate with others to find solutions and form action plans.
Treats others in a respectful and supportive manner
Team players treat fellow team members with courtesy and consideration — not just some of the time but consistently. In addition, they show understanding and the appropriate support of other team members to help get the job done. They don’t place conditions on when they’ll provide assistance, when they’ll choose to listen, and when they’ll share information. Good team players also have a sense of humor and know how to have fun (and all teams can use a bit of both), but they don’t have fun at someone else’s expense. Quite simply, effective team players deal with other people in a professional manner.
Team players who show commitment don’t come in any particular style or personality. They don’t need to be rah-rah, cheerleader types. In fact, they may even be soft-spoken, but they aren’t passive. They care about what the team is doing and they contribute to its success — without needing a push.
Team players with commitment look beyond their own piece of the work and care about the team’s overall work. In the end, their commitment is about winning — not in the sports sense of beating your opponent but about seeing the team succeed and knowing they have contributed to this success. Winning as a team is one of the great motivators of employee performance. Good team players have and show this motivation.

Read more: http://www.dummies.com/how-to/content/ten-qualities-of-an-effective-team-player.html#ixzz1SqYRjXga

Posted in Soldier of Fortune.


How to Upgrade SugarCRM-5.2.0 to 6.2.0

Introduction

Pre-Requistes:
Apache-2.2.x
PHP-5.2.x
Mysql-5.x

SugarCRM can not be upgraded directly from version 5.2.x to 6.2.x. Its a multistep process. You have to upgrade SugarCRM to version 5.5.zx then from 5.5.x to 6.2.x. Below is the outlined procedure for that.

Step1: Check the server for Apache,PHP and MySQL version. (My server was having lower versions so I had to upgrade php and mysql before upgrading SugarCRM)
Step2: Login to SugarCRM with admin user or same access level user.
Step3: Click on Admin link
Step4: Scroll down and Click on Upgrade Wizard
Step5: Click Next, Next, when it asked for upload upgrade file go to http://www.sugarforge.org/frs/?group_id=6 website and download the suitable file according to your current version. I have download all the below files once as to avoid download them again and again.

http://www.sugarforge.org/frs/download.php/6547/SugarCE-5.2.0l.zip
http://www.sugarforge.org/frs/download.php/6589/SugarCE-Upgrade-5.2.0-to-5.5.1.zip
http://www.sugarforge.org/frs/download.php/6591/SugarCE-Upgrade-5.5.1RC-to-5.5.1.zip
http://www.sugarforge.org/frs/download.php/8046/SugarCE-Upgrade-5.5.1-to-6.0.4.zip
http://www.sugarforge.org/frs/download.php/8163/SugarCE-Upgrade-6.0.x-to-6.2.0.zip

Step6: After upload the suitable file complete the steps and on last step it will give you link of “DONE”. Click on that and logout
Step7: Repeat the step4 to step6 again for upgrade to 5.5.1 to 6.0.4 and one more time for 6.0.4 to 6.2.0

Posted in Linux.


Vsftpd with SSL

Introduction:
Few days back one of customer asked to have more security on their data transfer via ftp. I have heard of encryption,SSL and all. I know how to build the CA and create the certificates but don’t know how to integrate it with VSFTPD or alternatively I can say that I did not get such requirement. Vsftpd with SSL is pretty straight forward and very easy to configure just create the self sign certificate just like i did, if you can not buy the trusted certificate from registered CA. Procedure to configure the vsftpd with SSL supports is as given below:

vsftpd is the default FTP server supplied with CentOS. It should be installed by default (?) If it isn’t you may install it by one of these methods:
Using yum (if you’ve installed yum):
Install VSFTPD:

[root@Gladiator]#yum install vsftpd

Generate a Certificate:
You use OpenSSL to generate a certificate for vsftpd. The certificate is store on your server, in a location of your choice. Here I choose to put it in the /etc/vsftpd directory. As well, you specify a ‘lifetime’ for the certificate; here’s it set for a year (“-days 365″).
Note that the backslashes only signify line breaks. You should be able to copy/paste & run it as it is, or remove the backslashes and the line breaks. You may need to create this directory first (mkdir /etc/vsftpd).

[root@Gladiator]#openssl req -x509 -nodes -days 365 -newkey rsa:1024 \
 -keyout /etc/vsftpd/vsftpd.pem \
 -out /etc/vsftpd/vsftpd.pem

You will be prompted with a series of question, which you answer as they appear. When done the certificate will be installed in the /etc/vsftpd directory.
Configure vsftpd:
To configure vsftpd you edit the file /etc/vsftpd/vsftpd.conf and add the following lines:

ssl_enable=YES
allow_anon_ssl=NO
force_local_data_ssl=NO
force_local_logins_ssl=YES
ssl_tlsv1=YES
ssl_sslv2=NO
ssl_sslv3=NO
rsa_cert_file=/etc/vsftpd/vsftpd.pem

Restart vsftpd for these settings to take effect:

[root@Gladiator]#/etc/rc.d/init.d/vsftpd restart

”’NOTE:”’If you set “force_local_logins_ssl=YES” then your clients will be required to use an FTP client that supports AUTH TLS/SSL in order to connect. If you leave it at “NO” then people can connect securely or insecurely.

Posted in Linux.


Installing and configuring mod_jk

Intorduction
Installation of Mod_jk is not that hard but to make it work or integrate with apache and tomcat a bit tricky. I am explaining here how to install and configure apache to serve the java pages or webapps with the help of mod_jk module.

Scenario
Let me brief my scenario here, yours may be different. You can take the refference from here. I am having app1 and app2 and i want URL http://www.aap1.com to serve the pages from app1 tomcat webapp and http://www.app2.com serve the pages from app2 tomcat webapp. Also you need to take care for the tomcat port also, if you want to use two tomcat instace you you have to use the two diff ports like i am using. app1 is on 8080 port and app2 is on 8081 port.

You can install apache and tomcat via yum if you are using Redhat/CentOS distro and if you are using any Debian based system you can use apt-get/aptitude utility for the same.
I am explaining here on CentOS-5.4 disto

#yum install httpd
#/etc/init.d/httpd restart
#chkconfig httpd on

Now its time to install mod_jk, i am using here the rpm package you can even compile it from source as well.
http://mirrors.dotsrc.org/jpackage/1.7/redhat-el-5.0/free/RPMS/
or
You can download it from centOS testing repo.

http://dev.centos.org/centos/5/testing/i386/RPMS/

#wget http://mirrors.dotsrc.org/jpackage/1.7/redhat-el-5.0/free/RPMS/mod_jk-ap20-1.2.26-1jpp.i386.rpm
or
#wget http://dev.centos.org/centos/5/testing/i386/RPMS/mod_jk-ap20-1.2.28-2.el5.centos.i386.rpm

#rpm -ivh mod_jk-ap20-1.2.26-1jpp.i386.rpm or
#rpm -ivh  mod_jk-ap20-1.2.28-2.el5.centos.i386.rpm

Now its time to install tomcat. You can install it via yum or compile it from source. I am using the source here.

Get the tar.gz for Tomcat 5.5 — you can download it from the Apache Tomcat download site(http://tomcat.apache.org/download-55.cgi). I am using tomcat-5.5 version you can use the latest release also.

Unpack apache-tomcat-5.5.23.tar.gz under /usr/local. Rename apache-tomcat-5.5.23 to tomcat8080. Unpack the tar.gz one more time, rename it to tomcat8081.

cd /usr/local/tomcat8081/conf
- edit server.xml and change following ports:
8005 (shutdown port) -> 8006
8080 (non-SSL HTTP/1.1 connector) -> 8081
8009 (AJP 1.3 connector) -> 8010

There are other ports in server.xml, but I found that just changing the 3 ports above does the trick.

I won’t go into the details of getting the 2 Tomcat instances to run. You need to create a tomcat user, make sure you have a Java JDK or JRE installed, etc., etc.
One more thing i want to mention here, you have to set JAVA_HOME variable set to make the java application to find the exact JRE/JAVA location. If you want to set them system wide then mention that variable in /etc/profile file instead if ‘export’ on shell.

The startup/shutdown scripts for Tomcat are /usr/local/tomcat808X/bin/startup.sh|shutdown.sh.

I will assume that at this point you are able to start up the 2 Tomcat instances. The first one will listen on port 8080 and will have an AJP 1.3 connector (used by mod_jk) listening on port 8009. The second one will listen on port 8081 and will have the AJP 1.3 connector listening on port 8010.

I am assuming that you are well aware, how to deploy the tomcat apps.So i am skipping that section. Please write me at ramesh.mimit@gmail.com if you want to have a chapter on this as well.

Create Apache virtual hosts for www.myapp1.com and www.myapp2.com and tie them to the 2 Tomcat instances via mod_jk.

Here is the general mod_jk section in httpd.conf — note that it needs to be OUTSIDE of the virtual host sections:

#
# Mod_jk settings
#
# Load mod_jk module
LoadModule    jk_module  modules/mod_jk.so
# Where to find workers.properties
JkWorkersFile conf/workers.properties
# Where to put jk logs
JkLogFile     logs/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel    emerg
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat     "%w %V %T"

Note that the section above has an entry called JkWorkersFile, referring to a file called workers.properties, which I put in /etc/httpd/conf. This file contains information about so-called workers, which correspond to the Tomcat instances we’re running on that server. Here are the contents of my workers.properties file:

#
# This file provides minimal jk configuration properties needed to
# connect to Tomcat.
#
# The workers that jk should create and work with
#

workers.tomcat_home=/usr/local/tomcat8080
workers.java_home=/usr/lib/jvm/java
ps=/
worker.list=app1, app2

worker.app1.port=8009
worker.app1.host=localhost
worker.app1.type=ajp13
worker.app1.lbfactor=1

worker.app2.port=8010
worker.app2.host=localhost
worker.app2.type=ajp13
worker.app2.lbfactor=1

The file declares 2 workers that I named app1 and app2. The first worker corresponds to the AJP 1.3 connector running on port 8009 (which is part of the Tomcat instance running on port 8080), and the second worker corresponds to the AJP 1.3 connector running on port 8010 (which is part of the Tomcat instance running on port 8081).

The way Apache ties into Tomcat is that each of the VirtualHost sections configured for www.app1.com and www.app2.com declares a specific worker. Here is the VirtualHost section I have in httpd.conf for www.app1.com:


ServerName www.app1.com
DocumentRoot "/usr/local/tomcat8080/webapps/ROOT"

  # Options Indexes FollowSymLinks MultiViews
  Options None
  AllowOverride None
  Order allow,deny
  allow from all

ErrorLog logs/app1-error.log
CustomLog logs/app1-access.log combined
# Send ROOT app. to worker named app1
JkMount  /* app1
RewriteEngine On
RewriteRule ^/(images/.+);jsessionid=\w+$ /$1

The 2 important lines as far as the Apache/mod_jk/Tomcat configuration is concerned are:

JkMount /* app1

The line “JkMount /* app1″ tells Apache to send everything to the worker app1, which then ties into the Tomcat instance on port 8080.

The line “JkUnMount /images/* app1″ tells Apache to handle everything under /images itself — which was one of our goals.

At this point, you need to restart Apache, for example via ‘sudo service httpd restart’. If everything went well, you should be able to go to http://www.myapp1.com and http://www.myapp2.com and see your 2 Web applications running merrily.

You may have noticed a RewriteRule in each of the 2 VirtualHost sections in httpd.conf. What happens with many Java-based Web application is that when a user first visits a page, the application does not know yet if the user has cookies enabled or not, so the application will use a session ID mechanism fondly known as jsessionid. If the user does have cookies enabled, the application will not use jsessionid the second time a page is loaded. If cookies are not enabled, the application (Tomcat in our example) will continue generating URLs such as

http://www.myapp1.com/images/myimage.gif;jsessionid=0E45D13A0815A172BD1DC1D985793D02

In our example, we told Apache to process all URLs that start with ‘images’. But those URLs have already been polluted by Tomcat with jsessionid the very first time they were hit. As a result, Apache was trying to process them, and was failing miserably, so images didn’t get displayed the first time a user hit a page. If the user refreshed the page, images would get displayed properly (if the user had cookies enabled).

The solution I found for this issue was to use a RewriteRule that would get rid of the jsessionid in every URL that starts with ‘images’. This seemed to do the trick.

That’s about it. I hope this helps somebody

Posted in Linux.


Recovering deleted data from ext3 filesystem on linux

Scenario:

Linux machine with/home having ext3 type of filesystem.
You have welcome.jpg file in /home/test. And you have deleted it by “rm -f ” command.
Now we will recover that welcome.jpg
Required Tools: debugfs, foremost & blkls

Step 1. –> Check which Filesystem /home is.

 Gladiator:~ # df -h
    Filesystem    Size     Used     Avail     Use%      Mounted on
    /dev/sda       2 7.8G   5.3G     2.2G      71%          /
    udev              122M    168K    121M       1%         /dev
    /dev/sda3      12G       158M    11G         2%         /home 

So we got Filesystem ID – /dev/sda3

Step 2. –> Debugfs to get necessary information
The debugfs program is an interactive file system debugger that is installed by default with most common Linux distributions. This program is used to manually examine and change the state of a filesystem. In our situation, we’re going to use this program to determine the inode which stored information about the deleted file and to what block group the deleted file belonged.

  Gladiator:~ # debugfs /dev/sda3
    debugfs 1.41.1 (01-Sep-2008)
    debugfs:  cd test
    debugfs:  ls -d
    32769  (12) .    2  (4084) ..   <32770> (4072) welcome.jpg    ---> Here we got Inode number which is in RED

The next command we want to run is imap, giving it the inode number above so we can determine to which block group the file belonged. We see by the output that it belonged to block group 4.

debugfs:  imap <32770>
    Inode 32770 is part of block group 4    -----------> Here we got block group no. ---> BG
    located at block 131074, offset 0x0100

Running the stats command will generate a lot of output. The only data we are interested in from this list, however, is the number of blocks per group. In this case, and most cases, its 32768. Now we have enough data to be able to determine the specific set of blocks in which the data resided. We’re done with debugfs now, so we type q to quit.

debugfs: stats
    << lots of content>>
    Blocks per group:         32768   ---> BPG
    <>
    debufs: q    -------> To quit debugfs

Step 3. –> Recovering data in dat format.

The next thing we need to do is pull all unallocated blocks from block group 56 so we can examine their content. The blkls program, from The Sleuth Kit (TSK), allows us to do just that. We simply need to know the device file, a range of blocks, and have enough space in the appropriate place to output this data. Using the information above, we can calculate the block range by multiplying the block group number and the block group size and then multiplying the block group number plus one by the blocks per group minus one. In this case, the formula would look like this:

(BG * BPG) through ((BG + 1) * BPG -1)

In above example, it will look like:
BPG –> 32768
BG –> 4
(4 * 32768) through ((4+1) * 32768 -1)
131072 through 163839

    So now need to give following command:
 Gladiator:~ # blkls /dev/sda3 131072-163839 > /root/block.dat

Step 4. –> Recovering file from dat file using “Foremost” tool

Create output directory first.
    linux-remo:~ # mkdir /root/output
    linux-remo:~ # foremost -dv -t jpg -o /root/output/ -i /root/block.dat 

Foremost version 1.5.6 by Jesse Kornblum, Kris Kendall, and Nick Mikus
Audit File

oremost started at Sat Sep 26 12:11:59 2009
Invocation: foremost -dv -t jpg -o /root/output/ -i /root/block.dat
Output directory: /root/output
Configuration file: /usr/local/etc/foremost.conf
Processing: /root/block.dat
|——————————————————————
File: /root/block.dat
Start: Sat Sep 26 12:11:59 2009
Length: 125 MB (132108288 bytes)

Num Name (bs=512) Size File Offset Comment

0: 00012272.jpg 65 KB 6283264 (IND BLK bs:=4096)
**|
Finish: Sat Sep 26 12:12:03 2009

1 FILES EXTRACTED
jpg:= 1
——————————————————————

Foremost finished at Sat Sep 26 12:12:03 2009

And here we got the jpg file in /root/output directory. Filename will be different that original. But content will be same.

Comparing size only works, of course, if you “know your data”. Integrity checking programs such as Tripwire play a big role in a recovery operation as you can identify the recovered data without ever inspecting the content, as well as verify its integrity. This becomes quite useful if the information you’re attempting to recover is confidential and you are not authorized to view the data.

File formats supported by Foremosts are jpg, gif, png, bmp, avi, exe, mpg, wav, riff, wmv, mov, pdf, ole, doc, zip, rar, htm, and cpp. If you need to recover data beyond these built-in data types, you will need to define custom types in Foremost’s configuration file foremost.conf.

NOTE: All credit goes to Neelesh Gurjar who has been posted the same article here: http://www.linuxforums.org/articles/recovering-deleted-files-from-ext3-partition-in-linux_724.html

Posted in Linux.


Configure the Network Interface in Unix

Configuring a Solaris network interface may be necessary because it needs to be reconfigured on the fly without a reboot. Fortunately, the process to configure a Solaris network interface is relatively simple. Once the Solaris network interface is configured and activated, it allows the Solaris system to communicate on the network.

Please follow the below mentioned steps to configure your network interface via DHCP or STATIC

For DHCP

ifconfig e1000g0 dhcp start
ifconfig e1000g0 dhcp status

If you want to release the existing IP

ifconfig e1000g0 dhcp release

To check the IP you can use the ifconfig -a command and for nameserver settings use cat /etc/resolve.conf’ command.

For STATIC IP

STEP 1: Type “ifconfig -a“. The output lists two types of network interfaces. One of them is lo0, which is the loop-back network interface and not used to connect to the network. The rest of the ifconfig listing displays all available network interfaces. Some possible names for the network interface include ce0, hme0,be0, le0,e1000g0(in intel based machines) and ge0. Use the information from ifconfig to find the name of the Solaris network interface you want to configure.

STEP 2: Type “ifconfig e1000g0 plumb” where e1000g0 is the Solaris network interface that you want to configure. This command initializes the Solaris network interface.

STEP 3: Type “ifconfig e1000g0 192.168.1.10 netmask 255.255.255.0” to configure the le0 Solaris network interface. In this example, e1000g0 is the name of the network interface, 192.168.1.10 is the IP address of the Solaris system and 255.255.255.0 is the netmask.

STEP 4: Type “ifconfig e1000g0 up” to activate the Solaris network interface and put the Solaris system on the network.

Persistent IPv4 Configuration

In order to have the system configure our NIC at boot, the first step is to get an IP address and subnet mask.
Add a line to the /etc/hosts file for our new card:

192.168.2.100		host1.linuxtrove.com		host1

Now, we create a file in /etc that is named hostname. For example, our first NIC’s file is /etc/hostname.e1000g0
In this file, we will put the name associated with the IP (as found in the /etc/hosts file). It should be the first name in the /etc/hosts file. In our scenario, /etc/hostname.e1000g0 should contain:

host1.linuxtrove.com

Then we edit the /etc/netmasks file for our new network:

192.168.2.0	255.255.255.0

Reboot the system, and your network card has been configured for the new network with the proper subnet mask. You can check it by running an ifconfig -a again:

lo0: flags=1000849 mtu 8232 index 1
        inet 127.0.0.1 netmask ff000000
e100g0: flags=1000843 mtu 1500 index 2
        inet 192.168.1.100 netmask ffffff00 broadcast 192.168.1.255
        ether

Posted in Linux.


Bugzilla Installation on Ubuntu System

Installation checklist

  1. Perl 5.8.1 or above – this usually comes with Ubuntu 8.04 or above by default.
  2. MySQL Server
  3. Apache Web Server 1.3.x or 2.x

Install the required packages

  1. For MySQL, do apt-get install mysql-server mysql-client

  2. For Apache, do apt-get install apache2 apache2-common

  3. For Perl Modules, there’s a long list. Do the following
apt-get install libchart-perl perlmagick libgd-gd2-perl
libgd-graph-perl libgd-text-perl libnet-ldap-perl
libtemplate-perl-doc libtemplate-plugin-gd-perl
libappconfig-perl libconvert-binhex-perl libfile-temp-perl
libio-stringy-perl libmailtools-perl libmime-perl libmime-tools-perl
libtemplate-perl libtimedate-perl libemail-send-perl
libemail-mime-perl libemail-mime-modifier-perl libdbd-pg-perl
libauthen-sasl-perl libsoap-lite-perl libhtml-scrubber-perl
libemail-mime-contenttype-perl libemail-mime-encodings-perl
libapache2-mod-perl2

4. Extract the bugzilla tar ball into /var/www directory and rename the directory name to bugzilla
5.
Change the ownership of the directory and files to www-data by using
chown www-data /var/www/bugzilla/ -R
6. Go into /var/www/bugzilla and run the following

./checksetup.pl --check-modules 

It will list out all the modules which have been installed and the

On Ubuntu 8.04, an old perl-cgi module is there (version 3.15)
whereas bugzilla 3.2.2 requires 3.21 or above. Do the following to update it
  • Download the file CGI.pm-3.42.tar.gz

  • The following commands to be used
cd /tmp
tar -zxf CGI.pm-3.42.tar.gz
cd CGI.pm-3.42
perl Makefile.PL       # to configure the file
make                   # to compile the file
make test              # to test if the compilation has been okay
make install           # to install the module CGI version 3.42

optional modules which you can install. Use your own discretion.

Posted in Linux.


How to Install a Puppet Master and Client Server

Puppet is an open-source next-generation server automation tool. It is composed of a declarative language for expressing system configuration, a client and server for distributing it, and a library for realizing the configuration.

Setup the EPEL repos for Centos – choose the correct package depending on your installation.

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm

Install puppet-server

yum install puppet-server

The 1.8.5 branch of Ruby shipped will RHEL5 can exhibit memory leaks. So install ruby 1.8.6++ (I did not on this server as it was test not a production server).

Install the help docs

yum install ruby-rdoc

Create a manifest file at /etc/puppet/manifests/default.pp

vi /etc/puppet/manifests/default.pp

put this in it

# Create “/tmp/testfile” if it doesn’t exist.

class test_class {

    file { “/tmp/testfile”:

       ensure => present,

       mode   => 644,

       owner  => root,

       group  => root

    }

}

# tell puppet on which client to run the class

node pclient {

    include test_class

}

Start the puppet server

service puppetmaster start

Enable start on boot

chkconfig puppetmaster on

Now to install the Puppet Client on another server

Setup the EPEL repos for Centos – choose the correct package depending on your installation.

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5Server/x86_64/epel-release-5-3.noarch.rpm

or

rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm

Install puppet

yum install puppet

Setup puppet client to generate its own certificate request to the server

/etc/init.d/puppet once -v

Sign the certificate request on the puppet master server. Use puppetca –list to see if any are available to sign.

puppetca –sign puppet01

Puppet01 must be the fully qualified domain name (FQDN) of you client server.

Run this on the client server again to retrieve the certificate

/etc/init.d/puppet once -v

Make the puppet start with the system

chkconfig puppet on

Make sure it is working on the client server.

puppet –test

You should see a dialog that creates the file /tmp/testfile

Posted in Linux.




I'm happy to use Increase Sociability.