Ho seguito questo sito web http://raspberrypihelp.net/tutorials/24-raspberry-pi-webserver per configurare il nginx del server HTTP sul mio Raspberry Pi e provare a impostare una chiamata al sito example.com. Ma quando ho eseguito sudo service nginx restart
, ha dettonginx: [emerge] direttiva sconosciuta "" in /etc/nginx/sites-enabled/example.com:3
Riavvio nginx: nginx: [emerg] sconosciuto direttiva "" in /etc/nginx/sites-enabled/example.com:3
Ecco la codice in example.com.
server {
server_name example.com 192.168.1.88;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
root /srv/www/example.com/public/;
location/{
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/www/example.com/public$fastcgi_script_name;
}
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /phpMyAdmin {
rewrite ^/* /phpmyadmin last;
}
}
Sto solo seguendo i passaggi ma non può essere eseguito correttamente.
Quale versione di nginx è stata installata? Secondo questo sito web la versione che ottieni con apt-get presenta alcuni problemi. http://virtualitblog.blogspot.nl/2013/05/install-nginx-141-raspberry-pi.html Posso suggerire di aggiungere il repository apt nginx.org e reinstallare nginx? Puoi anche eseguire: ldd/usr/sbin/nginx e pubblicare i risultati da qualche parte con gist.github.com? –
Ho usato '/ usr/sbin/nginx -t -v' per verificare che sto usando nginx/1.2.1, ho seguito [http://nginx.org/en/linux_packages.html](http : //nginx.org/en/linux_packages.html) per aggiungerlo in apt.list, quando eseguo 'sudo apt-get install nginx' restituisce ** nginx è alreasy la versione più recente. **. Una cosa che ho dimenticato di dire è che posso andare a [http://127.0.0.1/](http://127.0.0.1/) Posso vedere il sito predefinito (**/usr/share/nginx/www/index.html **). – Confucius
Seleziona la risposta che ha funzionato meglio per te. Grazie. –