私はこのウェブサイトhttp://raspberrypihelp.net/tutorials/24-raspberry-pi-webserverを使って自分のラズベリーパイにHTTPサーバーnginxを設定し、サイトコールを設定しようとしましたexample.com。ここで/etc/nginx/sites-enabled/example.com:3nginx:[emerg] unknown directive "/etc/nginx/sites-enabled/example.com:3
に "" 未知のディレクティブを[EMERG]:nginxの:私はsudo service nginx restart
を実行したときしかし、それは
はnginxのを再起動すると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; } }
私はこの手順に従っていますが、正常に実行できません。
nginxのどのバージョンがインストールされましたか?このウェブサイトによると、apt-getで取得するバージョンにはいくつかの問題があります。 http://virtualitblog.blogspot.nl/2013/05/install-nginx-141-raspberry-pi.html nginx.org aptリポジトリを追加してnginxを再インストールすることをおすすめしますか? ldd/usr/sbin/nginxを実行して、結果をgist.github.comのどこかに投稿することはできますか? –
私は '/ usr/sbin/nginx -t -v'を使ってnginx/1.2.1を使っていることを確認しました。私は[http://nginx.org/en/linux_packages.html](http: ://nginx.org/ja/linux_packages.html)をapt sources.listに追加するには、 'sudo apt-get install nginx'を実行してください。** nginxは最新バージョンです**。私が言うことを忘れてしまったことは、[http://127.0.0.1/] (http://127.0.0.1/)]に行くことができます。デフォルトサイト(**/usr/share/nginx/www/index.html **)。 – Confucius
あなたに最適な答えを選択してください。ありがとうございました。 –