<\/span><\/h2>\nLog in to your VPS via SSH as root or as a sudo user:<\/p>\n
ssh userame@IP_Address<\/pre>\nRemember to replace “IP_Address” with your server’s public IP address. If your server does not use the default SSH port number, add -p Port_Number<\/code>\u00a0to the end of the command and replace “Port_Number” with your server’s SSH port number.<\/p>\nOnce logged in, issue the following commands to update all installed packages to their latest available versions:<\/p>\n
sudo apt-get update\r\nsudo apt-get upgrade<\/pre>\nAfterwards, install the required packages using the following command:<\/p>\n
sudo apt-get install catdoc xpdf ghostscript imagemagick wkhtmltopdf unzip wget<\/pre>\n<\/span>Step 2: Install LAMP<\/span><\/h2>\nA LAMP (Linux, Apache, MySQL, PHP) stack is a combination of open source software, typically installed on a server used for hosting dynamic websites and web applications.<\/p>\n
First, we will install Apache, the most widely-used web server in the world. It is fast, secure, reliable, and can be easily customized depending on your needs.<\/p>\n
To install Apache on your Debian 9 server, type the following command:<\/p>\n
sudo apt-get install apache2<\/pre>\nOnce the installation is complete, enable the Apache service to start automatically upon system boot:<\/p>\n
sudo systemctl enable apache2<\/pre>\nNext, we will install PHP and the modules needed to run Feng Office:<\/p>\n
apt install php libapache2-mod-php php-mysql php-curl php-json php-cgi libapache2-mod-php php-mcrypt php-xmlrpc php-gd php-mbstring php php-common php-xmlrpc php-soap php-xml php-intl php-cli php-ldap php-zip php-readline php-imap php-tidy php-recode php-opcache php-intl php-mbstring<\/pre>\nRestart the Apache web server so that the PHP module is loaded:<\/p>\n
systemctl restart apache2.service<\/pre>\nThe last step is to install MariaDB:<\/p>\n
sudo apt-get install mariadb-server<\/pre>\nEnable the Apache service to start automatically upon system boot:<\/p>\n
sudo systemctl enable mariadb<\/pre>\nOnce the installation is complete, it is recommended to run the following command to improve the security of your MariaDB server:<\/p>\n
sudo mysql_secure_installation<\/pre>\nWhen\/if 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
<\/span>Step 3: Configure Apache and PHP<\/span><\/h2>\nOpen the php.ini configuration file with your preferred text editor:<\/p>\n
sudo nano \/etc\/php\/7.0\/apache2\/php.ini<\/pre>\nThen make the following changes. First, find 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>\nNext, create a new virtual host configuration file so that we can access our Feng Office application with a domain name instead of an IP address.<\/p>\n
sudo nano \/etc\/apache2\/sites-available\/domain-name.com.conf<\/pre>\nThen add the following content to the file:<\/p>\n
ServerAdmin admin@>domain-name.com<\/span>\r\nDocumentRoot \/var\/www\/html\/fengoffice\/\r\nServerName domain-name.com<\/span>\r\nServerAlias www.domain-name.com<\/span>\r\n\r\n\r\n Options FollowSymlinks\r\n AllowOverride All\r\n Require all granted\r\n\r\n\r\nErrorLog ${APACHE_LOG_DIR}\/error.log\r\nCustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n\r\n\r\n<\/pre>\nof course, you will need to replace all instances of\u00a0domain-name.com<\/code> with your actual registered domain name.<\/p>\nOnce you have configured the virtual host, you can enable it by executing the following commands.<\/p>\n
sudo a2ensite domain-name.com<\/span><\/pre>\nAlso, make sure that the mod rewrite is enabled:<\/p>\n
sudo a2enmod rewrite<\/pre>\nRestart Apache for the changes to take effect:<\/p>\n
sudo systemctl restart apache2.service<\/pre>\n