Note that there are some explanatory texts on larger screens.

plurals
  1. POPermission error zc.buildout with nginx
    text
    copied!<p>I created a zc.buildout config that automatically installs nginx, with configuration and startup script.</p> <p>Everything works, except that, in order to run nginx succesfully, I must run it as <code>sudo</code>. I'm running this under ubunut, and just wondering why it is that I have to do this. Please note that this is nginx installed locally in my buildout, <em>not</em> system wide.</p> <p>Here is my <code>develop.cfg</code> buildout configuration.</p> <pre><code>[buildout] extends = buildout.cfg parts += gunicorn pcre-source nginx webserver launcher [opts] control-script = ${django:control-script} user = andre server_name = localhost listen_port = 443 media_dir = ${buildout:directory}/cdn/ workers = 2 pidfile = ${buildout:directory}/bin/${opts:control-script}.pid socketfile = ${buildout:directory}/bin/${opts:control-script}.sock [gunicorn] recipe = zc.recipe.egg:scripts dependent-scripts = true eggs = ${buildout:eggs} eventlet gunicorn [pcre-source] recipe = hexagonit.recipe.download url = ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.33.tar.gz strip-top-level-dir = true [nginx] recipe = hexagonit.recipe.cmmi url = http://nginx.org/download/nginx-1.4.1.tar.gz environment-section = environment configure-options = --with-pcre=${pcre-source:location} --with-http_ssl_module [webserver] recipe = gocept.nginx configuration = worker_processes 1; events { worker_connections 1024; } http { include ${buildout:directory}/parts/nginx/conf/mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 70; server { server_name localhost; listen 443; access_log ${logs:access_log}; ssl on; ssl_certificate ${buildout:directory}/dev/server.crt; ssl_certificate_key ${buildout:directory}/dev/server.key; location ^~ /media/ { root ${opts:media_dir}; expires 31d; } location ^~ /static/ { root ${opts:media_dir}; expires 31d; } location / { proxy_pass http://unix:${opts:socketfile}:; proxy_pass_header Server; proxy_set_header Host $http_host; proxy_redirect off; proxy_connect_timeout 10; proxy_read_timeout 10; proxy_set_header X-Scheme $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } } [launcher] recipe = collective.recipe.template input = templates/launcher.sh output = ${buildout:directory}/bin/${opts:control-script}.sh mode = 755 </code></pre> <p>So, using this configuration, after running buildout, running it normally like this:</p> <pre><code>$ ./bin/webserver start Starting nginx nginx: [emerg] bind() to 0.0.0.0:443 failed (13: Permission denied) </code></pre> <p>however, running with sudo it starts up successfully:</p> <pre><code>$ sudo ./bin/webserver start Starting nginx $ </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload