User Tools

Site Tools


django_con_apache_y_mod_python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
django_con_apache_y_mod_python [08/07/2008 18:35]
fernando
django_con_apache_y_mod_python [02/05/2009 00:00] (current)
Line 63: Line 63:
  
 **NOTA:** El artículo [[http://​articles.slicehost.com/​2007/​9/​18/​apache-virtual-hosts-permissions|Apache Virtual Hosts - permissions]] explica de manera sencilla el tema de configuración de permisos en el contexto de un host virtual de Apache. Aún no entiendo bien por qué el usuario principal (es decir, el dueño de los archivos de Catalis) debería agregarse al grupo //​www-data//​. **NOTA:** El artículo [[http://​articles.slicehost.com/​2007/​9/​18/​apache-virtual-hosts-permissions|Apache Virtual Hosts - permissions]] explica de manera sencilla el tema de configuración de permisos en el contexto de un host virtual de Apache. Aún no entiendo bien por qué el usuario principal (es decir, el dueño de los archivos de Catalis) debería agregarse al grupo //​www-data//​.
 +
 +
 +
 +
 +
  
  
Line 77: Line 82:
 El siguiente ejemplo usa un único host virtual para ocuparse de las tres funciones descriptas más arriba. Fue testeado en Apache 2.2 sobre Ubuntu 8.04 (Hardy). El siguiente ejemplo usa un único host virtual para ocuparse de las tres funciones descriptas más arriba. Fue testeado en Apache 2.2 sobre Ubuntu 8.04 (Hardy).
  
-**NOTA 1:** debe reemplazarse **''​<​nowiki>​{{/path/to/catalis}}</​nowiki>​''​** por el path que corresponda.+**NOTA 1:** debe reemplazarse **''/​PATH/TO/CATALIS''​** por el path que corresponda.
  
-**NOTA 2:** El uso del puerto ​81 es sólo a modo de ejemplo. Si se opta por usar un puerto alternativo para el virtual host, posiblemente la directiva ''​Listen''​ deba moverse al archivo de configuración ''​ports.conf''​.+**NOTA 2:** El uso del puerto ​8080 es sólo a modo de ejemplo. Si se opta por usar un puerto alternativo para el virtual host, posiblemente la directiva ''​Listen''​ deba moverse al archivo de configuración ''​ports.conf'' ​(sólo aplicable a Debian/​Ubuntu?​).
  
  
Line 88: Line 93:
 # See http://​catalis.uns.edu.ar/​doku/​doku.php/​django_con_apache_y_mod_python # See http://​catalis.uns.edu.ar/​doku/​doku.php/​django_con_apache_y_mod_python
  
-Listen ​81 +Listen ​8080 
-NameVirtualHost *:81+NameVirtualHost *:8080
  
-<​VirtualHost *:81>+<​VirtualHost *:8080>
  
     # ------------------------------------------------------     # ------------------------------------------------------
     # Optional directives     # Optional directives
     # ------------------------------------------------------     # ------------------------------------------------------
-    ​#ServerName 127.0.0.1 ​(correct as appropriate)+    ServerName 127.0.0.1
     #​DocumentRoot (not needed!)     #​DocumentRoot (not needed!)
     #CustomLog     #CustomLog
Line 114: Line 119:
         # Specify which settings file is used         # Specify which settings file is used
         SetEnv DJANGO_SETTINGS_MODULE settings         SetEnv DJANGO_SETTINGS_MODULE settings
 +
 +        # Add the directory where the settings live
 +        PythonPath "​['/​PATH/​TO/​CATALIS/​django_files'​] + sys.path"​
  
         # Change this to '​Off'​ in a production environment         # Change this to '​Off'​ in a production environment
         PythonDebug On         PythonDebug On
- 
-        # Add the directory where the settings live 
-        PythonPath "​['​{{/​path/​to/​catalis}}/​django_files'​] + sys.path"​ 
     </​Location>​     </​Location>​
  
Line 128: Line 133:
     # Turn off mod_python for serving static files (css, js, images, xml, ...).     # Turn off mod_python for serving static files (css, js, images, xml, ...).
     # Note: in a virtual host we could use instead an appropriate value for DocumentRoot.     # Note: in a virtual host we could use instead an appropriate value for DocumentRoot.
-    Alias /​catalis/​media/​ "{{/path/to/catalis}}/​static_files/"​+    Alias /​catalis/​media/​ "/PATH/TO/CATALIS/​static_files/"​
     <​Location "/​catalis/​media/">​     <​Location "/​catalis/​media/">​
         SetHandler None         SetHandler None
     </​Location>​     </​Location>​
-    <​Directory "{{/path/to/catalis}}/​static_files/">​ +    <​Directory "/PATH/TO/CATALIS/​static_files/">​ 
-         ​Options +Indexes+        Order Allow,​Deny 
 +        Allow from all 
 +        ​Options +Indexes
     </​Directory>​     </​Directory>​
  
Line 141: Line 148:
     # ------------------------------------------------------     # ------------------------------------------------------
     # We want to run wxis using '/​catalis/​cgi-bin/​wxis'​     # We want to run wxis using '/​catalis/​cgi-bin/​wxis'​
-    ScriptAlias /​catalis/​cgi-bin/​ "{{/path/to/catalis}}/​cgi-bin/"​+    ScriptAlias /​catalis/​cgi-bin/​ "/PATH/TO/CATALIS/​cgi-bin/"​
     # Turn off mod_python here too     # Turn off mod_python here too
     <​Location "/​catalis/​cgi-bin/">​     <​Location "/​catalis/​cgi-bin/">​
Line 147: Line 154:
     </​Location>​     </​Location>​
     # Restrict access only to clients running on the same machine.     # Restrict access only to clients running on the same machine.
-    <​Directory "{{/path/to/catalis}}/cgi-bin/">+    <​Directory "/PATH/TO/CATALIS/​cgi-bin">​
         Order Deny,Allow         Order Deny,Allow
         Deny from all         Deny from all
Line 155: Line 162:
 </​VirtualHost>​ </​VirtualHost>​
 </​code>​ </​code>​
- 
- 
  
 ===== Testeo de la configuración ===== ===== Testeo de la configuración =====
  
 **TO-DO:** agregar algo aquí, p.ej. verificar que no se pueda acceder a wxis desde afuera, pero sí en forma local. **TO-DO:** agregar algo aquí, p.ej. verificar que no se pueda acceder a wxis desde afuera, pero sí en forma local.
 +
 +
 +
  
  
Line 169: Line 177:
 (En construcción!) (En construcción!)
  
-  * Python+  * Python ​2.5
  
-  * Django+  * Django ​0.96
  
-  * [[http://​httpd.apache.org/​download.cgi|Apache 2.2]] (versión: ''​apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi''​)+  * [[http://​httpd.apache.org/​download.cgi|Apache 2.2]] (versión: ''​apache_2.2.9-win32-x86-openssl-0.9.8h-r2.msi''​). Instalacion tipica, como servicio.
  
   * [[http://​httpd.apache.org/​modules/​python-download.cgi|mod_python]] (versión: ''​mod_python-3.3.1.win32-py2.5-Apache2.2.exe''​)   * [[http://​httpd.apache.org/​modules/​python-download.cgi|mod_python]] (versión: ''​mod_python-3.3.1.win32-py2.5-Apache2.2.exe''​)
     * instalar (ejecutar el ''​.exe''​);​ cuando pregunta por la carpeta de Apache, indicar la carpeta ''​Apache2.2''​.     * instalar (ejecutar el ''​.exe''​);​ cuando pregunta por la carpeta de Apache, indicar la carpeta ''​Apache2.2''​.
-    * agregar línea en httpd.conf''​LoadModule python_module modules/​mod_python.so''​+    * agregar línea en ''​httpd.conf''​
 + 
 +<code apache>​ 
 +LoadModule python_module modules/​mod_python.so 
 +</​code>​ 
 + 
 +  * Configuración de Apache: crear un archivo ​''​conf/​extra/​catalis.conf''​ y pegar allí la configuración sugerida más arriba (haciendo los cambios apropiados). Agregar esta línea al final de ''​conf/​httpd.conf'':​ 
 + 
 +<code apache>​ 
 +Include conf/​extra/​catalis.conf 
 +</​code>​ 
 + 
 +{{tag>​catalis desarrollo django apache}}
django_con_apache_y_mod_python.1215552916.txt.gz · Last modified: 08/07/2008 00:00 (external edit)