今天是 :

flarum 社区系统下载

链接: https://pan.baidu.com/s/1JFJPNu9tYDkc8slNfvJzeQ 提取码: aplv

https://github.com/flarum/flarum/releases/tag/v1.0.0

 

服务器环境参考:

https://docs.flarum.org/zh/install

安装:

Installation

QUICK TEST DRIVE?

Feel free to give Flarum a spin on one of our demonstration forums. Or set up your own forum in seconds at Free Flarum, a free community service not affiliated with the Flarum team.

Server Requirements#

Before you install Flarum, it's important to check that your server meets the requirements. To run Flarum, you will need:

SHARED HOSTING

It's not possible to install Flarum by downloading a ZIP file and uploading the files to your web server. This is because Flarum uses a dependency-management system called Composer which needs to run on the command line.

This doesn't necessarily mean you need a VPS. Most decent hosts support SSH access, through which you should be able to install Composer and Flarum just fine.

Installing#

Flarum uses Composer to manage its dependencies and extensions. If you're not familiar with it, read our guide for information on what it is and how to set it up. Afterwards, run this command in an empty location that you want Flarum to be installed in:

composer create-project flarum/flarum .

Copy

While this command is running, you can configure your web server. You will need to make sure your webroot is set to /path/to/your/forum/public, and set up URL Rewriting as per the instructions below.

When everything is ready, navigate to your forum in a web browser and follow the instructions to complete the installation.

URL Rewriting#

Apache#

Flarum includes a .htaccess file in the public directory – make sure it has been uploaded correctly. Flarum will not function properly if mod_rewrite is not enabled or .htaccess is not allowed. Be sure to check with your hosting provider (or your VPS) that these features are enabled. If you're managing your own server, you may need to add the following to your site configuration to enable .htaccess files:

<Directory "/path/to/flarum/public">    AllowOverride All</Directory>

Copy

This ensures that htaccess overrides are allowed so Flarum can rewrite URLs properly.

Methods for enabling mod_rewrite vary depending on your OS. You can enable it by running sudo a2enmod rewrite on Ubuntu. mod_rewrite is enabled by default on CentOS. Don't forget to restart Apache after making modifications!

Nginx#

Flarum includes a .nginx.conf file – make sure it has been uploaded correctly. Then, assuming you have a PHP site set up within Nginx, add the following to your server's configuration block:

include /path/to/flarum/.nginx.conf;

Copy

Caddy#

Caddy requires a very simple configuration in order for Flarum to work properly. Note that you should replace the URL with your own and the path with the path to your own public folder. If you are using a different version of PHP, you wil also need to change the fastcgi path to point to your correct PHP install socket or URL.

www.example.com {   
 root * /var/www/flarum/public 
 php_fastcgi unix//var/run/php/php7.4-fpm.sock
 header /assets { 
        +Cache-Control "public, must-revalidate, proxy-revalidate"        
        +Cache-Control "max-age=25000"        
        Pragma "public"    
 }   
  file_server
 }

Copy

Folder Ownership#

During installation, Flarum may request that you make certain directories writable. To allow write access to a directory on Linux, execute the following command:

chmod 775 /path/to/directory

Copy

If Flarum requests write access to both the directory and its contents, you need to add the -R flag so that the permissions are updated for all the files and folders within the directory:

chmod 775 -R /path/to/directory

Copy

If after completing these steps, Flarum continues to request that you change the permissions you may need to check that your files are owned by the correct group and user.

By default, in most Linux distributions www-data is the group and user that both PHP and the web server operate under. You can change the folder ownership in most Linux operating systems by running chown -R www-data:www-data foldername/.

To find out more about these commands as well as file permissions and ownership on Linux, read this tutorial. If you are setting up Flarum on Windows, you may find the answers to this Super User question useful.

ENVIRONMENTS MAY VARY

Your environment may vary from the documentation provided, please consult your web server configuration or web hosting provider for the proper user and group that PHP and the web server operate under.

NEVER USE PERMISSION 777

You should never set any folder or file to permission level 777, as this permission level allows anyone to access the content of the folder and file regardless of user or group.

Customizing Paths#

By default Flarum's directory structure includes a public directory which contains only publicly-accessible files. This is a security best-practice, ensuring that all sensitive source code files are completely inaccessible from the web root.

However, if you wish to host Flarum in a subdirectory (like yoursite.com/forum), or if your host doesn't give you control over your webroot (you're stuck with something like public_html or htdocs), you can set up Flarum without the public directory.

Simply move all the files inside the public directory (including .htaccess) into the directory you want to serve Flarum from. Then edit .htaccess and uncomment lines 9-15 in order to protect sensitive resources. For Nginx, uncomment lines 8-11 of .nginx.conf.

You will also need to edit the index.php file and change the following line:

$site = require './site.php';

Copy

Edit the site.php and update the paths in the following lines to reflect your new directory structure:

'base' => __DIR__,
'public' => __DIR__,
'storage' => __DIR__.'/storage',

Copy

Finally, check config.php and make sure the url value is correct.

Importing Data#

If you have an existing community and don't want to start from scratch, you may be able to import your existing data into Flarum. While there are no official importers yet, the community has made several unofficial importers:

These can be used for other forum software as well by migrating to phpBB first, then to Flarum. Be aware that we can't guarantee that these will work nor can we offer support for them.

Edit this page


参考配置:

 

 server {
        listen       80;
        server_name  dev.flarum.com;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;
         root   /data/www/flarum/public;
         index  index.html index.htm index.php;

      location =/assets {
       add_header  Cache-Control "public, must-revalidate, proxy-revalidate";
       add_header  Cache-Control "max-age=25000";
       add_header  Pragma "public";
    }

       location / {
        # Redirect everything that isn't a real file to index.php
        # try_files $uri $uri/ /index.php$is_args$args;
        if (!-e $request_filename){
           rewrite ^(.*)$ /index.php?s=$1 last;  break;
         }
       }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        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;
        }

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
}                           

 

公告:

  本站采用 gin作为后台服务
前端使用 sematicui 框架搭建(拼凑)。
有喜欢本站的同学。欢迎到聊天室留言

评论: