{"id":822,"date":"2019-04-11T15:22:42","date_gmt":"2019-04-11T12:22:42","guid":{"rendered":"http:\/\/www.fusionit.eu\/?p=822"},"modified":"2020-06-15T11:49:59","modified_gmt":"2020-06-15T08:49:59","slug":"install-wordpress-on-ubuntu-18-04","status":"publish","type":"post","link":"https:\/\/www.fusionit.eu\/index.php\/2019\/04\/11\/install-wordpress-on-ubuntu-18-04\/","title":{"rendered":"Install WordPress on Ubuntu 18.04"},"content":{"rendered":"<h2>How to install WordPress on Ubuntu with Apache2 and PHP7.0<\/h2>\n<p>This guide will help you install WordPress on Ubuntu. This will help you leverage cost effective technology that requires no licensing. There are many other CMS systems out there, and few are very good. WordPress is tops due to the fact that it has more support and thousands of plugins and themes. It&#8217;s <a href=\"https:\/\/www.fusionit.eu\/index.php\/website-seo\/\">SEO<\/a> benefits are substantial and it&#8217;s building blocks allow even the uninitiated a chance to develop great websites. I have personally adjusted and run through these steps myself so can confirm it is a working set of steps!<\/p>\n<p>WordPress is the most powerful and popular content management system and is the right tool to develop and build powerful and dynamic websites. With PHP 7.0 now supported, you can greatly improve on its performance when configured with Apache2. For those who want to learn how to install WordPress on Ubuntu, the steps below should help greatly.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-836\" src=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/laptop-593673_640-300x194.jpg\" alt=\"Install WordPress on Ubuntu\" width=\"300\" height=\"194\" srcset=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/laptop-593673_640-300x194.jpg 300w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/laptop-593673_640-600x387.jpg 600w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/laptop-593673_640.jpg 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>To get started with installing WordPress, follow the steps below:<\/p>\n<h4>1: Install Apache2 HTTP Server<\/h4>\n<p>WordPress needs a web server and Apache2 is lightweight, powerful and a highly configurable Web Server. To install it on Ubuntu and configure it to start automatically on boot, run the commands below:<\/p>\n<pre>sudo apt update\r\nsudo apt install apache2<\/pre>\n<pre>sudo systemctl stop apache2.service\r\nsudo systemctl start apache2.service\r\nsudo systemctl enable apache2.service<\/pre>\n<h4>2: Install SQL Database Server<\/h4>\n<pre>sudo apt-get install mysql-server\r\nsudo ufw allow mysql\r\nsudo systemctl enable mysql<\/pre>\n<p>Now connect to MYSQL and create database, replace username and database name as you see fit<\/p>\n<pre>sudo mysql_secure_installation<\/pre>\n<ul>\n<li>Enter current password for root (enter for none): Just press the\u00a0Enter<\/li>\n<li>Set root password? [Y\/n]:\u00a0Y<\/li>\n<li>New password:\u00a0Enter password<\/li>\n<li>Re-enter new password:\u00a0Repeat password<\/li>\n<li>Remove anonymous users? [Y\/n]:\u00a0Y<\/li>\n<li>Disallow root login remotely? [Y\/n]:\u00a0Y<\/li>\n<li>Remove test database and access to it? [Y\/n]: \u00a0Y<\/li>\n<li>Reload privilege tables now? [Y\/n]: \u00a0Y<\/li>\n<\/ul>\n<pre>mysql -u root -p\r\nCREATE DATABASE <span class=\"highlight text-highlight\">wordpress<\/span> DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;\r\nGRANT ALL ON <span class=\"highlight text-highlight\">wordpress<\/span>.* TO '<span class=\"highlight text-highlight\">wordpressuser<\/span>'@'localhost' IDENTIFIED BY '<span class=\"highlight text-highlight\">password<\/span>';\r\nFLUSH PRIVILEGES;\r\nEXIT;<\/pre>\n<h4>3: Install PHP 7.0 and Related Modules<\/h4>\n<pre>sudo apt-get install software-properties-common\r\nsudo add-apt-repository ppa:ondrej\/php\r\nsudo apt update<\/pre>\n<p>Then run the below.<\/p>\n<pre><code>sudo apt install php7.0 libapache2-mod-php7.0 php7.0-common php7.0-mbstring php7.0-xmlrpc php7.0-gd php7.0-xml php7.0-mysql php7.0-cli php7.0-zip php7.0-curl<\/code><\/pre>\n<p>Thereafter open the PHP.ini and make the below changes<\/p>\n<pre>sudo nano \/etc\/php\/7.0\/apache2\/php.ini<\/pre>\n<pre>memory_limit = 256M\r\nupload_max_filesize = 100M\r\nmax_execution_time = 360\r\ndate.timezone = America\/Chicago<\/pre>\n<h4>4: Download WordPress Latest Release<\/h4>\n<p>After downloading, run the commands below to extract the downloaded file and move it into a new WordPress root directory.<\/p>\n<pre>cd \/tmp &amp;&amp; wget https:\/\/wordpress.org\/latest.tar.gz\r\ntar -zxvf latest.tar.gz\r\nsudo mv wordpress\/* \/var\/www\/html\/<\/pre>\n<p>For WordPress to function correctly, run the commands below to set the correct permissions.<\/p>\n<pre>sudo chown -R www-data:www-data \/var\/www\/html\/\r\nsudo chmod -R 755 \/var\/www\/html\/<\/pre>\n<h4>5: Configure Apache2 HTTP Server<\/h4>\n<p>Now configure the Apache site configuration file for WordPress. This file will control how users access WordPress. Run the commands below to create a new configuration file called <strong>wordpress.conf<\/strong><\/p>\n<pre>sudo nano \/etc\/apache2\/sites-available\/wordpress.conf<\/pre>\n<p>Then copy and paste the content below into the file and save it. Replace the highlighted line with your own domain name and directory root location.<\/p>\n<pre>&lt;VirtualHost *:80&gt;\r\n     ServerAdmin <span class=\"text-highlight\">admin@example.com<\/span>\r\n     DocumentRoot \/var\/www\/html\/\r\n     ServerName <span class=\"text-highlight\">example.com<\/span>\r\n     ServerAlias <span class=\"text-highlight\">www.example.com<\/span>\r\n\r\n     &lt;Directory \/var\/www\/html\/&gt;\r\n        Options +FollowSymlinks\r\n        AllowOverride All\r\n        Require all granted\r\n     &lt;\/Directory&gt;\r\n\r\n     ErrorLog ${APACHE_LOG_DIR}\/error.log\r\n     CustomLog ${APACHE_LOG_DIR}\/access.log combined\r\n\r\n&lt;\/VirtualHost&gt;<\/pre>\n<p>Save file and exit. CTRL+x<\/p>\n<p>Now enable the WordPress and Rewrite Module and restart Apache<\/p>\n<pre>sudo a2ensite wordpress.conf\r\nsudo a2enmod rewrite\r\nsudo systemctl restart apache2.service<\/pre>\n<h4>6: CONFIGURE WORDPRESS<\/h4>\n<p>Run the commands below to create WordPress wp-config.php\u00a0file.<\/p>\n<pre><code>sudo mv \/var\/www\/html\/wp-config-sample.php \/var\/www\/html\/wp-config.php\r\nsudo nano \/var\/www\/html\/wp-config.php\r\n<\/code><\/pre>\n<p>Enter the highlighted text below that you created for your database and save. If you changed database and user then amend them here before saving.<\/p>\n<pre>\/\/ ** MySQL settings - You can get this info from your web host ** \/\/\r\n\/** The name of the database for WordPress *\/\r\ndefine('DB_NAME', '<span class=\"text-highlight\">wordpress<\/span>');\r\n\r\n\/** MySQL database username *\/\r\ndefine('DB_USER', '<span class=\"text-highlight\">wordpressuser<\/span>');\r\n\r\n\/** MySQL database password *\/\r\ndefine('DB_PASSWORD', '<span class=\"text-highlight\">password<\/span>');\r\n\r\n\/** MySQL hostname *\/\r\ndefine('DB_HOST', 'localhost');\r\n\r\n\/** Database Charset to use in creating database tables. *\/\r\ndefine('DB_CHARSET', 'utf8');\r\n\r\n\/** The Database Collate type. Don't change this if in doubt. *\/\r\ndefine('DB_COLLATE', '');<\/pre>\n<p>Then<\/p>\n<pre><code>sudo rm \/var\/www\/html\/index.html<\/code> <code>sudo service apache2 restart<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>Now open your browser and browse to your domain name to launch the WordPress configuration wizard.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-823\" src=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_1-211x300.jpg\" alt=\"Wordpress install-1\" width=\"211\" height=\"300\" srcset=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_1-211x300.jpg 211w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_1.jpg 421w\" sizes=\"auto, (max-width: 211px) 100vw, 211px\" \/><\/p>\n<p>Then type the WordPress website name and create a new admin user and password.. the click\u00a0<strong>install<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-824\" src=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_2-300x298.jpg\" alt=\"Wordpress install-2\" width=\"300\" height=\"298\" srcset=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_2-300x298.jpg 300w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_2-150x150.jpg 150w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_2-600x597.jpg 600w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_2-100x100.jpg 100w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_2.jpg 696w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>This should install WordPress.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-825\" src=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_3-300x178.jpg\" alt=\"Wordpress install-3\" width=\"300\" height=\"178\" srcset=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_3-300x178.jpg 300w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_3-768x455.jpg 768w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_3-600x355.jpg 600w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/wordpress_3.jpg 959w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Optional &#8211; Now lets look at enabling SSL for the site.<\/p>\n<h4 id=\"step-1-\u2014-install-the-let-39-s-encrypt-client\">Step 1 \u2014 Install the Let&#8217;s Encrypt Client for your Website<\/h4>\n<p>First, add the repository:<\/p>\n<pre>sudo add-apt-repository ppa:certbot\/certbot<\/pre>\n<p>Then install Certbot<\/p>\n<pre>sudo apt-get update\r\nsudo apt-get install python-certbot-apache<\/pre>\n<h4 id=\"step-2-\u2014-set-up-the-ssl-certificate\">Step 2 \u2014 Set Up the SSL Certificate<\/h4>\n<pre>sudo certbot --apache -d <span class=\"highlight\">example.com<\/span>\r\nsudo certbot --apache -d <span class=\"highlight\">example.com<\/span> -d <span class=\"highlight\">www.example.com<\/span><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-830\" src=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/safety-2890768_640-300x180.jpg\" alt=\"SEO SSL\" width=\"300\" height=\"180\" srcset=\"https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/safety-2890768_640-300x180.jpg 300w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/safety-2890768_640-600x359.jpg 600w, https:\/\/www.fusionit.eu\/wp-content\/uploads\/2019\/04\/safety-2890768_640.jpg 640w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>You can also search <a href=\"http:\/\/www.youtube.com\">youtube<\/a> for some great video tutorials.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to install WordPress on Ubuntu with Apache2 and PHP7.0 This guide will help you install WordPress on Ubuntu. This will help you leverage cost effective technology that requires no licensing. There are many other CMS systems out there, and few are very good. WordPress is tops due to the fact that it has more&hellip;<\/p>\n","protected":false},"author":1,"featured_media":875,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"post_series":[],"class_list":["post-822","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","entry","has-media"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/posts\/822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/comments?post=822"}],"version-history":[{"count":0,"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/posts\/822\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/media\/875"}],"wp:attachment":[{"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/media?parent=822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/categories?post=822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/tags?post=822"},{"taxonomy":"post_series","embeddable":true,"href":"https:\/\/www.fusionit.eu\/index.php\/wp-json\/wp\/v2\/post_series?post=822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}