{"id":7422,"date":"2018-12-07T20:21:10","date_gmt":"2018-12-07T17:21:10","guid":{"rendered":"https:\/\/www.howtoforge.com\/tutorial\/install-wordpress-5-with-apache-on-debian-9\/"},"modified":"2018-12-07T20:21:10","modified_gmt":"2018-12-07T17:21:10","slug":"install-wordpress-5-with-apache-on-debian-9","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/install-wordpress-5-with-apache-on-debian-9\/","title":{"rendered":"\u0646\u0635\u0628 \u0648\u0631\u062f\u067e\u0631\u0633 5 \u062f\u0631 \u062f\u0628\u06cc\u0627\u0646 9"},"content":{"rendered":"<p style=\"text-align: left;\">This tutorial will show you how to install and configure the latest version of WordPress 5 on top of a LAMP stack in Debian 9 &#8211;\u00a0Stretch. WordPress, without a doubt, is one\u00a0of the most popular open-source Content Management System or CMS used in these days for internet publishing, which powers more than 60 million websites worldwide, whether small blogging sites or notable huge name brands. Based on PHP and MySQL engine, WordPress is often associated with LAMP collection, either installed on dedicated servers or virtual private servers or on shared web-hosting providers. LAMP acronym describes a collection of software, aka software bundle, which usually consists of <strong>Linux<\/strong> Open Source kernel, regardless of the chosen distribution, <strong>Apache<\/strong> HTTP server, which is one of the most popular open-source web server in internet due to its stability, flexibility and performance, <strong>PHP<\/strong> server-side interpreted programming language and <strong>MariaDB<\/strong> relational database management system (RDBMS), which one of the most popular database software, forked and simultaneously developed by the open-source community from original MySQL.<\/p>\n<h2 id=\"requirements\" style=\"text-align: left;\">Requirements<\/h2>\n<ul style=\"text-align: left;\">\n<li>A clean installation of Debian 9 operating system on a virtual private server or a virtual machine or directly on a dedicated bare-metal machine.<\/li>\n<li>SSH remote access in case of a VPS or a remote server or direct console access<\/li>\n<li>At least a static IP Address for a network interface configured on the server<\/li>\n<li>In case the webpage should be publicly available in internet you would need a registered public domain name with proper DNS records configured. During this tutorial, we\u2019ll be using the <strong>example.com\u00a0<\/strong>as the example domain and a static IP address from private space, in NAT, behind the main router. The domain will be accessible from the internet by port forwarding the Apache 80 and 443 ports from the router side to internal self-hosted virtual machine LAN.<\/li>\n<\/ul>\n<h2 id=\"install-lamp-software-bundle\" style=\"text-align: left;\">Install LAMP Software Bundle<\/h2>\n<p style=\"text-align: left;\">The first thing you want to do before starting to install all LAMP components is to log in to Debian 9 server and perform an up-to-date procedure for all system components, such as kernel upgrades, package updates or security patches, by issuing the following commands with root privileges.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">apt-get update<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">apt-get upgrade<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">apt-get dist-upgrade<\/code><\/pre>\n<p style=\"text-align: left;\">In the next step, you should set up the name of your machine by replacing the hostname variable with your own descriptive name by running the below command. Be aware that you might need to reboot the system in order to apply the new hostname accordingly.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">hostnamectl set-hostname hostname.yourdomain.com<\/code><\/pre>\n<p style=\"text-align: left;\">You should also install the following utilities which will come in handy later for various troubleshooting problems.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">apt install net-tools sudo wget curl bash-completion<\/code><\/pre>\n<p style=\"text-align: left;\">After the machine hostname has been applied, login again with root privileges and install Apache HTTP server, which is, by default, pre-compiled into a binary package and provided by Debian 9 repositories.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">apt install apache2<\/code><\/pre>\n<p style=\"text-align: left;\">Next, install the latest version of PHP language interpreter and all required modules needed for Apache web server in order to deploy WordPress CMS by issuing the following command.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">apt install libapache2-mod-php7.0 php7.0 php7.0-gd php7.0-xml php7.0-curl php7.0-mbstring php7.0-mcrypt php7.0-xmlrpc<\/code><\/pre>\n<p style=\"text-align: left;\">The last component missing now in order for LAMP stack to be complete is MariaDB database server. Execute the following command to install MariaDB server alongside with PHP module required to access the database from Apache HTTP server.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">apt install php7.0-mysql mariadb-server mariadb-client<\/code><\/pre>\n<p style=\"text-align: left;\">After MariaDB database has been installed, start the daemon and secure the database my running <strong>mysql_secure_installation <\/strong>script as illustrated in the below excerpt. Mainly answer with <strong>yes <\/strong>on all question the script prompts you. Also, make sure you choose a strong password for root account. Be aware that MySQL root account is not identical will Linux root account. The first is used only to manage the MariaDB database and the second is the superuser account in every Linux system. These accounts never overlap in a system.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">systemctl start mariadb<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\"><strong>mysql_secure_installation<\/strong><\/code><\/pre>\n<pre class=\"system\"><em>NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB\n<\/em><em>\u00a0\u00a0\u00a0\u00a0\u00a0 SERVERS IN PRODUCTION USE!\u00a0 PLEASE READ EACH STEP CAREFULLY!\n<\/em><em>\u00a0\n<\/em><em>In order to log into MariaDB to secure it, we'll need the current\n<\/em><em>password for the root user.\u00a0 If you've just installed MariaDB, and\n<\/em><em>you haven't set the root password yet, the password will be blank,\n<\/em><em>so you should just press enter here.\n<\/em><em>\u00a0\n<\/em><em>Enter current password for root (enter for none):\n<\/em><em>OK, successfully used password, moving on...\n<\/em><em>\u00a0\n<\/em><em>Setting the root password ensures that nobody can log into the MariaDB\n<\/em><em>root user without the proper authorisation.\n<\/em><em><strong>Set root password? [Y\/n] <span class=\"highlight\">y<\/span><\/strong>\n<\/em><em>New password:\n<\/em><em>Re-enter new password:\n<\/em><em>Password updated successfully!\n<\/em><em>Reloading privilege tables..\n<\/em><em>\u00a0... Success!\n<\/em><em>By default, a MariaDB installation has an anonymous user, allowing anyone\n<\/em><em>to log into MariaDB without having to have a user account created for\n<\/em><em>them.\u00a0 This is intended only for testing, and to make the installation\n<\/em><em>go a bit smoother.\u00a0 You should remove them before moving into a\n<\/em><em>production environment.\n<\/em><em><strong>Remove anonymous users? [Y\/n]<\/strong> <span class=\"highlight\"><strong>y<\/strong><\/span>\n<\/em><em>\u00a0... Success!\n<\/em><em>Normally, root should only be allowed to connect from 'localhost'.\u00a0 This\n<\/em><em>ensures that someone cannot guess at the root password from the network.\n<\/em><em><strong>Disallow root login remotely? [Y\/n] <span class=\"highlight\">y<\/span><\/strong>\n<\/em><em>\u00a0... Success!\n<\/em><em>By default, MariaDB comes with a database named 'test' that anyone can\n<\/em><em>access.\u00a0 This is also intended only for testing, and should be removed\n<\/em><em>before moving into a production environment.\n<\/em><em><strong>Remove test database and access to it? [Y\/n] <span class=\"highlight\">y<\/span><\/strong>\n<\/em><em>\u00a0- Dropping test database...\n<\/em><em>\u00a0... Success!\n<\/em><em>\u00a0- Removing privileges on test database...\n<\/em><em>\u00a0... Success!\n<\/em><em>Reloading the privilege tables will ensure that all changes made so far\n<\/em><em>will take effect immediately.\n<\/em><em><strong>Reload privilege tables now? [Y\/n] <span class=\"highlight\">y<\/span><\/strong>\n<\/em><em>\u00a0... Success!\n<\/em><em>Cleaning up...\n<\/em><em>All done!\u00a0 If you've completed all of the above steps, your MariaDB\n<\/em><em>installation should now be secure.\n<\/em><em>Thanks for using MariaDB!<\/em><\/pre>\n<p style=\"text-align: left;\">We\u2019re not done with securing MariaDB database yet. By default, you can log in to MariaDB from localhost with the database root account without being asked for a password. To prevent possible security issues, login to the database with root user and issue the following commands.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">mysql -u root -p<\/code><\/pre>\n<pre class=\"system\"><code spellcheck=\"false\">MariaDB&gt; <strong>use mysql;<\/strong><\/code><\/pre>\n<pre class=\"system\"><code spellcheck=\"false\">MariaDB&gt;<strong> update user set plugin='' where User='root';<\/strong><\/code><\/pre>\n<pre class=\"system\"><code spellcheck=\"false\">MariaDB&gt; <strong>flush privileges;<\/strong><\/code><\/pre>\n<pre class=\"system\"><code spellcheck=\"false\">MariaDB&gt; <strong>quit<\/strong><\/code><\/pre>\n<p style=\"text-align: left;\"><strong>\u00a0<\/strong><a id=\"img-Capture7\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Capture7.PNG\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9.png\" alt=\"Remove plugin from MySQL root user\" width=\"550\" height=\"417\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">Now, test the database by trying to log in with <em>root<\/em> account without the password. You should be denied access to MariaDB database.<\/p>\n<p style=\"text-align: left;\">In the next step, we\u2019ll enable and configure TLS and rewrite modules for Apache web server, which by default are disabled. Run the below commands to enable both modules.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">a2enmod rewrite ssl<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">a2ensite default-ssl.conf<\/code><\/pre>\n<p style=\"text-align: left;\">Then, open Apache configuration files for both enabled sites and add the following block below the <strong><em>DocumentRoot <\/em><\/strong>directive as illustrated in the following screenshot.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">nano \/etc\/apache2\/sites-enabled\/000-default.conf<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">nano \/etc\/apache2\/sites-enabled\/default-ssl.conf<\/code><\/pre>\n<p style=\"text-align: left;\">\u00a0In both configuration files add the following block of code:<\/p>\n<pre class=\"system\"><em>\u00a0\u00a0\u00a0 &lt;Directory \/var\/www\/html&gt;\n<\/em><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0Options Indexes FollowSymLinks MultiViews\n<\/em><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0AllowOverride All\n<\/em><em>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Require all granted\n<\/em><em>\u00a0\u00a0\u00a0 &lt;\/Directory&gt;<\/em><\/pre>\n<p style=\"text-align: left;\">\u00a0<a id=\"img-Debian_9-2017-08-11-19-47-072\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Debian_9-2017-08-11-19-47-072.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-1.png\" alt=\"Grant access to \/var\/www\/html directory and allow overrides\" width=\"550\" height=\"413\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">In apache <strong><em>default-ssl.conf<\/em><\/strong> TLS configuration file you can also add the below content, if not existing, in order to\u00a0improve security of Apache SSL protocol. These lines of code should fix common SSL vulnerabilities.<\/p>\n<pre class=\"system\"><em>SSLProtocol all -SSLv2 -SSLv3\n<\/em># Add SSL Cipher in one long line\n<em>SSLCipherSuite\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA<\/em>\n<em>SSLHonorCipherOrder\u00a0\u00a0\u00a0\u00a0 on<\/em>\n<em>SSLOptions +StrictRequire<\/em>\n<em>\u00a0<\/em>\n<em>Header always set Strict-Transport-Security \"max-age=63072000; includeSubdomains\"<\/em>\n<em>Header always set X-Frame-Options DENY<\/em>\n<em>Header always set X-Content-Type-Options nosniff<\/em><\/pre>\n<p style=\"text-align: left;\"><a id=\"img-Capture22\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Capture22.PNG\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-2.png\" alt=\"Set strict SSL settings in apache2\" width=\"550\" height=\"356\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">If the lines illustrated in the above excerpt already exist in the Apache SSL configuration file, make sure you modify them to look as described above. In order to apply these settings, enable the Apache <strong><em>headers<\/em><\/strong> module and restart the service by executing the following commands:<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">a2enmod headers<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">systemctl restart apache2.service<\/code><\/pre>\n<p style=\"text-align: left;\">For a production website, it should be mandatory to enable Apache TLS module because WordPress CMS generates mostly dynamic content via PHP gateway and also handles the authentication process for its internal users. Using TLS technology guarantees that the transferred information is encrypted at both ends and that the connection is secured. A third-party or a man-in-the-middle can intercept traffic but can not decrypt the content, because the information is not delivered in plain text.<\/p>\n<p style=\"text-align: left;\">After you\u2019ve made all the above changes, test Apache configuration in order to detect potential syntax errors and if everything is ok then restart LAMP daemons in order to reflect all changes made so far and enable the services system-wide by issuing the following commands.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">apache2ctl -t<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">systemctl restart apache2.service mariadb.service<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">systemctl enable apache2.service mariadb.service<\/code><\/pre>\n<p style=\"text-align: left;\">Finally, check if Apache and MariaDB services have opened ports in listening state by issuing <strong>netstat<\/strong> command and filter the output using <strong>egrep<\/strong> By now, Apache web server should have ports 80 and 443 (corresponding to HTTP and https protocols) generally exposed and MariaDB should be only binding on <strong>localhost:3306<\/strong> socket. Use the <strong>-n<\/strong> flag against <strong>netstat<\/strong> command to suppress displaying service names.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">netstat -tlp| egrep 'http|mysql'<\/code><\/pre>\n<p style=\"text-align: left;\"><strong>\u00a0<\/strong><a id=\"img-Capture12\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Capture12.PNG\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-3.png\" alt=\"Check if MariaDB is started\" width=\"550\" height=\"155\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">To make sure your web server is accessible from the internet via HTTP and HTTPS protocols open a browser and navigate to your domain name. Browsing via HTTPS protocol, a certificate error will be displayed in the browser. This is because Apache default TLS configuration file is configured to use Self-Signed Certificates. You should accept the TLS error and continue navigating to the default web page as illustrated below.<\/p>\n<p style=\"text-align: left;\"><em><strong>http:\/\/www.yourdomain.com\u00a0<\/strong><\/em><\/p>\n<p style=\"text-align: left;\"><a id=\"img-Capture8\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Capture8.PNG\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-4.png\" alt=\"Apache2 test page\" width=\"550\" height=\"397\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\"><em><strong>https:\/\/www.yourdomain.com\u00a0<\/strong><\/em><\/p>\n<p style=\"text-align: left;\"><a id=\"img-aa1\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/aa1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-5.png\" alt=\"Apache 2 test page in SSL mode\" width=\"550\" height=\"244\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">In case you cannot visit your domain default web page from the internet you should first verify if some firewall rules in the system are blocking the requests or make sure the proper ports on the router are forwarded into your internal LAN in case the server sits behind a NAT-ed network. You might also want to check the DNS records in your domain registrar panel and make sure they point to your WAN IP and if the records finished propagating on the internet.<\/p>\n<p style=\"text-align: left;\">In order to test if PHP is working as expected on the server side, create a PHP <strong><em>php<\/em><\/strong> in <strong>\/var\/www\/html\/<\/strong> system path, which is the default web document root path of Apache web server, issuing the below command and navigate to the following URI from browser to get the result: <em><strong>http:\/\/www.yourdomain.com\/info.php<\/strong><\/em><\/p>\n<pre class=\"command\"><code spellcheck=\"false\">echo '&lt;?php phpinfo(); ?&gt;' &gt; \/var\/www\/html\/info.php<\/code><\/pre>\n<p style=\"text-align: left;\"><strong>\u00a0<\/strong><a id=\"img-Capture33\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Capture33.PNG\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-6.png\" alt=\"PHP info test page\" width=\"550\" height=\"401\" title=\"\"><\/a><\/p>\n<h2 id=\"install-wordpress-\" style=\"text-align: left;\">Install WordPress 5.0<\/h2>\n<p style=\"text-align: left;\">Now that the LAMP stack is fully configured, the installation of WordPress CMS is relatively straightforward. First, log in to MariaDB database and create an installation database for WordPress and a user with the proper password for installing and managing WordPress CMS, by issuing the below commands. Feel free to replace the database name and database credentials to match your own requirements.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">mysql -u root -p<\/code><\/pre>\n<pre class=\"system\"><code spellcheck=\"false\">CREATE DATABASE wordpress;<\/code><\/pre>\n<pre class=\"system\"><code spellcheck=\"false\">GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress-user'@'localhost' IDENTIFIED BY 'wordpress-pass';<\/code><\/pre>\n<pre class=\"system\"><code spellcheck=\"false\">FLUSH PRIVILEGES;<\/code><\/pre>\n<p style=\"text-align: left;\"><strong><em>\u00a0<\/em><\/strong><a id=\"img-Debian_9-2017-08-11-18-46-061\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Debian_9-2017-08-11-18-46-061.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-7.png\" alt=\"Create WordPress MySQL database and Database User\" width=\"550\" height=\"413\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">Next, download the latest WordPress tarball from the official website using <strong>wget<\/strong> utility and extract the compressed archive with <strong>tar<\/strong> utility. Copy the installation files to Apache web server document root path by issuing the below commands. Also, make sure you remove the default <em>index.html<\/em> webpage.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">cd \/tmp<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">wget http:\/\/wordpress.org\/latest.tar.gz<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">tar xfz latest.tar.gz<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">cp -rf wordpress\/* \/var\/www\/html\/<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">rm \/var\/www\/html\/index.html<\/code><\/pre>\n<p style=\"text-align: left;\"><strong>\u00a0<\/strong><a id=\"img-Debian_9-2017-08-11-19-43-211\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Debian_9-2017-08-11-19-43-211.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-8.png\" alt=\"Download and unpack WordPress on your server\" width=\"550\" height=\"413\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">Modify the permissions of Apache webroot path as described below in order to grant web server <strong>www-data<\/strong> group full write permissions to the installation directory. This configuration will allow Apache web server to create or modify files and directories under this specific system path. The most important ones would be the\u00a0<strong>uploads<\/strong> directory and <strong><em>.htaccess<\/em><\/strong> file, which can be used to control and extend Apache functionality.<\/p>\n<pre class=\"command\"><code spellcheck=\"false\">chmod -R 775 \/var\/www\/html\/<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">chgrp\u00a0-R www-data \/var\/www\/html\/<\/code><\/pre>\n<pre class=\"command\"><code spellcheck=\"false\">ls -al \/var\/www\/html<\/code><\/pre>\n<p style=\"text-align: left;\">\u00a0<a id=\"img-Debian_9-2017-08-11-19-47-061\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_on_lamp_in_debian_9\/big\/Debian_9-2017-08-11-19-47-061.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-9.png\" alt=\"WordPress files\" width=\"550\" height=\"413\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">Now, that everything is in place, let&#8217;s start to install WordPress. The installation process will be performed from the browser. Open a browser and visit your domain via HTTPS protocol. On the first screen of the installation hit on <strong>Let\u2019s go<\/strong> button to start the installation.<\/p>\n<p style=\"text-align: left;\">\u00a0<a id=\"img-wordpress-install-dialog-11\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-install-dialog-11.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-10.png\" alt=\"WordPress web installer\" width=\"550\" height=\"392\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">In the next installation screen,\u00a0add the name of the database, the database access credentials and the database host you\u2019ve created earlier for WordPress installation and hit the\u00a0<strong>Submit<\/strong> button to continue. The configuration of the database will be saved in <strong><em>\/var\/www\/html\/wp-config.php<\/em><\/strong> You can manually modify the file at a later date for special WordPress purposes.<\/p>\n<p style=\"text-align: left;\"><a id=\"img-wordpress-install-dialog-2\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-install-dialog-2.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-11.png\" alt=\"Database settings\" width=\"550\" height=\"392\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">On the next screen click on <strong>Run the install<\/strong> button and fill your website title, the website admin credentials, and email address. A strong password should be automatically generated by the installation scripts. You can choose to save this password or provide your own strong password. When you\u2019ve finished, hit <strong>Install WordPress<\/strong> button to complete the installation process.<\/p>\n<p style=\"text-align: left;\"><a id=\"img-wordpress-install-dialog-3\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-install-dialog-3.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-12.png\" alt=\"Run installation\" width=\"550\" height=\"393\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\"><a id=\"img-wordpress-install-dialog-4\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-install-dialog-4.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-13.png\" alt=\"WordPress site information\" width=\"550\" height=\"391\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">Finally, after the installation successfully completes, <strong>log in<\/strong> to WordPress dashboard with the credentials created during the installation process and start managing your own website.<\/p>\n<p style=\"text-align: left;\">\u00a0<a id=\"img-wordpress-install-dialog-5\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-install-dialog-5.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-14.png\" alt=\"WordPress Installation Success\" width=\"550\" height=\"391\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\"><a id=\"img-wordpress-install-dialog-6\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-install-dialog-6.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-15.png\" alt=\"WordPress admin login\" width=\"550\" height=\"392\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">Log into WordPress backend.<\/p>\n<p style=\"text-align: left;\"><a id=\"img-wordpress-backend\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-backend.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-16.png\" alt=\"WordPress Backend\" width=\"550\" height=\"393\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">WordPress Admin Dashboard.<\/p>\n<p style=\"text-align: left;\"><a id=\"img-wordpress-gutenberg-editor\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-gutenberg-editor.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-17.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">Editing a post in the new WordPress Gutenberg Editor.<\/p>\n<p style=\"text-align: left;\"><a id=\"img-wordpress-frontend\" class=\"fancybox\" href=\"https:\/\/www.howtoforge.com\/images\/install_wordpress_5_on_lamp_in_debian_9\/big\/wordpress-frontend.png\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" src=\"https:\/\/afaghhosting.net\/blog\/wp-content\/uploads\/2018\/12\/install-wordpress-5-with-apache-on-debian-9-18.png\" alt=\"\" title=\"\"><\/a><\/p>\n<p style=\"text-align: left;\">WordPress 5.0 Frontend with new\u00a0TwentyNineteen Theme.<\/p>\n<p style=\"text-align: left;\">Congratulations! You\u2019ve successfully installed the latest version of WordPress CMS on top of LAMP software bundle in Debian 9, codename Stretch.<\/p>\n<h2 id=\"g0.0.23\" style=\"text-align: left;\">Virtual machine image download of this tutorial<\/h2>\n<p style=\"text-align: left;\">This tutorial is available as ready to use virtual machine image in ovf\/ova format that is compatible with VMWare and Virtualbox. The virtual machine image uses the following login details:<\/p>\n<p style=\"text-align: left;\"><strong>SSH \/ Shell Login<\/strong><\/p>\n<p style=\"text-align: left;\">Username: administrator<br \/>\nPassword: howtoforge<\/p>\n<p style=\"text-align: left;\">This user has su rights.<\/p>\n<p style=\"text-align: left;\">Username:\u00a0root<br \/>\nPassword: howtoforge<\/p>\n<p style=\"text-align: left;\"><strong>WordPress Login<\/strong><\/p>\n<p style=\"text-align: left;\">Username: admin<br \/>\nPassword: howtoforge<\/p>\n<p style=\"text-align: left;\"><strong>MySQL Login<\/strong><\/p>\n<p style=\"text-align: left;\">Username:\u00a0root<br \/>\nPassword: howtoforge<\/p>\n<p style=\"text-align: left;\">The IP of the VM is 192.168.1.100, it can be changed in the file \/etc\/network\/interfaces. Please change all the above passwords to secure the virtual machine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial will show you how to install and configure the latest version of WordPress 5 on top of a LAMP stack in Debian 9 &#8211;\u00a0Stretch. WordPress, without a doubt, is one\u00a0of the most popular open-source Content Management System or CMS used in these days for internet publishing, which powers more than 60 million websites [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"class_list":["post-7422","post","type-post","status-publish","format-standard","hentry","category-36"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7422","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=7422"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/7422\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=7422"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=7422"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=7422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}