Si chiama //server di produzione// il sistema dove viene installata l'applicazione sviluppata, utilizzabile dagli utenti finali. Al contrario, il sistema dove l'applicazione viene sviluppata è chiamato //server di sviluppo//. Ci sono alcune differenze da tenere in considerazione per un server di produzione, allo scopo di ottimizzare l'esecuzione della vostra applicazione basata su Jelix, e per consentire una adeguata protezione del server stesso. ===== Scegliere l'edizione corretta di Jelix ===== Per sviluppare, scegliete l'edizione "developer"; questa versione include strumenti e script a linea di comando ed altre utilità per lo sviluppo. Per l'installazione su un server di produzione è preferibile installare l'edizione "optimized". Come indica il nome, è stata ripulita di quanto non essenziale in fase di produzione, ma le vostre applicazioni funzioneranno esattamente come nelle altre edizioni di Jelix. Le prestazioni saranno invece leggermente migliorate. Anche se sceglierete di produrre con la versione "developer" non ci sono problemi dinota. Tuttavia è preferibile rimuovere tutti gli script a linea di comando contenuti nella cartella @@F@lib/jelix-scripts@@. Anche una versione "gold" è disponibile; è pensata per gli sviluppatori che vogliano modificare le configurazioni e, specialmente installare estensioni PHP. Inoltre questa edizione usa alcune estensioni PHP che non sono diffuse in tutti i sistemi, ma che sono legate in modo particolare al modo in cui Jelix opera internamente. La versione "gold" migliora sensibilmente le prestazioni delle vostre applicazioni. Tuttavia dovrete compilare da soli tali estensioni; i sorgenti sono inclusi nel pacchetto dell'edizione stessa. ===== Configurazione ===== Il processo di installazione è identico all'ambiente di sviluppo, incluso quanto riguarda l'applicazione stessa. Allo scopo di ottenere le migliori prestazioni e garantire una maggiore sicurezza, di seguito sono riportati alcuni consigli aggiuntivi. ==== About the server configuration ==== * all directories, except the @@F@www@@ directory of your app, should be outside the document root of the web site. So you should set the root of your web site on this @@F@www@@ directory or move the content of www to the root of your web site. See the [[en:manual-1.1:application-configuration#server-configuration|chapter on the application configuration]] for examples of such configuration. * To specify the rights well on the @@F@temp/your_app/@@ directory. For example, the user which runs Apache should have write rights an this directory. It is not recommended on linux, to chmod 0777 on the temp directory ;-) ==== About the application ==== Here some advices for the configuration of the application, in the @@F@var/config/defaultconfig.ini.php@@ file. === error_handling section === In the section @@error_handling@@, the following configuration is highly advised: [error_handling] messageLogFormat = "%date%\t[%code%]\t%msg%\t%file%\t%line%\n" logFile = error.log email = root@localhost emailHeaders = "From: webmaster@yoursite.com\nX-Mailer: Jelix\nX-Priority: 1 (Highest)\n" quietMessage="A technical error has occured. Sorry for this trouble." showInFirebug = off ; keywords you can use : ECHO, ECHOQUIET, EXIT, LOGFILE, SYSLOG, MAIL, TRACE default = ECHOQUIET EXIT LOGFILE error = ECHOQUIET EXIT LOGFILE warning = ECHOQUIET LOGFILE notice = strict = ; for the exceptions, there is implicitly EXIT exception = ECHOQUIET LOGFILE It is not advised to use the keyword @@L@ECHO@@, which posts all the details of the errors on the website (information which could be useful for pirates), but rather @@L@ECHOQUIET@@, which posts simply the message indicated in the parameter @@V@quietMessage@@. However, it is useful to be informed of the errors and their details. Also, parallel to @@L@ECHOQUIET@@, it is recommended to add one of these key words * @@L@LOGFILE@@: the errors are inserted in the file indicated in @@V@logFile@@. * @@L@SYSLOG@@: the errors are recorded on the level of the system. * @@L@EMAIL@@: the errors are sent by email to @@V@email@@. Be careful with the use of @@L@EMAIL@@: use it only once you know that your application functions well on the production server. Else you may be flooded with emails (and your hosting provider may not be very happy with that, and could think you're a spammer). Be careful also with the use of @@L@SYSLOG@@: put this option only if it is your own server (i.e. you are an administrator of the machine). Else the owner of the machine is likely not to appreciate. In conclusion: @@L@LOGFILE@@ is recommended instead of @@L@EMAIL@@ or @@L@SYSLOG@@. === compilation section === In the section @@V@[compilation]@@, you can deactivate the option @@V@checkCacheFiletime@@, and even more recommended, the option @@V@forces@@, if you activated it for the development. [compilation] checkCacheFiletime = off force = off The option @@V@checkCacheFiletime@@ prevents Jelix from checking all the time that the cache (files generated by Jelix for the files of configurations, the DAO, templates, etc.) is up to date compared to the files in the application directory. This checking is generally useless in production, since the application is rarely modified, and each modification is usually meant to be activated as fast as possible. Of course, if you deactivate it, **you should imperatively empty the directory of cache** (@@F@temp/myapp/@@) **at each update of your application**, so that your modifications are well taken into account. === mailer section === Do not forget to update the parameters of the @@V@[mailer]@@ section. Usually, the mailer parameters are different between your development server and your production server unless you use third party solutions.