{"id":1360,"date":"2024-05-07T21:33:29","date_gmt":"2024-05-07T13:33:29","guid":{"rendered":"http:\/\/oneai.eu.org\/?p=1360"},"modified":"2024-05-08T11:10:44","modified_gmt":"2024-05-08T03:10:44","slug":"%e7%94%a8flarum%e6%90%ad%e5%bb%ba%e8%ae%ba%e5%9d%9b","status":"publish","type":"post","link":"https:\/\/oneai.eu.org\/?p=1360","title":{"rendered":"\u7528flarum\u642d\u5efa\u8bba\u575b"},"content":{"rendered":"<pre><code class=\"language-shell\">1\u3001\u9996\u5148\u914d\u7f6e\u597dnginx  \/etc\/nginx\/conf.d\/flarum.conf  \nserver {    \n    listen 8082;\n    server_name oneai.eu.org;\n    root  \/var\/www\/html\/flarum\/public;\n    index index.php index.html;\n\n    location ~ \\.php$ {\n        fastcgi_pass   127.0.0.1:9000;\n        fastcgi_index  index.php;\n        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;\n        include        fastcgi_params;\n    }\nlocation \/ {\n  try_files $uri $uri\/ \/index.php?$query_string;\n}\n\n# The following directives are based on best practices from H5BP Nginx Server Configs\n# https:\/\/github.com\/h5bp\/server-configs-nginx\n\n# Expire rules for static content\nlocation ~* \\.(?:manifest|appcache|html?|xml|json)$ {\n  add_header Cache-Control &quot;max-age=0&quot;;\n}\n\nlocation ~* \\.(?:rss|atom)$ {\n  add_header Cache-Control &quot;max-age=3600&quot;;\n}\n\nlocation ~* \\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ {\n  add_header Cache-Control &quot;max-age=2592000&quot;;\n  access_log off;\n}\n\nlocation ~* \\.(?:css|js)$ {\n  add_header Cache-Control &quot;max-age=31536000&quot;;\n  access_log off;\n}\n\nlocation ~* \\.(?:ttf|ttc|otf|eot|woff|woff2)$ {\n  add_header Cache-Control &quot;max-age=2592000&quot;;\n  access_log off;\n}\n\n# Gzip compression\ngzip on;\ngzip_comp_level 5;\ngzip_min_length 256;\ngzip_proxied any;\ngzip_vary on;\ngzip_types\n    application\/atom+xml\n    application\/javascript\n    application\/json\n    application\/ld+json\n    application\/manifest+json\n    application\/rss+xml\n    application\/vnd.geo+json\n    application\/vnd.ms-fontobject\n    application\/x-font-ttf\n    application\/x-web-app-manifest+json\n    application\/xhtml+xml\n    application\/xml\n    font\/opentype\n    image\/bmp\n    image\/svg+xml\n    image\/x-icon\n    text\/cache-manifest\n    text\/css\n    text\/plain\n    text\/vcard\n    text\/vnd.rim.location.xloc\n    text\/vtt\n    text\/x-component\n    text\/x-cross-domain-policy;    \n}\n\u914d\u7f6e\u6587\u4ef6\u66f4\u6539\u9700\u8981\u91cd\u542fnginx  :systemctl restart nginx\n---2\u3001\u521b\u5efa\u6570\u636e\u5e93\uff1a\nmysql -uroot -p\ncreate database flarum;\n\nGRANT ALL PRIVILEGES ON flarum.* TO &#039;flarum&#039;@&#039;localhost&#039; IDENTIFIED BY  &#039;FlarumForT2023&#039;;\nGRANT ALL PRIVILEGES ON flarum.* TO &#039;flarum&#039;@&#039;127.0.0.1&#039; IDENTIFIED BY  &#039;FlarumForT2023&#039;;\nGRANT ALL PRIVILEGES ON flarum.* TO &#039;flarum&#039;@&#039;%&#039; IDENTIFIED BY  &#039;FlarumForT2023&#039;;\nGRANT ALL PRIVILEGES ON flarum.* TO &#039;root&#039;@&#039;localhost&#039; identified by &#039;Familyun@mysql1&#039; WITH GRANT OPTION;\n\nFLUSH PRIVILEGES;\n3\u3001\n--------\u4ece\u5b98\u7f51\u4e0b\u8f7d\u5b89\u88c5\u5305\uff0c\u653e\u5230\u4e0b\u9762\u7684\u8def\u5f84\u4e0b\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7528\u547d\u4ee4\u4e0b\u8f7d\uff1a composer create-project flarum\/flarum .  \n\/var\/www\/html\/flarum \n\u7136\u540e\u8bbf\u95ee\uff1a8082\u7aef\u53e3\u8fdb\u884c\u5b89\u88c5 \n4\u3001\u5b89\u88c5\u76f8\u5173\u63d2\u4ef6\n\u6700\u597d\u662f\u6dfb\u52a0\u4e00\u4e2a\u7528\u6237,\u7136\u540e\u7528\u521b\u5efa\u7684\u7528\u6237\u8fdb\u884c\u76f8\u5173\u63d2\u4ef6\u5b89\u88c5\nadduser -m composer\nsu- composer\n\u6dfb\u52a0\u56fd\u5185\u6e90\uff1a\n\u963f\u91cc\u4e91\n\n\u4f7f\u7528\u8bf4\u660e\uff1ahttps:\/\/mirrors.aliyun.com\/composer\/\n\ncomposer config -g repo.packagist composer https:\/\/mirrors.aliyun.com\/composer\/\n\u534e\u4e3a\u4e91\n\ncomposer config -g repo.packagist composer https:\/\/mirrors.huaweicloud.com\/repository\/php\/\n\u817e\u8baf\u4e91\n\ncomposer config -g repos.packagist composer https:\/\/mirrors.cloud.tencent.com\/composer\/\ncnpkg\n\ncomposer config -g repos.packagist composer https:\/\/php.cnpkg.org](https:\/\/php.cnpkg.org\nphpcomposer\n\nComposer\u5b98\u65b9\u955c\u50cf\uff0c\u901f\u5ea6\u8f83\u6162\uff0c\u56fd\u5916\u670d\u52a1\u5668\u7528\u8fd9\u4e2a\uff01\uff01\uff01\n\ncomposer config -g repo.packagist composer https:\/\/packagist.phpcomposer.com\n\n-------\n5\u3001\u5b89\u88c5\u63d2\u4ef6\uff1a\u627e\u5230\u63d2\u4ef6\u6839\u636e\u63d0\u793a\u5b89\u88c5\n\u8fd9\u91cc\u6709\u4e00\u4e9b\u5e38\u7528\u7684\u63d2\u4ef6\u5206\u7c7b\uff1ahttps:\/\/github.com\/realodix\/awesome-flarum#theme-enhancements-top\n\u6839\u636e\u81ea\u5df1\u7684\u8bba\u575b\u7279\u70b9\u9009\u53d6\u5b89\u88c5 \n\u8fd9\u91cc\u6709\u4e00\u4e9b\u63d2\u4ef6\uff1a\nhttps:\/\/extiverse.com\/?filter%5Bq%5D=&sort=-downloads&filter%5Bis%5D%5B%5D=-flarum&filter%5Btype%5D=\n\u8fd9\u91cc\u6709\u4e00\u4e9b\u63d2\u4ef6 https:\/\/discuss.flarum.org\/\ncomposer require flarum-lang\/chinese-traditional  \/\/\u4e2d\u6587\u8bed\u8a00\u5305\nphp flarum cache:clear\n\n\u5982\u679ccomposer \u63d0\u793a\u8981\u5347\u7ea7\u8bf7\u53c2\u7167\uff1ahttps:\/\/qiita.com\/mugimugi\/items\/149446c39005c039a391\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u9996\u5148\u914d\u7f6e\u597dnginx \/etc\/nginx\/conf.d\/flarum.conf server { listen 8082; server_name oneai.eu.org; root \/var\/www\/html\/flarum\/public; index index.php index.html; location ~ \\.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } location \/ { try_files $uri $uri\/ \/index.php?$query_string; } # The following directives are based on best practices from H5BP Nginx Server Configs # https:\/\/github.com\/h5bp\/server-configs-nginx # Expire rules for static content location ~* \\.(?:manifest|appcache|html?|xml|json)$ { add_header Cache-Control &quot;max-age=0&quot;; } location ~* \\.(?:rss|atom)$ { add_header Cache-Control &quot;max-age=3600&quot;; } location ~* \\.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|mp4|ogg|ogv|webm|htc)$ { add_header Cache-Control &quot;max-age=2592000&quot;; access_log off; } location ~* \\.(?:css|js)$ { add_header Cache-Control &quot;max-age=31536000&quot;; access_log off; } location ~* \\.(?:ttf|ttc|otf|eot|woff|woff2)$ { add_header Cache-Control &quot;max-age=2592000&quot;; access_log off; } # Gzip compression gzip on; gzip_comp_level 5; gzip_min_length 256; gzip_proxied any; gzip_vary on; gzip_types application\/atom+xml application\/javascript application\/json application\/ld+json application\/manifest+json application\/rss+xml application\/vnd.geo+json application\/vnd.ms-fontobject application\/x-font-ttf application\/x-web-app-manifest+json application\/xhtml+xml application\/xml font\/opentype image\/bmp image\/svg+xml image\/x-icon text\/cache-manifest text\/css text\/plain text\/vcard text\/vnd.rim.location.xloc text\/vtt text\/x-component text\/x-cross-domain-policy; } \u914d\u7f6e\u6587\u4ef6\u66f4\u6539\u9700\u8981\u91cd\u542fnginx :systemctl restart nginx &#8212;2\u3001\u521b\u5efa\u6570\u636e\u5e93\uff1a mysql -uroot -p create database flarum; GRANT ALL PRIVILEGES ON flarum.* TO &#039;flarum&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;FlarumForT2023&#039;; GRANT ALL PRIVILEGES ON flarum.* TO &#039;flarum&#039;@&#039;127.0.0.1&#039; IDENTIFIED BY &#039;FlarumForT2023&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","footnotes":""},"categories":[99,82],"tags":[],"class_list":["post-1360","post","type-post","status-publish","format-standard","hentry","category-centos","category-82"],"_links":{"self":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1360"}],"version-history":[{"count":2,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1360\/revisions"}],"predecessor-version":[{"id":1447,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=\/wp\/v2\/posts\/1360\/revisions\/1447"}],"wp:attachment":[{"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oneai.eu.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}