hgbook
diff es/collab.tex @ 436:0d6c97362064
translated cgi configuration
author | Igor TAmara <igor@tamarapatino.org> |
---|---|
date | Thu Dec 04 00:30:24 2008 -0500 (2008-12-04) |
parents | e5c5918e8230 |
children | 22391f67dc26 |
line diff
1.1 --- a/es/collab.tex Sat Nov 29 19:46:33 2008 -0500 1.2 +++ b/es/collab.tex Thu Dec 04 00:30:24 2008 -0500 1.3 @@ -694,47 +694,52 @@ 1.4 chmod 755 ~/public_html 1.5 \end{codesample2} 1.6 1.7 -\subsubsection{What could \emph{possibly} go wrong?} 1.8 +\subsubsection{¿Qué \emph{podría} resultar mal?} 1.9 \label{sec:collab:wtf} 1.10 1.11 -Once you've copied the CGI script into place, go into a web browser, 1.12 -and try to open the URL \url{http://myhostname/~myuser/hgweb.cgi}, 1.13 -\emph{but} brace yourself for instant failure. There's a high 1.14 -probability that trying to visit this URL will fail, and there are 1.15 -many possible reasons for this. In fact, you're likely to stumble 1.16 -over almost every one of the possible errors below, so please read 1.17 -carefully. The following are all of the problems I ran into on a 1.18 -system running Fedora~7, with a fresh installation of Apache, and a 1.19 -user account that I created specially to perform this exercise. 1.20 - 1.21 -Your web server may have per-user directories disabled. If you're 1.22 -using Apache, search your config file for a \texttt{UserDir} 1.23 -directive. If there's none present, per-user directories will be 1.24 -disabled. If one exists, but its value is \texttt{disabled}, then 1.25 -per-user directories will be disabled. Otherwise, the string after 1.26 -\texttt{UserDir} gives the name of the subdirectory that Apache will 1.27 -look in under your home directory, for example \dirname{public\_html}. 1.28 - 1.29 -Your file access permissions may be too restrictive. The web server 1.30 -must be able to traverse your home directory and directories under 1.31 -your \dirname{public\_html} directory, and read files under the latter 1.32 -too. Here's a quick recipe to help you to make your permissions more 1.33 -appropriate. 1.34 +Cuando haya ubicado el CGI en el sitio correspondiente con un navegador 1.35 +intente visitar el URL \url{http://myhostname/~myuser/hgweb.cgi}, 1.36 +\emph{sin} dejarse abatir por un error. Hay una alta probabilidad de 1.37 +que esta primera visita al URL sea fallida, y hay muchas razones posibles 1.38 +para este comportamiento. De hecho, podría toparse con cada uno de los 1.39 +errores que describimos a continuación, así que no deje de leerlos 1.40 +cuidadosamente. A continuación presento los problemas que yo tuve en 1.41 +un sistema con Fedora~7, con una instalación nueva de Apache, y una 1.42 +cuenta de usuario que creé específicamente para desarrollar este 1.43 +ejercicio. 1.44 + 1.45 +Su servidor web puede tener directorios por usuario deshabilitados. Si 1.46 +usa Apache, busque el fichero de configuración que contenga la 1.47 +directiva \texttt{UserDir}. Si no está presente en sitio alguno, los 1.48 +directorios por usuario están deshabilitados. Si la hay, pero su 1.49 +valor es \texttt{disabled}, los directorios por usuario estarán 1.50 +deshabilitados. La directiva \texttt{UserDir} en caso contrario tendrá 1.51 +el nombre del subdirectorio bajo el cual Apache mirará en el 1.52 +directorio de cada usuario, por ejemplo \dirname{public\_html}. 1.53 + 1.54 +Los permisos de sus ficheros pueden ser demasiado restrictivos. El 1.55 +servidor web debe poder recorrer su directorio personal y los 1.56 +directorios que estén bajo \dirname{public\_html}, además de tener 1.57 +permiso para leer aquellos que estén adentro. A continúación una 1.58 +receta rápida para hacer que sus permisos estén acordes con las 1.59 +necesidades básicas. 1.60 \begin{codesample2} 1.61 chmod 755 ~ 1.62 find ~/public_html -type d -print0 | xargs -0r chmod 755 1.63 find ~/public_html -type f -print0 | xargs -0r chmod 644 1.64 \end{codesample2} 1.65 1.66 -The other possibility with permissions is that you might get a 1.67 -completely empty window when you try to load the script. In this 1.68 -case, it's likely that your access permissions are \emph{too 1.69 - permissive}. Apache's \texttt{suexec} subsystem won't execute a 1.70 -script that's group-~or world-writable, for example. 1.71 - 1.72 -Your web server may be configured to disallow execution of CGI 1.73 -programs in your per-user web directory. Here's Apache's 1.74 -default per-user configuration from my Fedora system. 1.75 +Otra posibilidad con los permisos es que obtenga una ventana 1.76 +completamente en blanco cuando trata de cargar el script. En cuyo 1.77 +caso, es posible que los permisos que tiene son \emph{demasiado 1.78 + permisivos}. El subsistema \texttt{suexec} de Apache no ejecutará un 1.79 +script que tenga permisos de escritura para el group o el planeta, por 1.80 +ejemplo. 1.81 + 1.82 +Su servidor web puede estar configurado para evitar la ejecución de 1.83 +programas CGI en los directorios de usuario. A continuación presento 1.84 +una configuración predeterminada por usuario en mi sistema Fedora. 1.85 + 1.86 \begin{codesample2} 1.87 <Directory /home/*/public_html> 1.88 AllowOverride FileInfo AuthConfig Limit 1.89 @@ -749,38 +754,38 @@ 1.90 </LimitExcept> 1.91 </Directory> 1.92 \end{codesample2} 1.93 -If you find a similar-looking \texttt{Directory} group in your Apache 1.94 -configuration, the directive to look at inside it is \texttt{Options}. 1.95 -Add \texttt{ExecCGI} to the end of this list if it's missing, and 1.96 -restart the web server. 1.97 - 1.98 -If you find that Apache serves you the text of the CGI script instead 1.99 -of executing it, you may need to either uncomment (if already present) 1.100 -or add a directive like this. 1.101 +Si encuentra un grupo de instrucciones de \texttt{Directory} similares 1.102 +en su configuración de Apache, la directiva a revisar es \texttt{Options}. 1.103 +Adicione \texttt{ExecCGI} al final de esta lista en caso de que haga 1.104 +falta y reinicie su servidor web. 1.105 + 1.106 +Si resulta que Apache le muestra el texto del script CGI en lugar de 1.107 +ejecutarlo, necesitará o bien descomentar(si se encuentra presente) o 1.108 +adicionar una directiva como la siguiente: 1.109 \begin{codesample2} 1.110 AddHandler cgi-script .cgi 1.111 \end{codesample2} 1.112 1.113 -The next possibility is that you might be served with a colourful 1.114 -Python backtrace claiming that it can't import a 1.115 -\texttt{mercurial}-related module. This is actually progress! The 1.116 -server is now capable of executing your CGI script. This error is 1.117 -only likely to occur if you're running a private installation of 1.118 -Mercurial, instead of a system-wide version. Remember that the web 1.119 -server runs the CGI program without any of the environment variables 1.120 -that you take for granted in an interactive session. If this error 1.121 -happens to you, edit your copy of \sfilename{hgweb.cgi} and follow the 1.122 -directions inside it to correctly set your \envar{PYTHONPATH} 1.123 -environment variable. 1.124 - 1.125 -Finally, you are \emph{certain} to by served with another colourful 1.126 -Python backtrace: this one will complain that it can't find 1.127 -\dirname{/path/to/repository}. Edit your \sfilename{hgweb.cgi} script 1.128 -and replace the \dirname{/path/to/repository} string with the complete 1.129 -path to the repository you want to serve up. 1.130 - 1.131 -At this point, when you try to reload the page, you should be 1.132 -presented with a nice HTML view of your repository's history. Whew! 1.133 +Otra posibilidad es que observe una traza de Python en colores 1.134 +informando que no puede importar un módulo relacionado con 1.135 +\texttt{mercurial}. Esto es un gran progreso! El servidor es capaz 1.136 +de ejecutar su script CGI. Este error solamente ocurrirá si está 1.137 +ejecutando una instalación privada de Mercurial en lugar de una 1.138 +instalación para todo el sistema. Recuerde que el servidor que 1.139 +ejecuta el programa CGI no cuenta con variables de ambiente de las 1.140 +cuales usted si dispone en una sesión interactiva. Si este error le 1.141 +ocurre, edite su copia de \sfilename{hgweb.cgi} y siga las indicaciones 1.142 +dentro del mismo para establecer de forma adecuada su variable de 1.143 +ambiente \envar{PYTHONPATH}. 1.144 + 1.145 +Finalmente, si encuentra \emph{otra} traza a todo color de Python al visitar 1.146 +el URL: Esta seguramente se referirá a que no puede encontrar 1.147 +\dirname{/path/to/repository}. Edite su script \sfilename{hgweb.cgi} 1.148 +y reemplaze la cadena \dirname{/path/to/repository} con la ruta 1.149 +completa al repositorio que desea servir. 1.150 + 1.151 +En este punto, cuando trate de recargar la página, deberá visualizar 1.152 +una linda vista HTML de la historia de su repositorio. Uff! 1.153 1.154 \subsubsection{Configuring lighttpd} 1.155