Showing posts with label Computers Network Unix. Show all posts
Showing posts with label Computers Network Unix. Show all posts

Friday, June 8, 2012

Installing Spamassassin Postfix/Dovecot on FreeBSD 8.2


I decided to install SpamAssassin in my email server. Actually, I already using spamcop, for at least more than 6 months our email server never get SPAM, fight using header_check, upgrading to pcre support. Well now I need install SpamAssassin.

On 2012 until this day we got huge traffic email. I have to protect the users from SPAM.

Email Traffic

Mails successfully sent

1,028,599448.49 GB
(457.2 KB/Mails)
Mails failed/refused

936,17323.55 GB


First, I upgrade my ports collections using cvsup.
#cvsup –L 2 port-supfiles
My old perl version is 5.8, so I have to upgrade to new one.
Don’t forget to read the UPDATING in /usr/ports/UPDATING (20110517)
This file, will explain many thinks.
#cd /usr/ports/mail/p5-Mail-SpamAssassin
#make clean
#make install

And I got these error :

NOTE: the optional HTTP::Date module is not installed.

  The "sa-update" program requires this module to make HTTP
  If-Modified-Since GET requests.

REQUIRED module missing: HTML::Parser
REQUIRED module missing: Net::DNS
REQUIRED module missing: NetAddr::IP
optional module missing: Digest::SHA1
optional module missing: Mail::SPF
optional module missing: IP::Country
optional module missing: Razor2
optional module missing: Net::Ident
optional module missing: IO::Socket::INET6
optional module missing: IO::Socket::SSL
optional module missing: Mail::DKIM
optional module missing: DBI
optional module missing: LWP::UserAgent
optional module missing: HTTP::Date

warning: some functionality may not be available,
please read the above report before continuing!

Can't open Makefile: No such file or directory.
===>  Building for p5-Mail-SpamAssassin-3.3.2_6
make: cannot open Makefile.
*** Error code 1
Stop in /usr/ports/mail/p5-Mail-SpamAssassin.
*** Error code 1
Stop in /usr/ports/mail/p5-Mail-SpamAssassin.


So I have to install perl module.
#perl –MCPAN –e shell
….
cpan[1]> install HTML::Parser Net::DNS NetAddr::IP Digest::SHA1 Mail::SPF IP::Country Razor2 Net::Ident IO::Socket::INET6 IO::Socket::SSL Mail::DKIM DBI LWP::UserAgent HTTP::Date
#cd /usr/ports/mail/p5-Mail-SpamAssassin
#make clean  (Don’t forget always make clean after getting error)
#make install
Some package maybe just already installs with older version, just make deinstall, make clean then, start again.

sa-update now places state files in /var/db/spamassassin and not
/var/lib/spamassassin.  This is to be consistant with Freebsd file
directory conventions.

If you run sa-compile, you will notice that files are in
/var/db/spamassassin/compiled// instead of
/var/db/spamassassin/compiled/.
No attempts have been made to move old versions over. You must recomp            ile.

If you are running with spamd, you must add the following to rc.conf:
spamd_enable="YES"

Security Note:  If you did NOT deselected AS_ROOT, spamd will be runn            ing
as root. To change this, also add this to rc.conf:
spamd_flags="-u spamd -H /var/spool/spamd"
===> Correct pkg-plist sequence to create group(s) and user(s)
===>   Compressing manual pages for p5-Mail-SpamAssassin-3.3.2_6
===>   Running ldconfig
/sbin/ldconfig -m /usr/local/lib
===>   Registering installation for p5-Mail-SpamAssassin-3.3.2_6
# netstat -a |grep LISTEN
tcp4       0      0 localhost.783          *.*                    LISTEN
….
Before configure main.cf and master.cf please READ CAREFULLY this http://www.postfix.org/FILTER_README.html

Spamassasin configuration local.cf

rewrite_header Subject **SPAM**
required_score 6.0
report_safe 1
use_bayes 1
bayes_path /var/spool/spamd/.spamassassin/bayes
skip_rbl_checks 0
use_razor2 0
use_dcc 0
use_pyzor 0
dns_available yes
header LOCAL_RCVD Received =~ /.*\(\S+\.mydomain\.com\s+\[.*\]\)/
describe LOCAL_RCVD Received: from mydomain.com
score LOCAL_RCVD -50
score BAYES_99 4.300
score BAYES_90 3.500
score BAYES_80 3.000


I want to pool, all spam to one email account.here is  a script :

filter.sh
#!/bin/sh
#Filter Script
SENDMAIL="/usr/sbin/sendmail -i"
EGREP=/usr/bin/egrep

EX_UNAVAILABLE=69
SPAMLIMIT=6
 

trap "rm -f /var/spool/spamd/filter/out.$$" 0 1 2 3 15
cat | /usr/local/bin/spamc -u spamd | sed 's/^\.$/../' > /var/spool/spamd/filter                      /out.$$

if $EGREP -q "^X-Spam-Level: \*{$SPAMLIMIT,}" < /var/spool/spamd/filter/out.$$
then
   $SENDMAIL spampooler@mydomain.com < /var/spool/spamd/filter/out.$$
else
  $SENDMAIL "$@" < /var/spool/spamd/filter/out.$$
fi


exit $?

edit the master.cf
#smtp      inet  n       -       n       -       -       smtpd
smtp      inet  n       -       n       -       -       smtpd
#        -o content_filter=filter:dummy
         -o content_filter=spamassassin:dummy
#
#SPAMFILTERi/SPAMASSASSIN
spamassassin    unix  -       n       n       -       10      pipe
    flags=Rq user=spamd argv=/usr/sbin/filter.sh -f ${sender} -- ${recipient}
maillog

Jun  8 16:52:36 blade postfix/qmgr[49965]: C8F22F7550: from=, size=1345, nrcpt=1 (queue active)
Jun  8 16:52:36 blade postfix/smtpd[96866]: disconnect from smtp.example.com[10.1.1.201]
Jun  8 16:52:36 blade spamd[86197]: spamd: connection from localhost [127.0.0.1] at port 17055
Jun  8 16:52:36 blade spamd[86197]: spamd: processing message <4FD1CB80.6080506@example.com> for spamd:58
Jun  8 16:52:36 blade spamd[86197]: spamd: clean message (-2.9/6.0) for spamd:58 in 0.1 seconds, 1353 bytes.
Jun  8 16:52:36 blade spamd[86197]: spamd: result: . -2 - ALL_TRUSTED,BAYES_00,T_RP_MATCHES_RCVD scantime=0.1,size=1353,user=spamd,uid=58,required_score=6.0,rhost=localhost,raddr=127.0.0.1,rport=17055,mid=<4FD1CB80.6080506@example.com>,bayes=0.000000,autolearn=ham
Jun  8 16:52:37 blade postfix/pickup[94779]: 002A3F7574: uid=58 from=
Jun  8 16:52:37 blade postfix/cleanup[97102]: 002A3F7574: message-id=<4FD1CB80.6080506@example.com>
Jun  8 16:52:37 blade postfix/pipe[97103]: C8F22F7550: to=, relay=spamassassin, delay=0.18, delays=0.02/0/0/0.16, dsn=2.0.0, status=sent (delivered via spamassassin service)
Jun  8 16:52:37 blade postfix/qmgr[49965]: C8F22F7550: removed
Jun  8 16:52:37 blade spamd[1622]: prefork: child states: II
Jun  8 16:52:37 blade postfix/qmgr[49965]: 002A3F7574: from=, size=1683, nrcpt=1 (queue active)
Jun  8 16:52:37 blade postfix/virtual[97142]: 002A3F7574: to=, relay=virtual, delay=0.13, delays=0.06/0/0/0.07, dsn=2.0.0, status=sent (delivered to maildir)
Jun  8 16:52:37 blade postfix/qmgr[49965]: 002A3F7574: removed


