Webmasters upgrade tips: Use the flarum framework to build a powerful light Forum. First, you can view the finished image:
Mobile Edition:
Computer version:
My Environment: ubuntu 14.06x64 VPS
Installation preparation
Install apache2, php5, mysql-server, php5-mysql in sequence.
sudo apt-get install apache2sudo apt-get install php5sudo apt-get install mysql-serversudo apt-get install php5-mysql
Install composer. (you can download the executable file and copy the executable permission to/usr/local/bin on the official website)
php -r "readfile('https://getcomposer.org/installer');" > composer-setup.phpphp -r "if (hash('SHA384', file_get_contents('composer-setup.php')) === '7228c001f88bee97506740ef0888240bd8a760b046ee16db8f4095c0d8d525f2367663f22a46b48d072c816e7fe19959') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"php composer-setup.php --install-dir=bin --filename=composerphp -r "unlink('composer-setup.php');"
Create a flarum project
Make sure to execute create-object in the empty directory.
mkdir V2NB_forumcd V2NB_forum/composer create-project flarum/flarum . --stability=beta
An error may occur during installation:
Installing flarum/flarum (v0.1.0-beta.5) - Installing flarum/flarum (v0.1.0-beta.5) Downloading: 100% Created project in .Loading composer repositories with package informationUpdating dependencies (including require-dev)Your requirements could not be resolved to an installable set of packages. Problem 1 - flarum/flarum-ext-akismet v0.1.0-beta.3 requires tijsverkoyen/akismet ^1.1 -> satisfiable by tijsverkoyen/akismet[1.1.0]. - flarum/flarum-ext-akismet v0.1.0-beta.5 requires tijsverkoyen/akismet ^1.1 -> satisfiable by tijsverkoyen/akismet[1.1.0]. - tijsverkoyen/akismet 1.1.0 requires ext-curl * -> the requested PHP extension curl is missing from your system. - Installation request for flarum/flarum-ext-akismet ^0.1.0 -> satisfiable by flarum/flarum-ext-akismet[v0.1.0-beta.3, v0.1.0-beta.5]. To enable extensions, verify that they are enabled in those .ini files: - /etc/php5/cli/php.ini - /etc/php5/cli/conf.d/05-opcache.ini - /etc/php5/cli/conf.d/10-pdo.ini - /etc/php5/cli/conf.d/20-json.ini - /etc/php5/cli/conf.d/20-mysql.ini - /etc/php5/cli/conf.d/20-mysqli.ini - /etc/php5/cli/conf.d/20-pdo_mysql.ini - /etc/php5/cli/conf.d/20-readline.ini You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
After installing php-curl, delete all files in the Directory (including hidden files starting with.) and execute composer create-project flarum/flarum. -- stability = beta.
sudo apt-get install php5-curl
The normal installation log should be long and long.
The files in the project directory are as follows:
Modify and set permissions
Change the permissions of all files and folders in the project directory to 777. for example, my permissions are:
sudo chmod -R 777 /home/kiya/v2nb
Enable rewrite
cd /etc/apache2/mods-enabledsudo ln -s ../mods-available/rewrite.load
Redirection
Modify the DocumentRoot entry in the/etc/apache2/sites-available/000-default.conf file to your project folder path, for example, DocumentRoot/home/kiya/v2nb.
Add the following code between VirtualHost nodes in the file:
AllowOverride All
In the/etc/apache2/apache2.conf file, find:
Options FollowSymLinks AllowOverride None Require all denied
Change Require all denied to Require all granted, and change AllowOverride None to AllowOverride All.
Modify host
sudo vim /etc/hosts
Open the hosts and add a new line 23.105.197.243 v2nb. today. the ip here is the ip address of vps, and the domain name can be written at will. the ip address of the local machine can be written as 127.0.0.1.
If it is not added here when the apache service is started, a warning is reported:
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using v2nb.today. Set the 'ServerName' directive globally to suppress this message
Database
Create a database for the forum using the command line. the account and password entered during user and pass installation of mysql will be used soon.
mysql -u user -ppasscreate database v2nb;
Install flarum
Restart the apache service.
sudo service apache2 restart
Access 23.105.197.243 in a browser. if it is a local test, access localhost.
If:
You need to install the gd module, execute sudo apt-get install php5-gd to restart apache.
If it is correct, the page is displayed to fill in the information:
The MySQL Database is the name of the Database we created above. fill in the name and click Install Flarum.
Install it when it appears ~
Administrator interface:
Access oops
If Oops is frequently displayed when you use a domain name to open a forum! Something went wrong. Please reload the page and try again and the resource cannot be loaded. it may indicate that the requested url is different from the configured url.
You need to modify the config. php file in the project directory.
sudo vim config.php
For example, change 'URL' => '23. 105.197.243 'to 'URL' => 'v2nb. today '.