<\/span><\/h2>\nWe can install Apache2 and MariaDB from the CentOS package repository.<\/p>\n
Run the following commands to install Apache2 and MariaDB on the server:<\/p>\n
yum install httpd mod_ssl mariadb-server<\/pre>\nEnable Apache2 and MariaDB services to start automatically on server boot:<\/p>\n
systemctl enable httpd.service\r\nsystemctl enable mariadb.service<\/pre>\n<\/span>Step 3: Install PHP 7, PHP Extensions and Other Packages Required by Feng Office<\/span><\/h2>\nBefore starting with the PHP installation, we need to check if there are older versions of PHP already installed on the server:<\/p>\n
rpm -qa | grep -i php<\/pre>\nRemove the old PHP packages, e.g.:<\/p>\n
yum remove php-cli php-common php-mysql php-pdo php<\/pre>\nUse the following commands to install PHP 7.1 from the REMI repository:<\/p>\n
yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm\r\nyum-config-manager --enable remi-php71<\/pre>\nContinue by installing all the PHP extensions and libraries required by Feng Office:<\/p>\n
yum install yum install php php-common php-cli php-json php-mysqlnd php-curl php-opcache php-xml php-xmlrpc php-gd php-mbstring php-pdo<\/pre>\nTo verify that we are using PHP 7.1, type the following command:<\/p>\n
php -v<\/pre>\nWe should see the following text as the output:<\/p>\n
PHP 7.1.29 (cli) (built: May 1 2019 12:06:38) ( NTS )\r\nCopyright (c) 1997-2018 The PHP Group\r\nZend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies\r\n with Zend OPcache v7.1.29, Copyright (c) 1999-2018, by Zend Technologies<\/pre>\nLocate the php.ini configuration file:<\/p>\n
php -i | grep php.ini\r\nConfiguration File (php.ini) Path => \/etc\r\nLoaded Configuration File => \/etc\/php.ini<\/pre>\nEdit the \/etc\/php.ini<\/code> configuration file and add\/modify the following settings:<\/p>\nmax_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>\nRestart the Apache web server for the changes to take effect:<\/p>\n
systemctl restart httpd.service<\/pre>\nInstall other packages required by the Feng Office installation:<\/p>\n
yum install catdoc xpdf ghostscript ImageMagick wkhtmltopdf<\/pre>\n<\/span>Step 4: Create the Apache Configuration File<\/span><\/h2>\nCreate a new Apache configuration file for the domain\/subdomain name that we will be using to access the Feng Office installation. For this tutorial, we will be using ‘fengoffice.domain.com<\/code>‘. Make sure to replace it with your registered domain name.<\/p>\nvi \/etc\/httpd\/conf.d\/feng.conf<\/pre>\nAdd the following lines:<\/p>\n
<VirtualHost *:80>\r\nServerAdmin admin@fengoffice.domain.com<\/span>\r\nDocumentRoot \/var\/www\/html\/fengoffice\/\r\nServerName fengoffice.domain.com<\/span>\r\nServerAlias www.fengoffice.domain.com<\/span>\r\n<Directory \/var\/www\/html\/fengoffice\/>\r\nOptions FollowSymLinks\r\nAllowOverride All\r\n<\/Directory>\r\nErrorLog \/var\/log\/httpd\/fengoffice-error_log\r\nCustomLog \/var\/log\/httpd\/fengoffice-access_log common\r\n<\/VirtualHost><\/pre>\nRestart Apache once again for the changes to take effect:<\/p>\n
systemctl restart httpd.service<\/pre>\n