Header

Subject: **SPAM** =?GB2312?B?16jStcPYyunQ0NX+yMvUsby8xNzM4cn9?=
Date: Thu, 7 Jun 2012 05:44:11 +0800
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on
     smtp.mydomain.com
X-Spam-Flag: YES
X-Spam-Level: **************
X-Spam-Status: Yes, score=15.0 required=6.0 tests=BAYES_99,DOS_OE_TO_MX,
     FORGED_MUA_OUTLOOK,MISSING_MID,RCVD_IN_BRBL_LASTEXT,RCVD_IN_PSBL,
     RCVD_IN_SORBS_WEB,RDNS_NONE,TO_NO_BRKTS_MSFT autolearn=spam version=3.3.2
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----------=_4FCFCF20.8B19D0B7"
Message-Id: <20120606214400.8012FF7551@smtp.mydomain.com>
















Monday, November 21, 2011

Splunk Log Management

Here is the example of logging using Splunk.
(Splunk is enterprise software used to monitor, report and analyze the machine data produced by the applications, systems and infrastructure that run a business,http://en.wikipedia.org/wiki/Splunk.)

I am running Solaris
bash-3.00# uname -a
SunOS atlas.haritamineral.com 5.10 Generic_141445-09 i86pc i386 i86pc
bash-3.00#

Using syslog for logging jetty log.
The configuration of log4j.properties looks like:
log4j.rootCategory=INFO, CONSOLE, LOGFILE, SYSLOG

log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender
log4j.appender.SYSLOG.Threshold=INFO
log4j.appender.SYSLOG.Target=com.haritamineral
log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout
log4j.appender.SYSLOG.layout.ConversionPattern=%d{dd/MMM/yy HH:mm:ss} %5p %t %c{1}:%L - %m%n
log4j.appender.SYSLOG.SyslogHost=localhost
log4j.appender.SYSLOG.Facility=Local2
log4j.appender.SYSLOG.FacilityPrinting=true

and the syslog.conf in /etc
I Just add one line
#jetty
local2.info @master.haritamineral.com

Where is master.haritamineral.com is splunk server that listen logging UDP and TCP running on port 514.

for restart, disable, enable the syslog is using svcadm command.
#svcadm restart system-log

First try, I am getting error :

Nov 21 14:34:25 atlas.haritamineral.com syslogd: line 20: unknown priority name

After googling, that my mistakes is using of space instead of TAB key.

as you can see you can see my log4j in my jetty applications in Splunk Log Management.

Tuesday, November 16, 2010

Superkomputer China Resmi Kalahkan Amerika

Superkomputer China Resmi Kalahkan Amerika
Senin, 15 November 2010 | 22:15 WIB
Superkomputer buatan China yang diberi nama Tianhe-1A berlokasi di National Supercomputer Center, Tianjin.
TERKAIT


BEIJING, KOMPAS.com — China secara resmi mencatatkan diri sebagai negara yang memiliki superkomputer tercepat di dunia. Ini adalah kali pertama superkomputer buatan China masuk daftar peringkat pertama superkomputer tercepat dunia yang dirilis situs web www.top500.com dan mengalahkan superkomputer-superkomputer buatan Amerika Serikat.

Tianhe-1 atau berarti Bima Sakti, nama superkomputer yang dibangun di National Supercomputing Centre di Tianjin, melampaui kecepatan hingga 2,570 petaflop atau triliun kalkulasi per detik. Di urutan kedua terdapat Jaguar, superkomputer milik Pemerintah AS di Tennessee dengan 1,750 petaflop.

Tidak hanya satu superkomputer China yang unjuk gigi. Di urutan ketiga pun terdapat superkomputer milik China, yakni Nebulae, di National Supercomputing Centre di Shenzhen. Superkomputer buatan ASmemang masih mendominasi daftar tersebut. Dari 500 unit, lebih dari setengah berada di AS. China mencatat 42 unit dan melampaui jumlah superkomputer Jepang, Perancis, Jerman, dan Inggris. Namun, superkomputer-superkomputer di China menggunakan cip buatan perusahaan AS, antara lain Nvidia.

Sebagai informasi, pengumuman daftar 500 superkomputer tercepat dilakukan rutin dua kali setahun. Penilaian berdasarkan kecepatan yang dicapai dengan tes benchmark ini dirancang ahli Jerman dan Amerika. Bukan kali pertama superkomputer Amerika dikalahkan negara Asia karena pada tahun 2002, Jepang pernah melakukannya.

Monday, March 30, 2009

Install NIC P5GC-MX/1333 in Centos 5.2

There is an error when installing NIC driver on linux Centos 5.2 (I use driver that come with mainboard ASUS P5GC-MX 1333 series.

So I copy and put in /tmp

[root@localhost src]# make install
make: Warning: File `Makefile' has modification time 3e+07 s in the future
make -C /lib/modules/2.6.18-92.el5/build SUBDIRS=/tmp/l2-linux-v1.0.40.4/src modules
make[1]: Entering directory `/usr/src/kernels/2.6.18-92.el5-i686'
make[2]: Warning: File `/tmp/l2-linux-v1.0.40.4/src/Makefile' has modification time 3e+07 s in the future
CC [M] /tmp/l2-linux-v1.0.40.4/src/at_main.o
In file included from /tmp/l2-linux-v1.0.40.4/src/at.h:30,
from /tmp/l2-linux-v1.0.40.4/src/at_main.c:28:
/tmp/l2-linux-v1.0.40.4/src/kcompat.h:1084: error: redefinition of typedef ‘irq_handler_t’
include/linux/interrupt.h:67: error: previous declaration of ‘irq_handler_t’ was here
make[2]: *** [/tmp/l2-linux-v1.0.40.4/src/at_main.o] Error 1
make[1]: *** [_module_/tmp/l2-linux-v1.0.40.4/src] Error 2
make[1]: Leaving directory `/usr/src/kernels/2.6.18-92.el5-i686'
make: *** [default] Error 2
[root@localhost src]#

There error is in file kcompat.h on line 1084. I read and edit file kcompat.h

#if (!(( RHEL_VERSION == 4 ) && ( RHEL_UPDATE >= 5 )))
/*typedef irqreturn_t (*irq_handler_t)(int, void*, struct pt_regs *); */
#endif

and command on line 1084. It's because in Centos =>5 can not recognize this.

And I compile again, and everything is going well. This will compile as a module.
Try to :
[root@localhost ~]# modprobe atl2
[root@localhost ~]# lsmod |grep atl2
atl2 37144 0
[root@localhost ~]#

Edit in /etc/modules.conf to make alias of device.

alias eth0 atl2

[root@localhost ~]# ifconfig eth0 192.168.0.21 netmask 255.255.255.0

[root@localhost ~]#

Tuesday, January 13, 2009

pkg-get on solaris, there is new link for url

After not using pkg-get on Solaris for couple months, I got error like this.

bash-3.00# /opt/csw/bin/pkg-get -i nano
WARNING: gpg not found
No existing install of CSWnano found. Installing...
Trying http://ibiblio.org/pub/packages/solaris/csw/unstable/i386/5.10/nano-1.2.5,REV=2005.08.14-SunOS5.8-i386-CSW.pkg.gz
--11:26:07-- http://ibiblio.org/pub/packages/solaris/csw/unstable/i386/5.10/nano-1.2.5,REV=2005.08.14-SunOS5.8-i386-CSW.pkg.gz
=> `nano-1.2.5,REV=2005.08.14-SunOS5.8-i386-CSW.pkg.gz'
Resolving ibiblio.org... 152.46.7.80
Connecting to ibiblio.org|152.46.7.80|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
11:26:08 ERROR 404: Not Found.

Error downloading http://ibiblio.org/pub/packages/solaris/csw/unstable/i386/5.10/nano-1.2.5,REV=2005.08.14-SunOS5.8-i386-CSW.pkg.gz
(Perhaps you need to update your catalog?)
nano-1.2.5,REV=2005.08.14-SunOS5.8-i386-CSW.pkg.gz: No such file or directory

Attempting to update catalog, then retry

Getting catalog...
--11:26:08-- http://ibiblio.org/pub/packages/solaris/csw/unstable/i386/5.10/catalog
=> `catalog'
Resolving ibiblio.org... 152.46.7.80
Connecting to ibiblio.org|152.46.7.80|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
11:26:08 ERROR 404: Not Found.

ERROR: could not get catalog file
bash-3.00#

Hey, whats going on with .. pkg-get.
Then I go to

http://solaris.reys.net/english/2006/02/pkg-get_blastwave_how-to

looking for some information, looks everything is fine.

Then i visiting this site

http://ibiblio.org/pub/packages/solaris/opencsw/

well, look the URL was change, I am not sure since when ..

so I edit the configuration pkg-get on /opt/csw/etc/pkg-get.conf

and change the default site from

url=http://ibiblio.org/pub/packages/solaris/csw/unstable

to


url=http://ibiblio.org/pub/packages/solaris/opencsw/unstable

and everything going fine.

So I download and install package using pkg-get again.

For example installing nano editor :

bash-3.00# /opt/csw/bin/pkg-get -i nano

...
/opt/csw/share/locale/ro/LC_MESSAGES/nano.mo
/opt/csw/share/locale/ru/LC_MESSAGES/nano.mo
/opt/csw/share/locale/sr/LC_MESSAGES/nano.mo
/opt/csw/share/locale/sv/LC_MESSAGES/nano.mo
/opt/csw/share/locale/tr/LC_MESSAGES/nano.mo
/opt/csw/share/locale/uk/LC_MESSAGES/nano.mo
/opt/csw/share/man/man1/nano.1
/opt/csw/share/man/man5/nanorc.5
[ verifying class ]
## Executing postinstall script.
Updating the info dir file for CSWtexinfo
chroot: exec failed: No such file or directory

Installation of was successful.
bash-3.00#

Sunday, January 4, 2009

Upgrade ports on freebsd

I want to install postgresql 8.2 from ports, but the package was not found. So I have to upgrade the newest ports.
Here is the step for upgrade the ports on FreeBSD 7.

#portsnap fetch update
#portsnap extract
#portsnap update
#Ports tree is already up to date.
#

If only spesified package only use
#portupdgrade package-name

Monday, November 17, 2008

Definisi System Administrator dan Network Administrator

Di bawah ini difinisi System Administrator dan Network Administrator saya ambilkan dari http://en.wikipedia.org/wiki/System_administrator dan http://en.wikipedia.org/wiki/Network_administrator



A system administrator, systems administrator, or sysadmin, is a person employed to maintain and operate a computer system and/or network. System administrators may be members of an information technology department.

The duties of a system administrator are wide-ranging, and vary widely from one organization to another. Sysadmins are usually charged with installing, supporting, and maintaining servers or other computer systems, and planning for and responding to service outages and other problems. Other duties may include scripting or light programming, project management for systems-related projects, supervising or training computer operators, and being the consultant for computer problems beyond the knowledge of technical support staff. A System Administrator must demonstrate a blend of technical skills and responsibility.
Contents
[hide]

* 1 Skills
* 2 Related fields
* 3 Training
* 4 Duties of a system administrator
* 5 System Administrator Privileges
* 6 See also
* 7 References
* 8 External links
o 8.1 Certification Organizations
o 8.2 Periodicals
o 8.3 Conferences
o 8.4 Books
o 8.5 Online Resources
o 8.6 Technology Unions and related links
o 8.7 Articles

Skills

The subject matter of systems administration includes computer systems and the ways people use them in an organization. This entails a knowledge of operating systems and applications, as well as hardware and software troubleshooting, but also knowledge of the purposes for which people in the organization use the computers.

However, perhaps the most important skill to a system administrator is problem solving -- frequently under various sorts of constraints and stress. The sysadmin is on call when a computer system goes down or malfunctions, and must be able to quickly and correctly diagnose what is wrong and how best to fix it.

System administrators are not software engineers or developers. It is not usually within their duties to design or write new applications software. However, sysadmins must understand the behavior of software in order to deploy it and to troubleshoot problems, and generally know several programming languages used for scripting or automation of routine tasks.

Particularly when dealing with Internet-facing or business-critical systems, a sysadmin must have a strong grasp of computer security. This includes not merely deploying software patches, but also preventing break-ins and other security problems with preventive measures. In some organizations, computer security administration is a separate role responsible for overall security and the upkeep of firewalls and intrusion detection systems, but all sysadmins are generally responsible for the security of the systems in their keep.

Related fields

Many organizations staff other jobs related to systems administration. In a larger company, these may all be separate positions within a computer support or Information Services (IS) department. In a smaller group they may be shared by a few sysadmins, or even a single person.

* A database administrator (DBA) maintains a database system, and is responsible for the integrity of the data and the efficiency and performance of the system.
* A network administrator maintains network infrastructure such as switches and routers, and diagnoses problems with these or with the behavior of network-attached computers.
* A security administrator is a specialist in computer and network security, including the administration of security devices such as firewalls, as well as consulting on general security measures.
* A web administrator maintains web server services (such as IIS or Apache) that allow for internal or external access to web sites. Tasks include managing multiple sites, administering security, and configuring necessary components and software. Responsibilities may also include software change management.
* Technical support staff respond to individual users' difficulties with computer systems, provide instructions and sometimes training, and diagnose and solve common problems.
* A computer operator performs routine maintenance and upkeep, such as changing backup tapes or replacing failed drives in a RAID array. Such tasks usually require physical presence in the room with the computer; and while less skilled than sysadmin tasks require a similar level of trust, since the operator has access to possibly sensitive data.

In some organizations, a person may begin as a member of technical support staff or a computer operator, then gain experience on the job to be promoted to a sysadmin position.

Training

Unlike many other professions, there is no single path to becoming a system administrator. Many system administrators have a degree in a related field: computer science, information technology, computer engineering, information system management, or even a trade school program. Other schools have offshoots of their Computer Science program specifically for systems administration.

Some schools have started offering undergraduate degrees in Systems Administration. The first, RIT[1] started in 1992. Others such as Rensselaer Polytechnic Institute, Marist College, and Drexel University have more recently offered degrees in Information Technology.

As of 2008, only four U.S. universities, Rochester Institute of Technology[2], New York City College of Technology,Tufts, and Michigan Tech have graduate programs in system administration.[citation needed] In Norway, there is a special English-taught MSc program organized by Oslo University College [3] in cooperation with Oslo University, named "Masters programme in Network and System Administration." University of Amsterdam (UvA) offers a similar program[1], in cooperation with Hogeschool van Amsterdam (HvA). However, many other schools offer related graduate degrees in fields such as network systems and computer security.

One of the primary difficulties with teaching system administration as a formal university discipline, is that the industry and technology changes much faster than the typical textbook and coursework certification process. By the time a new textbook has spent years working through approvals and committees, the specific technology for which it is written may have changed significantly or is now obsolete.

In addition, because of the practical nature of systems administration and the easy availability of open-source server software, many systems administrators enter the field self-taught.

Generally, a prospective administrator will be required to have some experience with the computer system he or she is expected to manage. In some cases, candidates are expected to possess industry certifications such as the Microsoft MCSA, MCSE, Red Hat RHCE, Novell CNA, CNE, Cisco CCNA or CompTIA's A+ or Network+, Sun Certified SCNA, among others.

Sometimes, almost exclusively in smaller sites, the role of system administrator may be given to a skilled user in addition to or in replacement of his or her duties. For instance, it is not unusual for a mathematics or computing teacher to serve as the system administrator of a secondary school.

Duties of a system administrator

A system administrator's responsibilities might include:

* Analyzing system logs and identifying potential issues with computer systems.
* Introducing and integrating new technologies into existing data center environments.
* Performing routine audits of systems and software.
* Performing backups.
* Applying operating system updates, patches, and configuration changes.
* Installing and configuring new hardware and software.
* Adding, removing, or updating user account information, resetting passwords, etc.
* Answering technical queries.
* Responsibility for security.
* Responsibility for documenting the configuration of the system.
* Troubleshooting any reported problems.
* System performance tuning.
* Insuring that the network infrastructure is up and running.

In larger organizations, some tasks listed above may be divided among different system administrators or members of different organizational groups. For example, a dedicated individual(s) may apply all system upgrades, a Quality Assurance (QA) team may perform testing and validation, and one or more technical writers may be responsible for all technical documentation written for a company.

In smaller organizations, the system administrator can also perform any number of duties elsewhere associated with other fields:

* Technical support
* Database administrator (DBA)
* Network administrator/analyst/specialist
* Application analyst
* Security administrator
* Programmer

System administrators, in larger organizations, tend not to be system architects, system engineers, or system designers. However, like many roles in this field, demarcations between systems administration and other technical roles often are not well defined in smaller organizations. Even in larger organizations, senior systems administrators often have skills in these other areas as a result of their working experience.

In smaller organizations, IT/computing specialties are less often discerned in detail, and the term system administrator is used in a rather generic way — they are the people who know how the computer systems work and can respond when something fails.


Network administrator is a modern profession responsible for the maintenance of computer hardware and software that comprises a computer network. This normally includes the deployment, configuration, maintenance and monitoring of active network equipment. A related role is that of the network specialist, or network analyst, who concentrate on network design and security.


The Network Administrator is usually the highest level of technical/network staff in an organization and will rarely be involved with direct user support. The Network Administrator will concentrate on the overall health of the network, server deployment, security, ensuring network connectivity throughout a company's LAN/WAN infrastructure, and all other technical considerations at the network level of an organizations technical hierarchy. Network Administrators are considered Tier 3 support personnel that only work on break/fix issues that could not be resolved at the Tier1 (helpdesk) or Tier 2 (desktop/network technician) levels.

Depending on the company, the Network Administrator may also design and deploy networks. However, these tasks may be assigned to a Network Engineer should one be available to the company.

The actual role of the Network Administrator will vary from company to company, but will commonly include activities and tasks such as network address assignment, assignment of routing protocols and routing table configuration as well as configuration of authentication and authorization – directory services. It often includes maintenance of network facilities in individual machines, such as drivers and settings of personal computers as well as printers and such. It sometimes also includes maintenance of certain network servers: file servers, VPN gateways, intrusion detection systems, etc.

Network specialists and analysts concentrate on the network design and security, particularly troubleshooting and/or debugging network-related problems. Their work can also include the maintenance of the network's authorization infrastructure, as well as network backup systems.

The administrator is responsible for the security of the network and for assigning IP addresses to the devices connected to the networks. Assigning IP addresses gives the subnet administrator some control over the professional who connects to the subnet. It also helps to ensure that the administrator knows each system that is connected and who personally is responsible for the system.

Thursday, September 18, 2008

Delete all except one

How to delete all file except file(s) ...

> ls
1 2 3 4 5 6 7
>

I want to delete files 3, 4, 5, 6, 7 except 1 & 2
> rm `ls * | egrep -v "1|2"`
> ls
1 2
>

Tuesday, September 2, 2008

Backup and Restore Alfresco

Overview

Backing up an Alfresco repository involves backing up both the directory pointed to by the dir.root setting AND the database Alfresco is configured to use, as if they were a single unit. Backing up either one without the other results in a backup that cannot be successfully restored.

Similarly, when you restore an Alfresco backup you must restore both the dir.root directory AND the Alfresco database from the same backup set - restoring either one in isolation is guaranteed to corrupt your repository.

The dir.root directory is usually defined in /alfresco/extension/custom-repository.properties. By default this directory is named 'alf_data' and is located within the directory where Alfresco is installed.
[edit] Cold Backup Procedure

By default, the dir.root contains both the content and indexes, so for cold backup it is possible to backup just the content and then do a full reindex when a backup is restored. A full reindex can be a time consuming process however, so the steps below include the indexes in the backup.

1. Stop Alfresco
2. Backup the database Alfresco is configured to use, using your database vendor's backup tools
3. In parallel, backup the Alfresco dir.root directory in its entirety
4. Store both the database and Alfresco dir.root backups together as a single unit (neither is useful without the other)
5. Start Alfresco

[edit] Hot Backup Procedure
[edit] Overview

1. Backup the database Alfresco is configured to use, using your database vendor's backup tools (see below for details)
2. As soon as the database backup completes, backup specific subdirectories in the Alfresco dir.root (see below for details)
3. Store both the database and Alfresco dir.root backups together as a single unit (neither is useful without the other)

[edit] Backing up the Database

In an Alfresco system, the ability to support hot backup is fundamentally dependent on the hot backup capabilities of the database product Alfresco is configured to use. Specifically, it requires a tool that can "snapshot" a consistent version of the Alfresco database (ie. it must capture a transactionally consistent copy of all of the tables in the Alfresco database). In addition, to avoid serious performance problems in the running Alfresco system, this "snapshot" operation should operate without taking out locks in the Alfresco database.

Backup capabilities vary widely between relational database products, and you should ensure that any backup procedures that are instituted are validated by a qualified, experienced Database Administrator before being put into a production environment.
[edit] Backing up the Filesystem

Backup the following subdirectories of the Alfresco dir.root directory using whatever tools you're comfortable with (rsync, xcopy, etc.):

* contentstore
* contentstore.deleted
* audit.contentstore
* backup_lucene_index

IMPORTANT NOTE: Never, never, under any circumstances, attempt to backup the lucene-indexes subdirectory while Alfresco is running. Doing so is almost certain to cause Lucene index corruption.
[edit] Notes

* Alfresco includes a background job responsible for backing up the Lucene indexes that (by default) is configured to run at 3am each night. The hot backup process must not run concurrently with this background job, so you should either ensure that the hot backup completes by 3am, or wait until the index backup job has completed before initiating a hot backup.
* The Alfresco WCM functionality includes a background job called the 'avmOrphanReaperJob' that must not be allowed to run while a hot backup is in progress. By default this job is scheduled to run every minute, but this can be reconfigured by overriding the default schedule defined in scheduled-jobs-context.xml. Please make sure you are familiar with Alfresco's Repository Configuration mechanism before making any configuration changes. If you are not using the Alfresco WCM functionality no action is required.

[edit] Restore Procedure

1. Stop Alfresco
2. Copy the existing dir.root to temp location
3. Restore dir.root
4. If you're restoring from a hot backup, rename dir.root/backup_lucene_index to dir.root/lucene-indexes
5. Restore the database from the database backups
6. Start Alfresco

[edit] Lucene Index Restoration

Note that in addition to full restorations, the backup sets created via either the cold or hot backup procedures described above can also be used to restore just the Lucene indexes. This is useful in cases where the repository itself does not need to be restored but for some reason the Lucene indexes are stale.

The Lucene index restoration process is as follows:

1. Stop Alfresco
2. Move the existing dir.root/lucene-indexes directory out of the way
3. If you're performing cold backups, restore dir.root/lucene-indexes from the most recent backup step
4. If you're performing hot backups, restore dir.root/backup_lucene_index from the most recent backup step and rename it to dir.root/lucene-indexes
5. Restart Alfresco

Upon restarting, Alfresco will (by default) detect that the indexes are stale, and incrementally reindex just that content that has changed since the last backup was performed. As the size of your content set grows, the time savings from performing incremental reindexing rather than full reindexing will become greater and greater (incremental reindexing is typically measured in minutes, whereas full reindexing can take hours for large content sets).

Important note: in order for incremental reindexing to occur properly, you should leave the index.recovery.mode property at its default value of "VALIDATE". Setting this property to "FULL" forces a full reindex even if incremental reindexing is possible (thereby negating any benefits from this procedure).

----
Copy Paste From http://wiki.alfresco.com/wiki/Backup_and_Restore without permission.

Friday, August 15, 2008

snmpd problems occur when running portsentry

The problems is when installing portsentry, then running the snmpd. Because the snmp was block by portsentry. The solutions is start snmpd first, then portsentry.

Here is the sockstat from our gateway.
First, we check using sockstat to list open ports. From first line, seems port 161 "used" by portsentry. My college down the portsentry and run the snmpd. You can see in the 3rd command.

gw1# sockstat | grep 161
root portsentry 1066 4 udp4 *:161 *:*
squid squid 1016 161tcp4 127.0.0.1:3128 10.0.16.174:2642
squid squid 1016 174tcp4 117.102.83.187:53898 195.161.119.84:80
squid squid 1016 213tcp4 10.0.17.247:3128 10.0.16.161:2137
squid squid 1016 697tcp4 117.102.83.187:* 212.96.161.229:80
gw1#
gw1# netstat -a |grep snmp
udp4 0 0 *.snmptrap *.*
udp4 0 0 *.snmp *.*
gw1# sockstat | grep 161
root snmpd 60836 10 udp4 *:161 *:*
squid squid 1016 95 tcp4 10.0.17.247:3128 10.0.16.161:2242
squid squid 1016 161tcp4 127.0.0.1:3128 10.0.16.174:2642
squid squid 1016 174tcp4 117.102.83.187:53898 195.161.119.84:80
squid squid 1016 209tcp4 10.0.17.247:3128 10.0.16.49:2161
gw1#

Friday, July 4, 2008

Create startup script for postgresql on solaris

Here is simple script postgresql 8.2(startup on solaris)
Create file in /etc/init.d with name postgresql


#!/sbin/sh
#change with your prefix installation
PGBIN=/usr/postgres/8.2/bin
PGDATA=/export/postgres82/pgdata
PGLOG=/export/postgres82/pgdata/log
PGUSER=postgres
case "$1" in
'start')
su - $PGUSER -c "$PGBIN/pg_ctl -D $PGDATA start"
;;

'stop')
su - $PGUSER -c "$PGBIN/pg_ctl -D $PGDATA stop"
;;

