| At line 2 added one line |
| [{TableOfContents }] |
| At line 4 added 14 lines |
| !!ATTENZIONE TOMCAT 6 PROBLEMA ENCODING/CHARSET: |
| {{{ |
| People, Tomcat 6 has disabled the standard servlet behavior by default. |
|
| To make it work you should add |
| -Dorg.apache.catalina.STRICT_SERVLET_COMPLIANCE=true to your startup |
| script. If you don't, the server response will not include the |
| encoding bit, even if the browser has provided an Accept-Language |
| header. The symptoms are that loom will lose any accented characters |
| (áéí... you know what I mean). Adding this flag should get it fixed. |
|
| I have updated the docs and the Loom "start tomcat" eclipse config. |
| }}} |
|
| At line 8 changed one line |
| # Il connector libapache2-mod-jk si può scaricare [mod_jk|http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/] oppure utilizzare la versione proposta nativamente sal Sistema operativo.\\ Attenzione: il connector di tomcat con apache dipende dal version di apache. |
| # Il connector libapache2-mod-jk si può scaricare [mod_jk|http://www.apache.org/dist/tomcat/tomcat-connectors/jk/binaries/] oppure utilizzare la versione proposta nativamente sal Sistema operativo.\\ Attenzione: il connector di tomcat con apache dipende dal version di apache. |
| At line 29 added 7 lines |
| ! Avvio : |
| Nel caso di utilizzo di tomcat con il connettore ad apache è meglio |
| #avviare prima tomcat: /etc/init.d/tomcat start |
| #avviare apache: /etc/init.d/apache2 start |
|
| Allo stesso modo per un riavvio di tomcat sarebbe meglio spegnere apache, riavviare tomcat e avviare apache |
|
| At line 15 changed one line |
| Per attivare tomcat come servizio nel caso di installazione indipendente dal sistema bisogna create il file /etc/init.d/tomcat che implementi i tre comandi fondamentali di servizo (start-stop-restart). Per ubuntu vedere [ubuntu|http://www.wiki.telnext.com/Wiki.jsp?page=Ubuntu] gestione servizi.\\ Lo script di [avvio di tomcat |avviotomcat] può contenere il comando |
| Per attivare tomcat come servizio nel caso di installazione indipendente dal sistema bisogna create il file /etc/init.d/tomcat che implementi i tre comandi fondamentali di servizo (start-stop-restart). Per ubuntu vedere [ubuntu|http://www.wiki.telnext.com/Wiki.jsp?page=Ubuntu] gestione servizi.\\ Lo script di [avvio di tomcat |avviotomcat] può contenere il comando (in fase di start) |
| At line 18 changed one line |
| cat /opt/template/inizio.xml /etc/apache2/conf.d/vhost.xml/*xml /opt/template/fine.xml > /opt/tomcat/conf/server.xml |
| cat /opt/template/inizio.xml /etc/apache2/conf.d/vhost.xml/*xml /opt/template/fine.xml |
| > /opt/tomcat/conf/server.xml |
| At line 21 changed one line |
| che ricrea il file di configurazione server.xml di tomcat includendo eventuali nuovi siti. |
| che ricrea il file di configurazione server.xml di tomcat includendo eventuali nuovi siti.\\ |
| At line 46 added 7 lines |
| Inoltre può contenere le JAVA_OPTS come ad esempio |
| %%prettify |
| {{{ |
| export JAVA_OPTS="-server -Xms512M -Xmx512M -Xss128K" |
| }}} |
| /% |
|
| At line 97 added 38 lines |
| ! Connettore apache-tomcat (mod_jk) |
|
| #Procedura manuale (sconsigliata) |
| ##rinominare il connettore scaricato in mod_jk.so e metterlo ad esempio in /usr/lib/apache2/modules/ |
| ##editare /etc/apache2/apache2.conf e aggiungere in fondo LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so |
| #Procedura automatica: utilizzare gli strumenti che la tua distribuzione linux offre per installare un pacchetto (ad esempio per ubuntu aptitude install libapache2-mod-jk). Verificare che il modulo sia poi presente tra quelli enabled (ad esempio in /etc/apache2/mods-enabled) |
|
| A questo punto è necessario configurare: |
| #[workers.properties] e metterlo in /opt/tomcat/conf |
| #editare /etc/apache2/apache2.conf e aggiungere |
| %%prettify |
| {{{ |
| JkWorkersFile "/opt/tomcat/conf/workers.properties" |
| JkLogFile "/opt/tomcat/logs/mod_jk.log" |
| JkLogLevel info |
| JkLogStampFormat "[%a %b %d %H:%M:%S %Y]" |
| }}} |
| /% |
|
| ! Caricare i VirtualHost creati con [addvirtual] |
| Per indicare ad apache dove prelevare le definizioni dei VirtualHost occorre editare /etc/apache/apache2.conf e |
| %%prettyif |
| {{{ |
| commentare le seguenti |
| #Include /etc/apache2/conf.d/[^.#]* |
| e anche |
| #Include /etc/apache2/sites-enabled/[^.#]* |
|
| aggiungere la seguente |
|
| Include /etc/apache2/conf.d/vhost.d/*.conf |
|
| e anche |
|
| NameVirtualHost qui |
| }}} |
| /% |
|
| At line 73 changed one line |
| IPMACCHINA qui\\ |
| IPMACCHINA qui |
| At line 89 changed one line |
| E' un tool di creazione statistiche web. le relative configurazioni sono comprese nel file /opt/template/webalizer.conf |
| E' un tool di creazione statistiche web. le relative configurazioni sono comprese nel file /opt/template/[webalizer.conf].\\ |
| Per lanciare l'aggiornamento delle statistiche creare un file in /opt/script/[runstat] da lanciare con un cron tutte i giorni. |
| At line 92 changed one line |
| Tool di rotazione dei file di log access.log ed error.log. La relativa configurazione è compresa nel file logrotate.conf. |
| Tool di rotazione dei file di log access.log ed error.log. La relativa configurazione è compresa nel file [logrotate.conf]. |
|
| !! Errori o Warning all'avvio di Tomcat o Apache |
|
| Se all'avvio di tomcat da un info di questo tipo:\\ |
| 17-mar-2008 16.20.08 org.apache.catalina.core.StandardContext addApplicationListener |
| INFO: The listener "listeners.ContextListener" is already configured for this context. The duplicate definition has been ignored.\\ |
| 17-mar-2008 16.20.08 org.apache.catalina.core.StandardContext addApplicationListener |
| INFO: The listener "listeners.SessionListener" is already configured for this context. The duplicate definition has been ignored.\\ |
| Togliere o commentare da:\\ |
| /opt/tomcat/webapps/examples/WEB-INF/web.xml\\ |
| i riferimenti a |
| %%prettyif |
| {{{ |
| <!--Define example application events listeners//--> |
| <listener> |
| <listener-class>listeners.ContextListener</listener-class> |
| </listener> |
| <listener> |
| <listener-class>listeners.SessionListener</listener-class> |
| </listener> |
|
| }}} |
| /% |
| Comunque è un baco di tomcat che in qualsiasi web.xml compare un listener cerca di caricarlo 2 volte. |
| ------------------------------------------------------------- |
| Se in fase di avvio di apache risponde: API module structure `jk_module' in file /usr/lib/apache2/modules/mod_jk.so is garbled - perhaps this is not an Apache module DSO? Vuol dire che il mod_jk installato non è adeguato alla versione di apache... sostituirlo con un connector della versione giusta. |
| ------------------------------------------------------------- |
| se nell'error.log di apache compare spesso\\ \\ |
|
| error client 1 Directory index forbidden by Options directive srvwwwhtdocs\\ \\ |
|
| in /srv/www/htdocs aggiungere un file index.htm\\ \\ |
|
|
| Questo sembrerebbe dovuto a:\\ \\ |
|
| Requests From the Server to Itself |
| When the Apache HTTP Server manages its child processes, it needs a way to wake up processes that are listening for new connections. To do this, it sends a simple HTTP request back to itself. This request will appear in the access_log file with the remote address set to the loop-back interface (typically 127.0.0.1 or ::1 if IPv6 is configured). If you log the User-Agent string (as in the combined log format), you will see the server signature followed by "(internal dummy connection)" on non-SSL servers. During certain periods you may see up to one such request for each httpd child process. \\ \\ |
|
| These requests are perfectly normal and you do not, in general, need to worry about them. They can simply be ignored. \\ \\ |
|
| If you wish to exclude them from your log, you can use normal conditional-logging techniques. For example, to omit all requests from the loopback interface from your logs, you can use \\ \\ |
|
| SetEnvIf Remote_Addr "127\.0\.0\.1" loopback\\ |
| and then add env=!loopback to the end of your CustomLog directive. \\ \\ |
|
| In 2.2.6 and earlier, in certain configurations, these requests may hit a heavy-weight dynamic web page and cause unnecessary load on the server. You can avoid this by using mod_rewrite to respond with a redirect when accessed with that specific User-Agent or IP address. |
| ------------------------------------------------------------------------------- |