{"id":550,"date":"2013-02-03T22:45:09","date_gmt":"2013-02-03T21:45:09","guid":{"rendered":"http:\/\/quantum-bits.org\/?p=550"},"modified":"2022-08-12T17:35:00","modified_gmt":"2022-08-12T16:35:00","slug":"raspberry-pi-ready-to-serve","status":"publish","type":"post","link":"https:\/\/www.quantum-bits.org\/?p=550","title":{"rendered":"Raspberry Pi, ready to serve !"},"content":{"rendered":"<table width=\"100%\">\n<tbody>\n<tr>\n<td>Alright. My Raspberry Pi by is set up and delivering AirPrint and AirPlay services.<br \/>\nLet&#8217;s add few web capabilities.<\/td>\n<td><img decoding=\"async\" src=\"http:\/\/quantum-bits.org\/wp-content\/uploads\/2013\/02\/raspberrypi-logo.png\" alt=\"\" align=\"top\"><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<br \/>\n<strong>A lightweight configuration: Nginx &amp; SQLite<\/strong><\/p>\n<p>I felt like the usual Apache \/ MySQL duet might be a little to heavy for my tiny ApplePie. So, I opted for a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Nginx\" target=\"_blank\" rel=\"noopener\">Nginx<\/a> \/ <a href=\"http:\/\/en.wikipedia.org\/wiki\/Sqlite\" target=\"_blank\" rel=\"noopener\">SQLite<\/a> couple.<\/p>\n<p>Everything is already packaged, thus, the installation is rather straighforward:<\/p>\n<pre line=\"1\" lang=\"bash\">apt-get install nginx \napt-get install php5-fpm php5-cgi php5-cli php5-common\napt-get install php-pear php5-gd php5-imagick php5-mcrypt php5-memcache php5-sqlite\napt-get install sqlite3\nuseradd www-data\ngroupadd www-data \nusermod -g www-data www-data \nmkdir \/var\/www \nchmod 775 \/var\/www -R \nchown www-data:www-data \/var\/www \n<\/pre>\n<p>Its time to modify php.ini :<\/p>\n<pre lang=\"bash\">cgi.fix_pathinfo = 0;\n<\/pre>\n<p>&#8230; and to configure Nginx default site (\/etc\/nginx\/sites-enables\/default):<\/p>\n<pre line=\"1\" lang=\"bash\">upstream php {\n        server unix:\/var\/run\/php5-fpm.sock;\n}\n\nserver {\n\n        root \/var\/www;\n        listen          80;\n        server_name     applepie;\n\n        access_log      \/var\/log\/nginx\/access.log;\n        error_log       \/var\/log\/nginx\/error.log;\n\n        index index.html index.php;\n\n        location = \/favicon.ico {\n                log_not_found off;\n                access_log off;\n        }\n\n        location \/ {\n                try_files $uri $uri\/ \/index.php;\n        }\n        location ~ \\.php$ {\n                include fastcgi_params;\n                fastcgi_intercept_errors on;\n                fastcgi_pass php;\n        }\n\n        location ~* \\.(js|css|png|jpg|jpeg|gif|ico)$ {\n                expires max;\n                log_not_found off;\n        }\n}\n<\/pre>\n<p>Let&#8217;s fire up the Nginx:<\/p>\n<pre lang=\"bash\">service nginx start\n<\/pre>\n<p>&#8230; and check that everything is working nicely:<\/p>\n<p><center><img decoding=\"async\" title=\"rock on!\" src=\"http:\/\/quantum-bits.org\/wp-content\/uploads\/2013\/02\/nginx.png\" alt=\"\"><\/center><\/p>\n<p>The Raspberry Pi is now ready to serve :p<\/p>\n<p>I guess, I have no reason left not to finish my cooking iOS app know &#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Alright. My Raspberry Pi by is set up and delivering AirPrint and AirPlay services. Let&#8217;s add few web capabilities. &nbsp; A lightweight configuration: Nginx &amp; SQLite I felt like the &#8230;<\/p>\n","protected":false},"author":1,"featured_media":3853,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0},"categories":[5,21],"tags":[],"_links":{"self":[{"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/posts\/550"}],"collection":[{"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=550"}],"version-history":[{"count":0,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/posts\/550\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=\/wp\/v2\/media\/3853"}],"wp:attachment":[{"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=550"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=550"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quantum-bits.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=550"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}