'refresh')
su - $PGUSER "$PGBIN/pg_ctl -D $PGDATA reload"
;;
*)

echo $"Usage: $0 {start|refresh}"
exit 1
;;

esac

change file permission to 755
then you have to make link to other directory.
#ln /etc/init.d/postgresql /etc/rc0.d/K03postgresql
#ln /etc/init.d/postgresql /etc/rc1.d/K03postgresql
#ln /etc/init.d/postgresql /etc/rc2.d/K03postgresql
#ln /etc/init.d/postgresql /etc/rcS.d/K03postgresql
#ln /etc/init.d/postgresql /etc/rc3.d/S90postgresql

Try to start stop service and restart the system.
check with
# ps -ef | grep post
postgres 736 734 0 15:47:00 ? 0:00 /usr/postgres/8.2/bin/postgres -D /export/postgres82/pgdata
root 739 711 0 15:49:13 pts/2 0:00 grep post
postgres 734 1 0 15:47:00 pts/2 0:00 /usr/postgres/8.2/bin/postgres -D /export/postgres82/pgdata
postgres 737 734 0 15:47:00 ? 0:00 /usr/postgres/8.2/bin/postgres -D /export/postgres82/pgdata
#
Finish

Installing pkg_get on Solaris 10

This package is for automatically download and install package. This is package have same function with apt-get on debian or yum on Redhat.
First download package from http://www.blastwave.org/pkg_get-3.8.4-SunOS5.8-all-CSW.pkg
# pkgadd -d pkg_get-3.8.4-SunOS5.8-all-CSW.pkg

