{"id":4847,"date":"2019-09-26T04:00:45","date_gmt":"2019-09-26T04:00:45","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=4847"},"modified":"2019-09-26T04:14:23","modified_gmt":"2019-09-26T04:14:23","slug":"install-flarum-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/09\/26\/install-flarum-on-ubuntu-16-04\/","title":{"rendered":"Install Flarum on Ubuntu 16.04"},"content":{"rendered":"<p>Ref: https:\/\/flarum.org\/<br \/>\nhttps:\/\/flarum.org\/docs\/install.html<\/p>\n<p>Install via composer:<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy:~\/Documents\/works\/flarum$ composer create-project flarum\/flarum . --stability=beta<\/pre>\n<p>SETUP NGINX<\/p>\n<p>NGINX SETUP:<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/nginx\/sites-available\/flarum.test<\/pre>\n<p>CONTENT:<\/p>\n<pre class=\"lang:default decode:true \">server {\r\n    listen 80; \r\n    listen [::]:80;\r\n    root \/home\/teddy\/Documents\/works\/flarum\/public; #your document root\r\n    server_name flarum.test ;  # Your server name\r\n    index index.php index.html index.htm ;\r\n\r\n    # Webfonts,fonts\r\n    location ~* \\.(?:ttf|ttc|otf|eot|woff|woff2)$ {\r\n        add_header \"Access-Control-Allow-Origin\" \"*\";\r\n        expires 1y;\r\n        access_log off;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n\r\n    # Media: images, icons, video, audio, HTC\r\n    location ~* \\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {\r\n        expires 1y;\r\n        access_log off;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n\r\n    # Js, Css\r\n    location ~* \\.(?:css|js)$ {\r\n        expires 1y;\r\n        access_log off;\r\n        add_header Cache-Control \"public\";\r\n    }\r\n\r\n    # Serve static files without touching php\r\n    location \/ {\r\n        try_files $uri $uri\/ \/index.php?$args;\r\n    } \r\n    # pass requests for dynamic content to site\r\n    location ~ [^\/]\\.php(\/|$) {\r\n        try_files $uri \/index.php; \r\n        fastcgi_pass unix:\/run\/php\/php7.3-fpm.sock;\r\n        \r\n        fastcgi_buffers 1024 4k;\r\n\r\n        fastcgi_read_timeout 600s;\r\n        fastcgi_connect_timeout 600s;\r\n\r\n        fastcgi_index index.php;\r\n        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n        #include fastcgi_params;\r\n        #FOR DEVELOPMENT MODE ONLY - BEGIN\r\n        fastcgi_param MAGE_IS_DEVELOPER_MODE true;\r\n        fastcgi_param PHP_VALUE  display_startup_errors=on;\r\n        fastcgi_param PHP_VALUE  display_errors=on;\r\n        fastcgi_param PHP_VALUE  html_errors=on;\r\n        fastcgi_param PHP_VALUE  log_errors=on;\r\n        fastcgi_param PHP_VALUE  error_log=\/home\/teddy\/Documents\/works\/flarum\/var\/log\/system.log;\r\n        #FOR DEVELOPMENT MODE ONLY - END\r\n        include fastcgi_params;\r\n    }\r\n\r\n    gzip on;\r\n    gzip_disable \"msie6\";\r\n\r\n    gzip_comp_level 6;\r\n    gzip_min_length 1100;\r\n    gzip_buffers 16 8k;\r\n    gzip_proxied any;\r\n    gzip_types\r\n    text\/plain\r\n    text\/css\r\n    text\/js\r\n    text\/xml\r\n    text\/javascript\r\n    application\/javascript\r\n    application\/x-javascript\r\n    application\/json\r\n    application\/xml\r\n    application\/xml+rss\r\n    image\/svg+xml;\r\n    gzip_vary on;\r\n\r\n    # Banned locations (only reached if the earlier PHP entry point regexes don't match)\r\n    location ~* (\\.php$|\\.htaccess$|\\.git) {\r\n        deny all;\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>Enable file config<\/p>\n<pre class=\"lang:default decode:true\">sudo ln -s \/etc\/nginx\/sites-available\/flarum.test \/etc\/nginx\/sites-enabled\/flarum.test<\/pre>\n<p>&nbsp;<\/p>\n<p>Register the host on my system<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/hosts<\/pre>\n<p>Like this:<\/p>\n<pre class=\"lang:default decode:true\">...\r\n127.0.0.1 flarum.test\r\n...<\/pre>\n<p>&nbsp;<\/p>\n<p>CHECK THE NGINX SETTING AND RESTART IT:<\/p>\n<pre class=\"lang:default decode:true\">sudo nginx -t\r\n\r\nsudo service nginx restart<\/pre>\n<p>Change the file permissions<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy:~\/Documents\/works\/flarum$ sudo chmod -R 775 .\r\n\r\nteddy@teddy:~\/Documents\/works\/flarum$ sudo chown -R www-data:www-data .\r\n<\/pre>\n<p>CREATE A NEW DATABASE: flarum COLLATION utf8mb4_unicode_ci<br \/>\nOpen it on your browser then install : http:\/\/flarum.test<br \/>\nSetting admin:<br \/>\nusername: admin<br \/>\npassword: Admin@123<\/p>\n<p>User<br \/>\nusername: teddy<br \/>\npassword: teddy123<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ref: https:\/\/flarum.org\/ https:\/\/flarum.org\/docs\/install.html Install via composer: teddy@teddy:~\/Documents\/works\/flarum$ composer create-project flarum\/flarum . &#8211;stability=beta SETUP NGINX NGINX SETUP: sudo gedit \/etc\/nginx\/sites-available\/flarum.test CONTENT: server { listen 80; listen [::]:80; root \/home\/teddy\/Documents\/works\/flarum\/public; #your document root server_name flarum.test ; # Your server name index index.php index.html index.htm ; # Webfonts,fonts location ~* \\.(?:ttf|ttc|otf|eot|woff|woff2)$ { add_header &#8220;Access-Control-Allow-Origin&#8221; &#8220;*&#8221;; expires 1y; access_log &hellip; <a href=\"https:\/\/myprojects.advchaweb.com\/index.php\/2019\/09\/26\/install-flarum-on-ubuntu-16-04\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Install Flarum on Ubuntu 16.04&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,13],"tags":[],"class_list":["post-4847","post","type-post","status-publish","format-standard","hentry","category-php-2","category-tutorial"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=4847"}],"version-history":[{"count":7,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4847\/revisions"}],"predecessor-version":[{"id":4854,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/4847\/revisions\/4854"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=4847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=4847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=4847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}