<\/span><\/h2>\nBefore we begin, you need to connect to your server via SSH as the root user. To do this, use the following command:<\/p>\n
ssh root@IP_Address -p Port_Number<\/pre>\nOf course, you will need to replace IP_Address<\/code> and Port_Number<\/code> with your server’s actual IP address and SSH port number.<\/p>\nOnce logged in, make sure that your server is up-to-date by running the following commands:<\/p>\n
apt update\r\napt upgrade<\/pre>\n<\/span>Step 2: Install the LAMP (Apache, MySQL and PHP 7.1) Stack<\/span><\/h2>\nWe need to begin by installing some of the requirements for the installation of Feng Office. To install Apache and MySQL server, run the following command:<\/p>\n
apt install apache2 libapache2-mod-php mysql-server mysql-client<\/pre>\nTo start and enable the Apache and MySQL services, execute the following command:<\/p>\n
for x in apache2 mysql; do systemctl start $x; systemctl enable $x; done<\/pre>\nThis next part is optional but recommended. We suggest you run the mysql_secure_installation in order to implement some recommended security changes. Run this next command and follow the prompts:<\/p>\n
mysql_secure_installation<\/pre>\nWhen the program asks for your MySQL root password, just press the [Enter] key, as there is no password set by default. We suggest answering each prompt with ‘Y’.<\/p>\n
Next, we will install PHP version 7.1 from Ond\u0159ej Sur\u00fd\u2019s repository, as it is not available in the pre-installed repositories.<\/p>\n
Please note that Feng Office does not support PHP 7.2 yet. Run the commands below to add Ond\u0159ej Sur\u00fd\u2019s PPA:<\/p>\n
apt-get install software-properties-common\r\nadd-apt-repository ppa:ondrej\/php\r\napt update<\/pre>\nTo install PHP 7.1 along with the modules needed to run Feng Office, execute this command:<\/p>\n
apt install php7.1 php7.1-mysql php7.1-curl php7.1-json php7.1-cgi libapache2-mod-php7.1 php7.1-mcrypt php7.1-xmlrpc php7.1-gd php7.1-mbstring php7.1 php7.1-common php7.1-xmlrpc php7.1-soap php7.1-xml php7.1-intl php7.1-cli php7.1-ldap unzip php7.1-zip wget php7.1-readline php7.1-imap php7.1-tidy php7.1-recode php7.1-sq php7.1-intl php7.1-mbstring -y<\/pre>\nTo check which version of PHP you are currently using, type:<\/p>\n
php -v<\/pre>\nIf you want to change the current PHP version to PHP 7.1, run the following commands:<\/p>\n
a2enmod php7.1\r\nupdate-alternatives --set php \/usr\/bin\/php7.1<\/pre>\nRestart the Apache web server so that the changes take effect.<\/p>\n
systemctl restart apache2.service<\/pre>\n<\/span>Step 3: Configure PHP and Install Other Required Packages<\/span><\/h2>\nLocate the php.ini configuration file:<\/p>\n
php -i | grep php.ini<\/pre>\nOutput:<\/p>\n
Configuration File (php.ini) Path => \/etc\/php\/7.1\/cli\r\nLoaded Configuration File => \/etc\/php\/7.1\/cli\/php.ini<\/pre>\nOpen the php.ini configuration file with your preferred text editor. We will use nano as our text editor – feel free to use any editor of your choice.<\/p>\n
nano \/etc\/php\/7.1\/cli\/php.ini<\/pre>\nFind and modify the following values:<\/p>\n
max_execution_time = 300\r\nmax_input_time = 300\r\nmemory_limit = 512M\r\npost_max_size = 128M\r\nupload_max_filesize = 128M\r\ndisplay_errors = Off\r\nhtml_errors = Off\r\ndisplay_startup_errors = Off\r\nlog_errors = On\r\noutput_buffering = Off<\/pre>\nAfter you are finished with editing the file, save the file and close it.<\/p>\n
Run the following command to install packages that are required by Feng Office:<\/p>\n
apt install catdoc xpdf ghostscript imagemagick wkhtmltopdf<\/pre>\nOnce the installation is complete, check that all installed services work properly. If they are installed successfully, you can continue to the next step and create a new database for Feng Office.<\/p>\n
<\/span>Step 4: Create a Database<\/span><\/h2>\nTo create a database, you’ll need to log in to the MySQL console:<\/p>\n
mysql -u root -p<\/pre>\nBy using the following query, we will create our database:<\/p>\n
CREATE DATABASE fengdb;<\/pre>\nWe will add a separate user that will be able to interact with our ‘fengdb’ database:<\/p>\n
GRANT ALL PRIVILEGES ON fengdb.* TO 'fenguser'@'localhost' IDENTIFIED BY 'Str0ng_Pa5Sw0rD' WITH GRANT OPTION;<\/pre>\nPlease do not forget to change ‘Str0ng_Pa5Sw0rD<\/code>‘ to an actual strong password.<\/p>\nTo apply the privileges that we set, we will run this command:<\/p>\n
FLUSH PRIVILEGES;<\/pre>\nAfter we finish, we can exit from the MySQL session with the command:<\/p>\n
quit<\/pre>\n