Feb 08 2007

run level and /etc/inittab

Catégorie : sysadmin, LinuxCharles Collier @ 7:33 pm

Description

The numbers associated with the run levels for a specific distribution are listed in the /etc/inittab

#/etc/inittab (in RHEL 3)
# Default runlevel. The runlevels used by RHS are:
# 0 - halt (Do NOT set initdefault to this)
# 1 - Single user mode
# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)
# 3 - Full multiuser mode
# 4 - unused
# 5 - X11
# 6 - reboot (Do NOT set initdefault to this)
#
id:3:initdefault:

# System initialization.
si::sysinit:/etc/rc.d/rc.sysinit

l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6

# Trap CTRL-ALT-DELETE
ca::ctrlaltdel:/sbin/shutdown -t3 -r now

Choose the good runlevel:
Runlevel 0:
it will shutdown your system

Runlevel 1:
It is the single user mode, used by system administrator when you have to fix some problems and everything is going wrong. you’ll be root without password.

Very useful if you forgot your root password, but you have to protect the physical acces to your server.
No user can log in while you are in this runlevel

Runlevel 2:
It is a multi user mode in command line (like the runlevel3) but you don’t have network connection

Runlevel 3:
It is the full multiuser command line mode. (mainly used by every one)

Runlevel 4:
I think it is not really used maybe you can configure it for special purposes…

Runlevel 5:
It is the full multiuser X11 mode.

Runlevel 6:
It will reboot your server

The good choice:
Depending on the server utilisation you have, you’ll choose runlevel 3 or 5

The (very) bad one:
You mustn’t change the initdefault to runlevel 0 (halt) or runlevel 6 (reboot)
because the system will then either immediately shutdown just after starting, or reboot indefinitely….

Changing the inittab configuration:

To make a change you can either edit the conf. file /etc/inittab or use the comand ‘telinit’

[admin@nuxora admin]$man telinit

#
#…. this is an extract ….
#

TELINIT
/sbin/telinit is linked to /sbin/init. It takes a one-character argu-
ment and signals init to perform the appropriate action. The following
arguments serve as directives to telinit:

0,1,2,3,4,5 or 6
tell init to switch to the specified run level.

a,b,c tell init to process only those /etc/inittab file entries having
runlevel a,b or c.

Q or q tell init to re-examine the /etc/inittab file.

S or s tell init to switch to single user mode.

U or u tell init to re-execute itself (preserving the state). No re-
examining of /etc/inittab file happens. Run level should be one
of Ss12345, otherwise request would be silently ignored.

telinit can also tell init how long it should wait between sending pro-
cesses the SIGTERM and SIGKILL signals. The default is 5 seconds, but
this can be changed with the -t sec option.

telinit can be invoked only by users with appropriate privileges.

[admin@nuxora admin]$
[admin@nuxora admin]$

Trap Key:

If the key combination CTRL-ALT-DEL is trapped by one entry in /etc/inittab
then the shutdown command will be called when you’ll press ctrl+alt+del

Everyone who has physical access to the console keyboard could shut the system down.
It will also check if the user is allowed to execute a ’shutdown’. To prevent this, you can
drop this line from /etc/inittab or modify the execution script:
ca::ctrlaltdel:echo “shutdown is not allowed pressing ctrl + alt + del”


Feb 01 2007

Bash Shell Tips

Catégorie : Tips and tricks, sysadmin, LinuxCharles Collier @ 10:51 pm

Native Windows users are reluctant to use Bash shell, even some linux geeks don’t know everything about the very useful shortcuts available in bash shell. But when you use all these shortcuts you can go very quickly ;-)

I’ve tried to compile all of them:
for example
$ Tab Tab –> press ‘$” then ‘Tab’ and another time ‘Tab’

Ctrl + r —> press at the same time ‘Ctrl’ key and ‘r’ key

special ones:

! - repeats the last command
! - execute the (num)th command in history

with TAB

Tab Tab - gives you all the main commands (eventually strating with )
/ Tab Tab - list complete directory structure
* Tab Tab - list directory without hidden one
~ Tab Tab - list users from /etc/passwd
$ Tab Tab - list the System variables
@ Tab Tab - list host(s) from /etc/hosts
= Tab Tab - list the content of a directory like ‘ls’

with CTRL Key

Ctrl + a - Jump to the beginning of the line
Ctrl + b - Move back one char
Ctrl + c - Interrupt the command
Ctrl + d - Delete from under the cursor
Ctrl + e - Jump to the end of the line
Ctrl + f - Move forward one char
Ctrl + h - Backspace
Ctrl + k - Delete to EOL
Ctrl + l - Clear the screen
Ctrl + n - Scroll next command line (read ctrl + p tips)
Ctrl + p - Scroll previous command line
Ctrl + r - Search the history backwards
Ctrl + R - Search the history backwards with multi-occurrence
Ctrl + t - Swap of the last two chars
Ctrl + u - Delete backward from cursor
Ctrl + w - Delete the last word
Ctrl + xx - Move between EOL and current cursor position
Ctrl + x @ - Show possible hostname completions (the same like ‘@ Tab Tab’)
Ctrl + y - paste
Ctrl + z - Suspend/ Stop the command

with ALT Key

Alt + < - Move to the first line in the history
Alt + > - Move to the last line in the history
Alt + ? - Show current completion list
Alt + * - Insert all possible completions
Alt + / - Attempt to complete filename
Alt + . - Yank last argument to previous command
Alt + b - Move backward
Alt + c - Capitalize the word
Alt + d - Delete word
Alt + f - Move forward
Alt + l - Make word lowercase
Alt + n - Search the history forwards non-incremental
Alt + p - Search the history backwards non-incremental
Alt + r - Recall command
Alt + t - Move words around
Alt + u - Make word uppercase
Alt + backspace - Delete the last word (like Ctrl + w)


Feb 01 2007

JBoss - open source J2EE application server

Catégorie : Jboss, Tutoriaux, LinuxCharles Collier @ 10:45 pm

* What is Jboss?
* Downloading Jboss
* Installing JBoss
-with command line
-with graphical mode
* Running JBoss
* Exploring the Directory Structure
* Configuration
* Deploying an application to JBoss
* Summary

JBoss is an open source J2EE application server. It is J2EE 1.4 spec-compliant, which means that it offers the same level of functionality as its more expensive commercial counterparts such as Oracle Application Server, Websphere (IBM) or Weblogic (BEA). The main difference is the price and to be honest the main admin interface.For example, an absolute beginner would find more comfortable to have a web interface to declare a jdbc datasource, instead of declaring it with “VI” editing an xml file. Considering the reliability of other open source products like Apache web server, Jboss should also become more popular and reliable, but it has already begun to become a serious competitor for the market leaders.

Although the term application server applies to all platforms, it has become heavily identified with the Sun Microsystems J2EE platform; we should always say Jboss is a J2EE application server

What is Jboss?

Go to the JBoss Application Server Downloads page. -> http://labs.jboss.com/portal/jbossas/download

Choose the latest production version of the JBoss Application Server package. (4.0.5 Production 2006-10-18) Since the 4.0.3 SP1 version, you can try a “Run Installer” http://jboss.sourceforge.net/jnlp/jems-installer-1.2.0.GA.jnlp or download it. You must have a X console or a graphical interface to use it.


Feb 01 2007

Oracle Application Server 10g - part I - Presentation & Introduction

Catégorie : Tutoriaux, Oracle Application Server, OracleCharles Collier @ 9:02 pm

Oracle Application Server (latest version 10g) also called OAS 10g is a very huge box. OAS is gathering various products: Oracle Portals, Oracle Reports, Oracle Forms,…. all of these running with the “kernel” of OAS: the OC4J container which belongs to the Application Server 10g instances. It is the main component of OAS. Using it, we got a Three-tier model architecture.

Three-tier is a client-server architecture in which the user interface, functional process logic (”business rules”), data storage and data access are completely independent. There are developed and maintained as independent objects. A fundamental rule in a three tier architecture is that the Client tier never communicates directly with the Data tier; in a three-tier or three-layer model all communications go through the second-tier: the Middleware tier.

The different layers in an Oracle application server 10g architecture:

> Client tier
Contains the web browsers for end users

> OAS tier
Contains the OAS (especially the OC4 container), the OHS (Oracle HTTP server)
and the webcache (optional) (and sometimes other modules)

> Database tier
Contains the Database (Oracle one or another one)

Considering different aspects: business impacts, criticism, number of users…. and depending on “how much you have for your server architecture”, the Oracle application server 10g architecture can be considered as a Four-tier model.

If you firm was big enough, the OAS tier would be divided into two parts, and you would get this kind of architecture:

> Client tier
Contains the web browsers for end users

> OHS tier
the OHS (Oracle HTTP server) and the webcache (optional)

> OAS tier (or app. server tier)
Contains the OAS (especially the OC4 container) and the other OAS modules

> Database tier
Contains the Database (Oracle one or another one)

Why doing that ?

For security, flexibility, reliability… usually you don’t have only one server for each tier. At least you would have two servers for each tier. Therefore you can easily maintain the servers, you can shutdown one OHS and the application will still be available - of course it would mean that you have got a load-balancer, in front of the OHS

You can have a very scalable architecture depending on your needs and the evolution of your activities during the year.

OAS 10g is not a simple J2EE application server, it is full of optional modules/components, such as:

Middle tier:

J2EE & web services:
Oracle HTTP Server
Oracle AS Containers for J2EE(OC4J)
Oracle AS toplink
Oracle Business Components for Java (BC4J)
Oracle AS web services
Oracle XML developer Kit
Oracle PL/SQL
Oracle AS Map/viewer

Datamining:
Oracle Reports Server

A component which helps a lot for reports or spreadsheets filled with oracle database data.

Oracle Forms Server
format, and render end-user presentation pages, based on data in an Oracle Database.

Oracle Discoverer

Oracle Personalization
personalised webspace (url history customize data content)

Portal:
Oracle Portal

A component to create content-based web site.

Oracle Portal Developer Kit

Wireless:
Oracle AS wireless

Web Cache:
Oracle AS web Cache

‘interconnection’:
Oracle AS InterConnect

Oracle As ProcessConnect

Infrastructure:

Oracle Internet Directory (OID)
It is the oracle LDAP, to store all the user information

Single Sign-On (SSO)
authentication modules for all the oracle modules and many others which can base their system on it.

Oracle Certificate Authority

Metadata repository (or Infrastructure)
It stores Application Server 10g metadata and it manages multiple oracle components through a unique interface


« Page précédente