The following packages are available:
1 CSWpkgget pkg_get - CSW version of automated package download tool
(all) 3.8.4

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]:

Processing package instance from

pkg_get - CSW version of automated package download tool(all) 3.8.4
You may use and copy this software without charge, as you see fit.
The software is copyright (C) Philip Brown, Nov 2000-2007

Dont forget to update /opt/csw/etc/pkg-get.conf with your nearest archive site.
(or /etc/opt/csw/pkg-get.conf)

The default site ibiblio.org may or may not be slow for you!


The selected base directory must exist before installation
is attempted.

Do you want this directory created now [y,n,?,q] y
Using as the package base directory.
## Processing package information.
## Processing system information.
WARNING: setting mode of to default mode (755)
WARNING: setting mode of to default mode (755)
WARNING: setting mode of to default mode (755)
WARNING: setting mode of to default mode (755)
WARNING: setting mode of to default mode (755)
1 package pathname is already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of [y,n,?] y

Installing pkg_get - CSW version of automated package download tool as

## Installing part 1 of 1.
/opt/csw/bin/pkg-get
/opt/csw/etc/pkg-get.conf.csw
/opt/csw/share/man/man1m/pkg-get.1m
/var/pkg-get/admin-fullauto
[ verifying class ]
## Executing postinstall script.

Installing /opt/csw/etc/pkg-get.conf.csw to pkg-get.conf

**** IMPORTANT ****
A default configuration file for pkg-get has been created in
/opt/csw/etc/pkg-get.conf
You should edit it to change the 'site' configuration, to point to
the most appropriate mirror for you, from the list at
http://www.blastwave.org/mirrors


Installation of was successful.
#
# /opt/csw/bin/pkg-get -help
pkg-get, by Philip Brown , phil@bolthole.com
(Internal SCCS code revision 3.11)
Originally from http://www.bolthole.com/solaris/pkg-get.html

pkg-get is used to install free software packages
pkg-get
Need one of 'install', 'upgrade', 'available','compare'
'-i|install' installs a package
'-u|upgrade' upgrades already installed packages if possible
'-a|available' lists the available packages in the catalog
'-c|compare' shows installed package versions vs available
'-l|list' shows installed packages by software name only

Optional modifiers:
'-d|download' just download the package, not install
'-D|describe' describe available packages, or search for one
'-U|updatecatalog' updates download site inventory
'-S|sync' Makes update mode sync to version on mirror site
'-f' dont ask any questions: force default pkgadd behaviour
Normally used with an override admin file
See /var/pkg-get/admin-fullauto

'-s ftp://site/dir' temporarily override site to get from
#

For example I will install package nano for editing.
# /opt/csw/bin/pkg-get -i nano
...
/opt/csw/share/locale/sr/LC_MESSAGES/nano.mo
/opt/csw/share/locale/sv/LC_MESSAGES/nano.mo
/opt/csw/share/locale/tr/LC_MESSAGES/nano.mo
/opt/csw/share/locale/uk/LC_MESSAGES/nano.mo
/opt/csw/share/man
/opt/csw/share/man/man1/nano.1
/opt/csw/share/man/man5/nanorc.5
[ verifying class ]
## Executing postinstall script.
Updating the info dir file for CSWtexinfo
chroot: exec failed: No such file or directory

Installation of was successful.

# /opt/csw/bin/nano # running nano

Wednesday, July 2, 2008

cvsup ports-supfile

viperbsd# cp /usr/share/examples/cvsup/ports-supfile /tmp
copy ports-supfile ke /tmp
edit bagian di bawah, pilih salah satu mirror ports.
*default host=cvsup1.FreeBSD.org
viperbsd# cvsup -g -L 2 ports-supfile

...
Applying fixups for collection ports-all/cvs
Fixup ports/games/doom/files/patch-ab
Fixup ports/graphics/vcg/files/tMakefile
Fixup ports/net/wmwave/files/patch-wmwave.c
Shutting down connection to server
Finished successfully
viperbsd#

Biar gak lupa link cvsup mirror seluruh dunia .. :)

http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS

Friday, June 27, 2008

Yahoo ...blok ip telkomspeedy ...

Test email dari server testing Centos 5.1, saya pakai cyrus-imapd versi 2.3.7 dan postfix 2.3.3. Server kirim dan terima dari server gmail bisa, namun begitu saya coba email ke yahoo ternyata di blok.


: host mx1.mail.sg1.yahoo.com[124.108.116.72]
said: 553 Mail from wahyu@xxxxx.org not allowed - 5.7.1
[BL21] Connections not accepted from IP addresses on Spamhaus PBL; see
http://postmaster.yahoo.com/550-bl21.html [550] (in reply to MAIL FROM
command)

Ternyata yahoo blok dari spamhaus PBL. Saya menggunjungi website spamhaus.


IP Address Lookup

125.164.xx.xxx is not listed in the SBL

125.164.xx.xxx is listed in the PBL, in the following records:

* PBL171259

125.164.xx.xxx is not listed in the XBL


Berdasarkan di bawah, blok ip dari Telkomspeedy di blok
Ref: PBL171259

125.164.72.0/23 is listed on the Policy Block List (PBL)

Berarti ada 510 IP yang di blok. Karena hanya untuk testing, saya tidak remove IP address statik saya.

Wednesday, June 25, 2008

Setting PPPoE di Centos 5.1 menggunakan telkomspeedy

Catatan untuk membuat PPPoE di Centos 5.1 menggunakan telkomnetspeedy.
Karena Up Link dan Down Link Telkomspeedy sudah lumayan kenceng, walaupun kalau lagi lemot juga sangat lemot.

Gambar di bawah capture konfigurasi modem am300 gratis dari telkomspeedy :)




Setting modem di setting seperti diatas.

Kemudian setting Centos 5.1 dengan 2 ethernet, 1 ethernet untuk jaringan lokal, dan 1 ethernet untuk koneksi ke modem.

Internet <--> Modem(bridge) <--> Server gateway(eth1,eth0)

[root@wahyucentos ssh]# cat /etc/redhat-release
CentOS release 5 (Final)
[root@wahyu ssh]#

[root@wahyucentos ssh]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:8D:C3:39:7D
inet addr:192.168.0.105 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:8dff:fec3:397d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5990 errors:0 dropped:0 overruns:0 frame:0
TX packets:2161 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:825820 (806.4 KiB) TX bytes:1069634 (1.0 MiB)
Interrupt:217 Base address:0xa800

eth1 Link encap:Ethernet HWaddr 00:1E:58:31:B3:EB
inet addr:192.168.100.96 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::21e:58ff:fe31:b3eb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2847 errors:0 dropped:0 overruns:0 frame:0
TX packets:2878 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1084873 (1.0 MiB) TX bytes:539141 (526.5 KiB)
Interrupt:209 Base address:0x2000
[root@wahyucentos ssh]#
[root@wahyucentos ssh]#system-config-network




Klik New, dan pilih xDSL connections, pilih ethernet 1(eth1)masukan username dan
password telkom.

Setelah itu, active kan ppp
Sehingga dapat di lihat seperti dibawah ini. Dapat di lihat bahwa, pppC dengan nama koneksi test sudah aktif.



Di atas, saya juga mengaktifkan eth1 dengan ip address lokal.

[root@wahyucentos ssh]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:8D:C3:39:7D
inet addr:192.168.0.105 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::250:8dff:fec3:397d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5990 errors:0 dropped:0 overruns:0 frame:0
TX packets:2161 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:825820 (806.4 KiB) TX bytes:1069634 (1.0 MiB)
Interrupt:217 Base address:0xa800

eth1 Link encap:Ethernet HWaddr 00:1E:58:31:B3:EB
inet addr:192.168.100.96 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::21e:58ff:fe31:b3eb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2847 errors:0 dropped:0 overruns:0 frame:0
TX packets:2878 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1084873 (1.0 MiB) TX bytes:539141 (526.5 KiB)
Interrupt:209 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:1296 errors:0 dropped:0 overruns:0 frame:0
TX packets:1296 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2913220 (2.7 MiB) TX bytes:2913220 (2.7 MiB)

ppp0 Link encap:Point-to-Point Protocol
inet addr:125.xxx.xx.xxx P-t-P:125.xxx.xx.x Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:2629 errors:0 dropped:0 overruns:0 frame:0
TX packets:2617 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:1013596 (989.8 KiB) TX bytes:460371 (449.5 KiB)

[root@wahyucentos ssh]#

Jangan lupa untuk setting iptables, dan forwarding agar, bisa di gunakan sebagai gateway. Atau kalau ingin menggunakan squid, bisa di installkan juga.

Tuesday, June 24, 2008

Delete mailbox on cyrus-imap

To delete mailbox on cyrus-imap you have to give permission. By default admin doesn't have permission deleting mailbox.


moonlight# cyradm -u cyrus localhost
Password:
localhost> lm
user.bafrin (\HasChildren) user.john.Sent (\HasNoChildren)
user.bafrin.Drafts (\HasNoChildren) user.john.Trash (\HasNoChildren)
user.bafrin.Sent (\HasNoChildren) user.wahyu (\HasChildren)
user.bafrin.Trash (\HasNoChildren) user.wahyu.Drafts (\HasNoChildren)
user.john (\HasChildren) user.wahyu.Sent (\HasNoChildren)
user.john.Drafts (\HasNoChildren) user.wahyu.Trash (\HasNoChildren)
localhost> dm user.john
deletemailbox: Permission denied
localhost>
localhost> lam user.john
john lrswipkxtecda
localhost> dm user.john
deletemailbox: Permission denied
localhost> sam user.john cyrus c
localhost> lam user.john
john lrswipkxtecda
cyrus kxc
localhost> dm user.test
deletemailbox: Mailbox does not exist
localhost> dm user.john
localhost> lm
user.bafrin (\HasChildren) user.wahyu (\HasChildren)
user.bafrin.Drafts (\HasNoChildren) user.wahyu.Drafts (\HasNoChildren)
user.bafrin.Sent (\HasNoChildren) user.wahyu.Sent (\HasNoChildren)
user.bafrin.Trash (\HasNoChildren) user.wahyu.Trash (\HasNoChildren)
localhost>

Friday, June 6, 2008

General IO error in openoffice using NFS

http://ubuntuforums.org/showthread.php?t=332043

Thursday, June 5, 2008

Buat jasperserver di satu server

Idenya sih, karena kita memakai jasperserver 2.1, dan ada beberapa aplikasi yang berjalan menggunakan DB postgresql 8.2 yang berbeda. Agar aplikasi report yang di pakai, bisa menggunakan satu server report(jasperserver).

Saya menggunakan jasperserver versi di bawah, karena untuk mempermudah saja, installnya.
Karena sudah bundle dengan MySql, dan tomcat.

jasperserver-2.1-linux-installer.bin


Installasi saya taruh di /home/jasperserver-2.1

[root@temo jasperserver-2.1]# ls
ant jasperctl.sh license.txt scripts
apache-tomcat java mysql uninstall
docs js-installer-version.txt releaseNotes.txt
ireport licenses samples
[root@temo jasperserver-2.1]#
/home/jasperserver-2.1/apache-tomcat/webapps

copy folder jasperserver ke jasperprc, jaspershp, jaspervr di sesuaikan dgn namanya.

Edit file2 berikut, di sesuaikan dgn kebutuhan.

[root@temo WEB-INF]#
hibernate.properties jboss-web.xml web.xml
[root@temo WEB-INF]#

Edit web.xml, edit bagian ini ...

JasperSHP UI application


webAppRootKey
jaspershp.root


Di samakan dgn DBnya mysql.

Untuk hibernate.properties
# Properties file with JDBC-related settings.
# Applied by PropertyPlaceholderConfigurer from "applicationContext-*.xml".
# Targeted at system administrators, to avoid touching the context XML files.

# Property that determines the Hibernate dialect
metadata.hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect

metadata.hibernate.dataSource.jndiName=jdbc/jaspershp

Dan seterusnya.

Buat database di mysql.

mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| foodmart |
| jasperprc |
| jaspershp |
| jaspervr |
| mysql |
| sugarcrm |
| test |
+--------------------+
8 rows in set (0.03 sec)

mysql>

Edit file di :
/home/jasperserver-2.1/apache-tomcat/webapps/jaspershp/META-INF
nama file context.xml

auth="Container"
name="jdbc/jaspershp"
type="javax.sql.DataSource"
password="passwordnya"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="30"
maxWait="1000"
username="usernya"
url="jdbc:mysql://127.0.0.1:3306/jaspershp?useUnicode=true&characterEncoding=UTF-8"
maxActive="20"/>


Restart apache tomcat, melalui manager.


note: bbrp langkah di lewati, spt, create db, import db data(import DB data dump harus di ganti sesuai dbnya [use namadbnya])

Wednesday, March 12, 2008

Install perl CPAN module

Cara install perl CPAN modul.
Masuk ke cpan shell:
[root@mis07 nightly]# perl -MCPAN -e shell
cpan> install DBD::mysql
Running install for module DBD::mysql
Running make for C/CA/CAPTTOFU/DBD-mysql-4.006.tar.gz
Is already unwrapped into directory /root/.cpan/build/DBD-mysql-4.006
Has already been processed within this session
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base..............ok
t/10connect...........ok
t/20createdrop........ok
t/25lockunlock........ok
t/30insertfetch.......ok
t/35limit.............ok
t/35prepare...........ok
t/40bindparam.........ok
t/40bindparam2........ok
t/40blobs.............ok
t/40catalog...........ok
t/40keyinfo...........ok
t/40listfields........ok
t/40nulls.............ok
t/40numrows...........ok
t/40server_prepare....ok
t/40types.............ok
t/41bindparam.........ok
t/41blobs_prepare.....ok
t/42bindparam.........ok
t/50chopblanks........ok
t/50commit............ok
t/60leaks.............skipped
all skipped: $ENV{SLOW_TESTS} is not set
t/65types.............ok
t/70takeimp...........skipped
all skipped: test feature not implemented
t/75supported_sql.....ok
t/80procs.............ok
t/insertid............ok
t/multi_statement.....ok
t/param_values........ok
t/prepare_noerror.....ok
t/texecute............ok
t/utf8................ok
t/warnings............ok
All tests successful, 2 tests skipped.
Files=34, Tests=656, 3 wallclock secs ( 2.74 cusr + 0.62 csys = 3.36 CPU)
/usr/bin/make test -- OK
Running make install
Installing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.bs
Installing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/mysql.so
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/DBD/mysql.pm
Installing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/DBD/mysql/INSTALL.pod
Installing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/DBD/mysql/GetInfo.pm
Installing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/Bundle/DBD/mysql.pm
Installing /usr/share/man/man3/Bundle::DBD::mysql.3pm
Installing /usr/share/man/man3/DBD::mysql.3pm
Installing /usr/share/man/man3/DBD::mysql::INSTALL.3pm
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/DBD/mysql/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
/usr/bin/make install -- OK

cpan>
cpan> install IO::All
IO::All is up to date.

cpan> q --> utk quit.

utk ganti mirror
cpan>o conf init

Thursday, March 6, 2008

How to install GRUB on the MBR

How to install GRUB on the MBR

GRUB (GRand Unified Bootloader)

Briefly, a boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring control to an operating system kernel software (such as Linux). The kernel, in turn, initializes the rest of the operating system (e.g. a GNU system).

GNU GRUB Homepage
http://www.gnu.org/software/grub/


Problem

"There is not a boot manager screen at all, it just boots right into windows but GRUB boot window does not appear. I cannot figure out to access fedora, I do not have a boot disk and need to know if there is someway to boot into fedora"

"I forgot to install GRUB, I didn't install GRUB in the MBR, I chose to install GRUB on the first track on the partition where I installed Fedora but that was not an active primary partition".

Solution

You have to install GRUB on the MBR (Master Boot Record). To do this just follow this steps:

(First of all, enter your BIOS setup and in BOOT Sequence window choose to boot with CDROM first.)

1) Boot with your Fedora Core Installation CD 1.

2) Type "linux rescue" at the prompt.

3) Answer the questions about keyboard and language.

4) Tell the rescue mode to use your proper partition to mount (the one that you want to get booted into)

5) When you come to the console prompt type: chroot /mnt/sysimage

6) Type grub

7) Set the GRUB's root device to the partition containing the boot directory like this:

grub> root (hd0,0)

Filesystem type is ext2fs, partition type 0x83

I have Windows 98 in hd0,0 ; Windows XP in hd0,1, Fedora Core /boot partition in hd0,2 and Mandrake /boot partition in hd0,6. So in my case the command should be: > root (hd0,2)

If you are not sure which partition actually holds this directory, use the command 'find' like this:

grub> find /boot/grub/stage1

