Visualizzazione post con etichetta Linux. Mostra tutti i post
Visualizzazione post con etichetta Linux. Mostra tutti i post

martedì 2 febbraio 2010

Tomcat 6 su CentOS 5

1.Scaricare dal sito della Sun java 6 update 10 jdk e jre versione bin
2.Scaricare da http://ant.apache.org Apache Ant 1.7.1 versione binaria (apache-ant-1.7.1-bin.tar.bz2)
3.Scaricare da http://tomcat.apache.org/ Apache Tomcat 6.0.20 versione binaria (apache-tomcat-6.0.20.tar.gz)
4.Creare la cartella /usr/java
5.Scompattare i file .bin di java in /usr/java
cd /usr/java
sh /root/jre-6u10-linux-i586.bin
sh /root/jdk-6u10-linux-i586.bin
6.Settare la variabile JAVA_HOME che punti in /usr/java/jdk1.6.0_10
7.Estrarre apache-ant in /usr/share
cd /usr/share
tar jxvf /root/apache-ant-1.7.1-bin.tar.bz2
ln -s apache-ant-1.7.1 apache-ant
8.Estrarre apache-tomcat in /usr/share
cd /usr/share
tar zxvf /root/apache-tomcat-6.0.20.tar.gz
ln -s apache-tomcat-6.0.20 tomcat6
9.Creare il link ad ant
ln -s /usr/share/apache-ant/bin/ant /usr/bin
10.Settare JAVA_HOME nel file catalina.sh in /usr/share/tomcat6/bin
11.Creare il file tomcat6 in /etc/init.d simile a questo:

##################START CUT######################################

#!/bin/bash
# This is the init script for starting up the
#  Jakarta Tomcat server
#
# chkconfig: 345 91 10
# description: Starts and stops the Tomcat daemon.
#
# THIS SCRIPT RUNS TOMCAT AS ROOT - BE AWARE

# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

# Here I installed Tomcat 6
tomcat=/usr/share/tomcat6
startup=$tomcat/bin/startup.sh
shutdown=$tomcat/bin/shutdown.sh

TOMCAT_USER="tomcat"
export CATALINA_PID=$tomcat/logs/catalina.pid

# Link created by the Sun JRE rmp
export JAVA_HOME=/usr/java/jdk1.6.0_10

start(){
 echo -n $"Starting Tomcat service: "
 #daemon -c
 #su - $TOMCAT_USER -c "$startup"
 $startup
 RETVAL=$?
 echo
}

stop(){
 #action $"Stopping Tomcat service: " su - $TOMCAT_USER -c "$shutdown"
 action $"Stopping Tomcat service: " $shutdown
 RETVAL=$?
 echo
}

restart(){
  stop
  start
}

# See how we were called.
case "$1" in
start)
 start
 ;;
stop)
 stop
 ;;
status)
      # This doesn't work ;)
 status tomcat6
 ;;
restart)
 restart
 ;;
*)
 echo $"Usage: $0 {start|stop|status|restart}"
 exit 1
esac

exit 0

###################### END CUT #################################



INSTALLAZIONE TOMCAT COMPLETATA
Se si vuole accedere agli appplicativi che girano su tomcat senza dover digitare il numero di porta (8080) allora è necessario configurare il jk connectors o il proxy_ajp.

Per il connector jk seguire i seguenti semplici passi:
1.Scaricare il connector da http://tomcat.apache.org/download-connectors.cgi (Binary Release và bene)
2.Rinominare il file scaricato in mod_jk.so e copiarlo nella cartella modules di apache
3.Creare il file jk_connectors.con in /etc/httpd/conf.d:
LoadModule jk_module modules/mod_jk.so
# Configuration for mod_jk.so.
JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile     /var/log/httpd/mod_jk.log
JkShmFile     /var/log/httpd/jk-runtime-status
JkLogLevel    info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkMount /app/* ajp13
JkMount /app2/* ajp13
4.Creare il file workers.properties in /etc/httpd/conf:
workers.tomcat_home=/usr/share/tomcat6/
workers.java_home=/usr/java/jdk
worker.list=ajp13
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.default.lbfactor=1
5.Avviare apache.


martedì 15 settembre 2009

ACL File Sytem avanzate

Comandi per gestione acl:

setfacl -b file - Rimuove le acl estese
setfacl -m u:user1:r file - Aggiunge il permesso all'utente user1 di lettura sul file
setfacl -m g:group1:r file - Aggiunge il permesso al gruppo group1 di lettura sul file
setfacl -x g:"group1" file - Rimuove il gruppo dal file

Altre Opzioni
-R Recursive
--restore=file_backup Ripristana le acl scritte nel file file_backup, creato con il comando getfacl -RP --skip-base.


lunedì 31 agosto 2009

Comandi Utili

Trovare UUID
# blkid
Copia completa partizione con permessi e special files
# cp -dpRx /* /mnt/
Wget download tutti i file gif da una cartella
#wget -r -l1 --no-parent -A.gif http://www.server.com/dir/


giovedì 6 agosto 2009

Estendere il disco Root con LVM ed ext3

Per estendere la partizione root (/) su lvm seguire i seguenti passaggi:

Dò per scontato che sulla macchina sia già installato un disco aggiuntivo con una partizione lvm libera (8e), e che il filesystem di root / sia ext3.

Creiamo il
physical volume in lvm:
pvcreate /dev/sdbx
vgextended VolGroup00 /dev/sdbx

Controlliamo quanto spazio abbiamo
vgdisplay |grep Free
Free  PE / Size       255 / 7,8GB

Estendiamo il device
lvextend -l255 /dev/VolGroup00/LogVol00

E alla fine facciamo il resize della partizione.
resize2fs /dev/VolGroup00/LogVol00

Essendo un filesystem ext3 e l'operazione che eseguiamo è di aumentare lo spazio possiamo eseguire l'operazione "a caldo", se invece dovevamo diminuire lo spazio del disco dovevamo farlo a sistema fermo.


giovedì 26 febbraio 2009

Shortcuts di Bash

Navigando in internet ho trovato questo elenco di tasti rapidi da utilizzare con bash:

____________CTRL Key Bound_____________
Ctrl + a - Jump to the start of the line
Ctrl + b - Move back a char
Ctrl + c - Terminate the command
Ctrl + d - Delete from under the cursor
Ctrl + e - Jump to the end of the line
Ctrl + f - Move forward a char
Ctrl + k - Delete to EOL
Ctrl + l - Clear the screen
Ctrl + r - Search the history backwards
Ctrl + R - Search the history backwards with multi occurrence
Ctrl + u - Delete backward from cursor
Ctrl + xx - Move between EOL and current cursor position
Ctrl + x @ - Show possible hostname completions
Ctrl + z - Suspend/ Stop the command

____________ALT Key Bound___________
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 + back-space - Delete backward from cursor

----------------More Special Keybindings-------------------

Here "2T" means Press TAB twice

$ 2T - All available commands(common)
$ (string)2T - All available commands starting with (string)
$ /2T - Entire directory structure including Hidden one
$ 2T - Only Sub Dirs inside including Hidden one
$ *2T - Only Sub Dirs inside without Hidden one
$ ~2T - All Present Users on system from "/etc/passwd"
$ $2T - All Sys variables
$ @2T - Entries from "/etc/hosts"
$ =2T - Output like ls or dir


Fonte: http://linuxhelp.blogspot.com/2005/08/bash-shell-shortcuts.html

martedì 11 novembre 2008

chmod e umask

  • chmod 777 is the same as umask=000 (or rwx)
  • chmod 666 is the same as umask=111 (or rw-)
  • chmod 555 is the same as umask=222 (or r-x)
  • chmod 444 is the same as umask=333 (or r--)
  • chmod 333 is the same as umask=444 (or -wx)
  • chmod 222 is the same as umask=555 (or -w-)
  • chmod 111 is the same as umask=666 (or --x)
  • chmod 000 is the same as umask=777 (or ---)

giovedì 25 ottobre 2007

Configurare pptpd in Linux per VPN con Windows

Queste istruzioni sono testate su Debian 4.0. Installare il programma pptpd: apt-get install pptpd Modificare il file /etc/pptpd.conf inserendo le seguenti informazioni: localip indirizzo ip locale del server pptpd remoteip indirizzi ip da assegnare ai client remoti (es. 192.168.0.15-20) Nel file /etc/ppp/pptpd-options modificare i seguenti paramentri ms-dns indirizzo ip server dns ms-wins indirizzo ip server wins name pptpd Aggiungere nel file /etc/ppp/chap-secrets gli utenti che si devono collegare con la seguente sintassi: user pptpd password * Se pptpd è installato sul firewall abilitare le seguenti porte: In INPUT sull'interfaccia collegata ad internet la porta tcp 1723 In INPUT sull'interfaccia ppp0 udp 67, 137, 138 Nella catena FORWARD impostare le regole per i pacchetti che dovranno passare dall'interfaccia ppp0 verso la lan e viceversa.

martedì 16 ottobre 2007

Gestione Sosftware Suse

Per gestire il software con Suse da console (senza Yast) si deve utilizzare il programma zypper. zypper sl Visualizza l'elenco dei servizi (sito download) zypper sa Aggiunge un nuovo servizio (sito download) zypper sd Elimina un nuovo servizio (sito download) zypper sr Rinomina un nuovo servizio (sito download) zypper sh Entra nella Shell zypper install pacchetto Installa il pacchetto Per altre info sull'utilizzo: Zypper Usage

giovedì 20 settembre 2007

Disabilitare beep dalla Console

Per disabilitare il beep della console bisogna lanciare il seguente comando:
#setterm -blength 0
Sotto server X:
#xset b offIn Debian è possibile inserire la seguente riga nel
file .inputrc nella home dell'utente:
set bell-style none
echo "set bell-style none" > .inputrc

martedì 14 agosto 2007

Estrarre i file da un rpm senza installarlo

A volte può servire estrarre i file di un pacchetto rpm per senza doverlo installare. Per fare questo bisogna la lanciare i seguenti comandi: $rpm2cpio murpmfile.rpm | cpio -idmv I file verranno estratti nella directory corrente.