我尝试启动 Nginx,并在执行以下命令后出现以下错误:
sudo /etc/init.d/nginx start
Starting nginx: start-stop-daemon: unable to start /usr/local/nginx (Permission denied)
我的配置文件是:
user www-data www-data;
worker_processes 1;
events {
worker_connections 2048;
}
http {
include mime.types;
default_type application/octet-stream;
access_log off
sendfile on;
tcp_nopush on;
tcp_nodelay off;
keepalive_timeout 10;
gzip on;
gzip_comp_level 2;
gzip_proxied any;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
include /usr/local/nginx/sites-enabled/*;
}
答案1
尝试:
chmod +x /usr/local/nginx