This will search for the file name '/boot/grub/stage1' and show the devices which contain the file.
Once you've set the root device correctly, run the command 'setup'.

8) Then, run the command setup

grub> setup (hd0)

Checking if "/boot/grub/stage1" exists....... no
Checking if "/grub/stage1" exists....... yes
Checking if "/grub/stage2" exists....... yes
Checking if "/grub/e2fs_stage1_5" exists....... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"....... 15 sectors are embedded
succeded
Running "install /grub/stage1 (hd0) (hd0) 1+15 p (hd0,2)/grub/stage2 /grub/grub.conf....... succeded
Done


This command will install GRUB boot loader on the Master Boot Record (MBR) of the first drive.

9) Type quit

grub> quit

GRUB is now in the MBR.

10) Finally, you'll have to edit your /boot/grub/grub.conf, for example whith nano:

> nano /boot/grub/grub.conf

(/etc/grub.conf or /boot/grub/grub.conf or /boot/grub/menu.lst, they are the same file) This file has the boot partitions of the disk/s.

11) Restart your PC without the Fedora Core CD 1 Installation.


My grub.conf

default=0
timeout=30
splashimage=(hd0,2)/grub/splash.xpm.gz

title GNU/Linux Fedora Core 1 (2.4.22-1.2188.nptl)
root (hd0,2)
kernel /vmlinuz-2.4.22-1.2188.nptl ro root=LABEL=/ hdc=ide-scsi hdd=ide-scsi apm=off acpi=on vga=788
initrd /initrd-2.4.22-1.2188.nptl.img

#title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
#root (hd0,2)
#kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
#initrd /initrd-2.4.22-1.2174.nptl.img

title GNU/Linux Mandrake 9.2
kernel (hd0,6)/vmlinuz root=/dev/hda8 devfs=mount hdc=ide-scsi resume=/dev/hda9
initrd (hd0,6)/initrd.img

title Microsoft Windows 98 SE & XP Pro
rootnoverify (hd0,0)
chainloader +1




List of commands,

default=0
My default boot system is, of course, Fedora.

timeout=30
Fedora will boot in 30 seconds if you don't touch anything.

splashimage=(hd0,2)/grub/splash.xpm.gz
Generally the splash image is in your /boot partition. In my case, hd0,2 is where I have the image.

title GNU/Linux Fedora Core 1 (2.4.22-1.2174.nptl)
The name of your OS that will appear in your menu at starup, you can write anything you want.

root (hd0,2)
This is your /boot partition specifies which partition contains your Linux kernel image. So "root (hd0,2) tells GRUB that the kernel is on the 3rd primary partition of my first hard disk (I have two), in my case (hd0,2).

kernel /vmlinuz-2.4.22-1.2174.nptl ro root=LABEL=/ hdc=ide-scsi apm=off acpi=on rhgb
Tells GRUB where to find your kernel, my kernel version is 2.4.22-1.2174, you have to type your kernel version.

rhgb
Red Hat Graphical Boot

apm=off acpi=on
I had to add 'apm=off acpi=on' to my kernel parameters to get power-off to work properly.

initrd /initrd-2.4.22-1.2174.nptl.img
Tells where your init ramdisk image is located.

title Microsoft Windows 98 SE & XP Pro
As I said, I have Windows 98 in hd0,0 and Windows XP in (hd0,1).

rootnoverify (hd0,0)
rootnoverify tells GRUB to boot from the Windows partition, but not to attempt to mount it.
(hd0,0) is where Windows XP puts the boot.ini to boot into Windows 98 and XP.

chainloader +1
chain-load is the mechanism for loading unsupported operating systems by loading another boot loader. It is typically used for loading DOS or Windows.
chainloader tells GRUB to chain to Windows' boot loader which will start Windows.

Other options you can use:

map
If you have installed DOS (or Windows) on a non-first hard disk, you have to use the disk swapping technique, because that OS cannot boot from any disks but the first one.

Map the drive from_drive to the drive to_drive. This is necessary when you chain-load some operating systems, such as DOS, if such an OS resides at a non-first drive. Here is an example:

grub> map (hd0) (hd1)
grub> map (hd1) (hd0)

This performs a virtual swap between your first and second hard drive.

Caution: This is effective only if DOS (or Windows) uses BIOS to access the swapped disks. If that OS uses a special driver for the disks, this probably won't work.

makeactive
Set the active partition on the root disk to GRUB's root device. This command is limited to primary PC partitions on a hard disk.

Code:
title Windows 98 SE
map (hd0) (hd1)
map (hd1) (hd0)
makeactive
rootnoverify (hd1,0)
chainloader +1


hide
Hide the partition partition by setting the hidden bit in its partition type code. This is useful only when booting DOS or Windows and multiple primary FAT partitions exist in one disk.

unhide
Unhide the partition partition by clearing the hidden bit in its partition type code. This is useful only when booting DOS or Windows and multiple primary partitions exist in one disk.

Explanation and examples of the hide and unhide commands

If you installed more than one set of DOS/Windows onto one disk, they could be confused if there are more than one primary partitions for DOS/Windows. There is a solution if you do want to do so. Use the partition hiding/unhiding technique.

If GRUB hides a DOS (or Windows) partition, DOS (or Windows) will ignore the partition. If GRUB unhides a DOS (or Windows) partition, DOS (or Windows) will detect the partition. Thus, if you have installed DOS (or Windows) on the first and the second partition of the first hard disk, and you want to boot the copy on the first partition.

Here's how to create two installations of Windows, hda1 and hda2 or (hd0,0) and (hd0,1), using the commands hide and unhide.

For Windows 98 SE "My Entry":
Code:
title My Entry
unhide (hd0,0)
hide (hd0,1)
rootnoverify (hd0,0)
makeactive
chainloader +1


For Windows 98 SE "Family Entry"
Code:
title Family Entry
unhide (hd0,1)
hide (hd0,0)
rootnoverify (hd0,1)
makeactive
chainloader +1


I did not have to use the 'hide' or 'unhide' command 'cause Windows XP, 2000 or NT have a boot manager (boot.ini) included. So, I only had to point where this boot.ini is. In my case, Windows XP copies this boot.ini where Windows 98 is installed, (hd0,0)
You should definitely use the 'hide' or 'unhide' command if you have,for example, two installations of Windows 98 or ME.



If everything went just fine, voila, GRUB now becomes your main boot manager for your multi OS system.


GRUB and Linux Partitions

First of all, GRUB requires that the device name be enclosed with ( ). Please, note that the partition numbers are counted from zero, not from one.


(hd0) in GRUB = is hda in Linux
Here, 'hd' means it is a hard disk drive. The first integer '0' indicates the drive number, that is, the first hard disk.


(hd1) in GRUB = is hdb in Linux
The first integer '1' indicates the drive number, that is, the second hard disk.


(hd0,1) in GRUB = is hda2 in Linux
This expression means the second primary partition of the first hard disk drive. In this case, GRUB uses one partition of the disk, instead of the whole disk.


(hd0,4) in GRUB = hda5 in Linux
This specifies the first extended partition of the first hard disk drive. Note that the partition numbers for extended partitions are counted from '4', regardless of the actual number of primary partitions on your hard disk.


(hd0,5) in GRUB = hda6 in Linux
This is the first logical unit of the extended partition of the the first hard disk.


(hd1,0) in GRUB = is hdb1 in Linux
This is the first primary partition of the second hard disk.


Source : http://www.fedoraforum.org/forum/showthread.php?t=975
Copy Paste, without permission.