latest RPM binaries

http://www.apache.org/dist/httpd/binaries/rpm/x86_64/

Building RPM packages from tar.gz archives

Building RPM packages from tar.gz archives

If you are runnig a system with RPM support, the preferred way to install httpd on your system will be the creation of a nice RPM package. First you should get the current source of httpd, either as a tar.gz archive from the httpd download page

If you have downloaded a tar.gz archives of httpd, create and install the RPMs just by doing the following steps

To build the httpd package and install it do:

1.

Go to your RPM "topdir". This normally is /usr/src/redhat for the redhat distribution

% cd /usr/src/redhat

2.

Put the tar.gz archive into the SOURCES subdirectory (you have to replace "somewhere" with the real directory where the files are, of course).

% cp /somewhere/httpd-XXX.tar.gz SOURCES

3.

Extract the spec file from the archives and put it into the SPEC subdirectory.

% tar -xOzf SOURCES/httpd-XXX.tar.gz \*.spec > SPECS/httpd.spec

4.

Let rpm do the compile job and generate the rpm of httpd. If you only want to make a binary package, you can specify -bb instead of -ba, or just -bs to build only a source package.

% rpmbuild -ba SPECS/kwave.spec

5.

If everything was ok, you can install the binary rpm of httpd, it will be in the BUILD directory. If you already have a version of httpd installed, please remove it first or use the parameter -U instead of -i for upgrading instead of installing.

% rpm -ivh BUILD/[arch]/httpd-XXX.[arch].rpm or % rpm -Uvh BUILD/[arch]/httpd-XXX.[arch].rpm

installing plugins for trac

cd /tmp

#>wget http://peak.telecommunity.com/dist/ez_setup.py

#> python ez_setup.py

#> trac-admin /var/ww/trac/site.com

this will give you a trac admin shell ( you need to use the same passwd you have mentioned in /var/www/trac/.htpasswd )

>permission add siteuser TRAC_ADMIN

>permission list siteuser

the above is a one time setup now with easy_install you can install various plugins

--------------------------------------------------------------------------------------

easy_install http://svn.edgewall.com/repos/trac/plugins/0.10/webadmin

now in your /var/www/trac/site.com/conf/trac.ini add the following :

[components] webadmin.* = enabled

restart your httpd server

creating a ISO image form a dvd or cd

assuming that your cent os 5.5 dvd is on /dev/dvd we do the following

dd if=/dev/dvd of=/isos/CentOS-5.5.iso

relay mails from local server through / via gmail

In this exercise , since my mails land up in the spam folder of the
inbox whne  realyed directly  to the internet , so in this case we
relay mails through the  gmail servers.

agnello.dsouza@gmail com --> this is the main account which we use as
username: password  in /etc/postfix/sasl_passwd (smtp.gmai.com
agnello.dsouza@gmail.com:password)

We cannot use any "from address" unless mentioned in setting ==>
accounts ==> "send mail from other address" . we add the following in
the this field user1@example.com , user2@example.com ,
user3@example.com ( for enable each of these accounts gmail will send
a verification code to user1@example.com user2@example.com and
user3@example.com )

/etc/postfix/relayhost_map
@exapmle.com  smtp.gmail.com

now we understood theory we now do the postfix full setting :

we Create /etc/postfix/sasl_ passwd with auth information like this
------------------------------------------------------------------------
@example.com agnello.dsouza@gmail.com:password
# for every other domain we use
smtp.gmail.com agnello.dsouza@gmail.com:password
------------------------------------------------------------------------
postmap /etc/postfix/sasl_ passwd

the /etc/postfix/relayhost_maps has all the domains with corresponding
ISP's it relays to .
------------------------------------------------------------------------------------
@example smtp.gmail.com:587
#we could have multiple other domains here which relay via vairous
other ISP's .

------------------------------------------------------------------------------------
postmap /etc/postfix/relayhost_maps

our transport file contains the following :
gmail.com smtp:[smtp.gmail.com]:587

postmap /etc/postfix/transport

# Download the Thawte root certificates from
# <https://www.verisign.com/support/roots.html> and setup
# a certificate for Postfix.
$ firefox https://www.verisign.com/support/roots.html
$ cd ~/Downloads
$ unzip -q roots.zip
$ sudo mkdir /etc/postfix/certs
$ sudo cp ~/Downloads/Thawte\ Root\ Certificates/Thawte\ Root\
Certificates/thawte\ Premium\ Server\ CA/Thawte\ Premium\ Server\
CA.pem /etc/postfix/certs

$ sudo c_rehash /etc/postfix/certs/
Doing /etc/postfix/certs/
Thawte Premium Server CA.pem => d44d72e8.0

# Add the following lines to `/etc/postfix/main.cf`:

mydomain = server1.com
myhostname = mail.server1.com
#relayhost = smtp.gmail.com:587
relayhost = smtp.gmail.com:587
# auth
smtpd_sasl_path = smtpd
smtp_sasl_type = cyrus
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
# tls
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_map
smtpd_sasl_auth_enable = no
smtp_tls_security_level = may
smtp_tls_CApath = /etc/postfix/cert
smtpd_sasl_local_domain = $myhostname
smtp_tls_session_cache_timeout = 3600s
smtp_tls_loglevel = 1
tls_random_source = dev:/dev/urandom
smtp_use_tls = yes
smtp_sasl_tls_security_options = noanonymous
smtp_tls_note_starttls_offer = yes
smtpd_tls_received_header = yes
smtpd_sasl_application_name = smtpd
transport_maps = hash:/etc/postfix/transport

postfix stop
postfix start

sources :

http://ubuntu-tutorials.com/2008/11/11/relaying-postfix-smtp-via-smtpgmailcom/
http://trentmick.blogspot.com/2009/11/using-gmail-for-outbound-email-on-mac.html

perl script to read file and write data to other log files with regx

#!/usr/bin/perl

use strict;
use warnings;
use Data::Dumper;
my %hash;

while (my $line = <DATA> ) {
chomp($line);
$line =~ m/^(\d+_\d+_\d+);/;
$hash{$1} .= "$line\n";

}

for my $outfile (keys %hash ){
if ( -e "$outfile.log" ){
next ;
}
open (WRT,">$outfile.log") or die "cannot open file : $!";
print WRT "$hash{$outfile}";
close ( WRT ) ;
}


__DATA__
3_21_2010;11:12\\trafic info
3_21_2010;11:34\\trafic info
3_21_2010;13:21\\trafic info
3_22_2010;11:12\\trafic info
3_22_2010;11:34\\trafic info
3_22_2010;13:21\\trafic info
3_22_2010;11:12\\trafic info
3_23_2010;11:34\\trafic info
3_23_2010;13:21\\trafic info
3_23_2010;13:21\\trafic info
3_24_2010;11:12\\trafic info
3_24_2010;11:34\\trafic info
3_24_2010;13:21\\trafic info
~

perl tutorial with exercises -- 1

http://www.sthomas.net/roberts-perl-tutorial.htm

perl tutorial with exercises --

http://vsbabu.org/tutorials/perl/index.html#toc2


Other Articles

Enter your email address: