树莓派lnmp搭建

来源:互联网 发布:云计算课程有什么 编辑:程序博客网 时间:2024/06/05 10:33

参考1

sudo apt-get updatesudo apt-get install nginx php5-fpm php5-cli php5-curl php5-gd php5-mcrypt php5-mysql php5-cgi mysql-server

修改配置文件,/etc/nginx/nginx.conf

worker_processes 1; worker_connections 256; gzip on;gzip_disable "msie6"; gzip_vary on;gzip_proxied any;gzip_comp_level 6;gzip_buffers 16 8k;gzip_http_version 1.1;gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

参考2

sudo nano /etc/nginx/sites-available/default

server {    listen 80;    server_name raspiweb.dyndns.org;    root /var/www/;      access_log  /var/log/nginx/localhost.access.log;    #error_page 404 /404.html;      if (!-e $request_filename)    {        rewrite ^(.*)$ /index.php$1 last;    }      location / {        index  index.html index.htm index.php default.html default.htm default.php;    }      location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {        access_log  off;        expires 1d;    }      location ~ .*\.php(\/.*)*$ {        fastcgi_split_path_info ^(.+\.php)(/.+)$;        fastcgi_pass unix:/var/run/php5-fpm.sock;        fastcgi_index index.php;        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;        include fastcgi_params;    }}


原创粉丝点击