From c7a87aa1ea6518b61d462e8aa76e84a392e5753a Mon Sep 17 00:00:00 2001 From: bktan8 Date: Mon, 11 May 2020 09:45:13 -0700 Subject: [PATCH] Update WordPress tutorial (#1154) Closes #1138 Signed-off-by: Bun K Tan --- ...web-server-install.rst => lamp-server.rst} | 81 ++++--- source/tutorials/php.rst | 2 +- source/tutorials/wordpress.rst | 219 ++++++++++++++++-- source/tutorials/wordpress/wp-install.rst | 198 ---------------- 4 files changed, 250 insertions(+), 250 deletions(-) rename source/tutorials/{wordpress/web-server-install.rst => lamp-server.rst} (89%) delete mode 100644 source/tutorials/wordpress/wp-install.rst diff --git a/source/tutorials/wordpress/web-server-install.rst b/source/tutorials/lamp-server.rst similarity index 89% rename from source/tutorials/wordpress/web-server-install.rst rename to source/tutorials/lamp-server.rst index c120e143..4f329d1e 100644 --- a/source/tutorials/wordpress/web-server-install.rst +++ b/source/tutorials/lamp-server.rst @@ -1,4 +1,4 @@ -.. _web-server-install: +.. _lamp-server-install: Set up a LAMP web server on |CL-ATTR| ##################################### @@ -46,13 +46,12 @@ Apache software bundle on |CL|. sudo swupd bundle-add httpd - -#. To start the Apache service, enter the following commands: +#. Start the Apache service and set it start automatically on boot, + enter the following commands: .. code-block:: bash - sudo systemctl enable httpd.service - sudo systemctl start httpd.service + sudo systemctl enable --now httpd.service #. To verify that the Apache server application is running, open a web browser and navigate to: \http://localhost. @@ -60,7 +59,9 @@ Apache software bundle on |CL|. If the service is running, a confirmation message will appear, similar to the message shown in figure 1. - .. figure:: /_figures/wordpress/web-server-install-1.png + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/web-server-install-1.png :alt: This web server is operational from host. :scale: 50% @@ -150,12 +151,11 @@ default values, and define a custom DocumentRoot for your web server. "It works from its new location!" -#. Stop and then restart ``httpd.service``. +#. Restart ``httpd.service``. .. code-block:: bash - sudo systemctl stop httpd.service - sudo systemctl start httpd.service + sudo systemctl restart httpd.service #. Go to \http://localhost to view the new screen. You should see your updated default message from step 5. @@ -168,12 +168,11 @@ default values, and define a custom DocumentRoot for your web server. sudo nano /etc/httpd/conf.d/httpd.conf -#. Stop and then restart ``httpd.service``. +#. Restart ``httpd.service``. .. code-block:: bash - sudo systemctl stop httpd.service - sudo systemctl start httpd.service + sudo systemctl restart httpd.service #. Go to \http://localhost and verify that you can see the default screen again. @@ -198,12 +197,12 @@ functionality to your web server, install PHP on your system. sudo swupd bundle-add php-basic -#. To enable PHP, enter the following commands: +#. To enable PHP and set it to start automatically on boot, enter the + following commands: .. code-block:: bash - sudo systemctl enable php-fpm.service - sudo systemctl start php-fpm.service + sudo systemctl enable --now php-fpm.service sudo systemctl restart httpd.service After restarting the Apache service, test your PHP installation. @@ -225,7 +224,9 @@ functionality to your web server, install PHP on your system. #. Verify that the PHP information screen appears, similar to figure 2: - .. figure:: /_figures/wordpress/web-server-install-2.png + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/web-server-install-2.png :alt: PHP information screen :width: 600 @@ -247,12 +248,12 @@ and is available in the database-basic |CL| bundle. sudo swupd bundle-add database-basic -#. To start MariaDB after it is installed, enter the following commands: +#. To start MariaDB after it is installed and set it to start automatically on + boot, enter the following commands: .. code-block:: bash - sudo systemctl enable mariadb - sudo systemctl start mariadb + sudo systemctl enable --now mariadb #. To check the status of MariaDB, enter the following command: @@ -280,7 +281,7 @@ hardening. Our suggested responses follow each question. - .. code-block:: bash + .. code-block:: none Enter current password for root (enter for none): @@ -288,7 +289,7 @@ hardening. user. For a newly installed MariaDB without a set root password, the password is blank. Thus, press enter to continue. - .. code-block:: bash + .. code-block:: none OK, successfully used password, moving on... @@ -299,19 +300,19 @@ hardening. Set the root password to prevent unauthorized MariaDB root user logins. To set a root password, type 'y'. - .. code-block:: bash + .. code-block:: none New password: Type the desired password for the root user. - .. code-block:: bash + .. code-block:: none Re-enter new password: Re-type the desired password for the root user. - .. code-block:: bash + .. code-block:: none Password updated successfully! Reloading privilege tables.. @@ -324,7 +325,7 @@ hardening. is intended only for testing and for a smoother installation. To remove the anonymous user and make your database more secure, type 'y'. - .. code-block:: bash + .. code-block:: none ... Success! Disallow root login remotely? [Y/n] @@ -333,7 +334,7 @@ hardening. ensures that someone cannot guess the root password from the network. To block any remote root login, type 'y'. - .. code-block:: bash + .. code-block:: none ... Success! Remove test database and access to it? [Y/n] @@ -342,7 +343,7 @@ hardening. This database is also intended only for testing and should be removed. To remove the test database, type 'y'. - .. code-block:: bash + .. code-block:: none - Dropping test database... ... Success! @@ -353,7 +354,7 @@ hardening. Reloading the privilege tables ensures all changes made so far take effect immediately. To reload the privilege tables, type 'y'. - .. code-block:: bash + .. code-block:: none ... Success! @@ -415,7 +416,9 @@ steps below for setting up a database called "WordPress". :ref:`mysql_secure_installation command `. Enter your credentials and select :guilabel:`Go` to log in: - .. figure:: /_figures/wordpress/web-server-install-3.png + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/web-server-install-3.png :alt: phpMyAdmin login page :width: 600 @@ -424,7 +427,9 @@ steps below for setting up a database called "WordPress". #. Verify a successful login by confirming that the main phpMyAdmin page displays, as shown in figure 4: - .. figure:: /_figures/wordpress/web-server-install-4.png + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/web-server-install-4.png :alt: phpMyAdmin dashboard :width: 600 @@ -441,7 +446,9 @@ steps below for setting up a database called "WordPress". #. Click :guilabel:`Create`. - .. figure:: /_figures/wordpress/web-server-install-5.png + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/web-server-install-5.png :alt: Databases tab :width: 600 @@ -452,7 +459,9 @@ steps below for setting up a database called "WordPress". #. Select the :guilabel:`Privileges` tab. Figure 6 shows its contents. - .. figure:: /_figures/wordpress/web-server-install-6.png + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/web-server-install-6.png :alt: Privileges tab :width: 600 @@ -462,7 +471,9 @@ steps below for setting up a database called "WordPress". :guilabel:`Privileges` tab. The `Add user account` page appears, as shown in figure 7. - .. figure:: /_figures/wordpress/web-server-install-7.png + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/web-server-install-7.png :alt: User accounts tab :width: 600 @@ -484,7 +495,9 @@ steps below for setting up a database called "WordPress". If successful, you should see the screen shown in figure 8: -.. figure:: /_figures/wordpress/web-server-install-8.png +.. rst-class:: dropshadow + +.. figure:: ../_figures/wordpress/web-server-install-8.png :alt: User added successfully :width: 600 diff --git a/source/tutorials/php.rst b/source/tutorials/php.rst index 5060f616..9ba711e4 100644 --- a/source/tutorials/php.rst +++ b/source/tutorials/php.rst @@ -61,7 +61,7 @@ Prerequisites .. note:: PHP does not require a web server for operation. If you need a web - server, refer to :ref:`web-server-install` for instructions on setting + server, refer to :ref:`lamp-server-install` for instructions on setting up a :abbr:`LAMP (Linux, Apache\*, MySQL, PHP)` server, or use :command:`swupd` to install :file:`nginx` or similar. diff --git a/source/tutorials/wordpress.rst b/source/tutorials/wordpress.rst index da6c9c03..860e330c 100644 --- a/source/tutorials/wordpress.rst +++ b/source/tutorials/wordpress.rst @@ -1,27 +1,212 @@ -.. _wordpress: +.. _wp-install: -WordPress\* -########### +Set up WordPress\* on a LAMP web server +####################################### -This tutorial describes how to setup a web server to host a WordPress\* site on a -|CL-ATTR| system. The tutorial is split into two sections: +This tutorial shows you how to install the WordPress\* components on your |CL| +:abbr:`LAMP (Linux, Apache, MySQL, PHP)` server. At the end of +:ref:`lamp-server-install`, you created a WordPress-ready database using +phpMyAdmin\* and MariaDB\*. Now that the LAMP server is up and running, you +can add the WordPress components needed to host a WordPress website on your system. -#. :ref:`web-server-install` +Before you begin +**************** -#. :ref:`wp-install` +This tutorial assumes that you have successfully completed +:ref:`bare-metal-install-desktop` and you have :ref:`lamp-server-install`. -If you already have a |CL| based :abbr:`LAMP (Linux, Apache, MySQL, PHP)` web server, -you can skip ahead to the second section of this tutorial. +Create a WordPress server +************************* + +WordPress can be installed in a variety of ways. These instructions are +written for users who have followed our instructions for installing phpMyAdmin +when they :ref:`set up a LAMP web server `. Note that +all steps in this tutorial have been tested using a NUC6i5SYH Intel® NUC. +Visit the `NUC6i5SYH product page`_ for detailed information. + +Numerous online articles are available to help you name your website and +acquire the necessary certificates. Those tasks are beyond the scope of this tutorial. + +You can take several actions to harden your website from attacks. The security +of your website and the data it contains are complex and ever-evolving tasks. +Prioritize security if you plan to expose your website to the outside world. +This tutorial does not address security measures that you can take to harden +your site but we strongly encourage you to take action. .. note:: - This tutorial is for development and testing purposes only. Additional steps - are required to secure production systems. Those steps are beyond the scope - of this tutorial. + Throughout this tutorial, we reference your website name as . -.. toctree:: - :maxdepth: 1 - :hidden: - wordpress/web-server-install.rst - wordpress/wp-install.rst +Download WordPress and manage directories +========================================= + +For this tutorial, you will create a WordPress blog that can be accessed at: +\http:///blog. + +To accomplish this setup, you must add WordPress components to the :file:`/var/www/html/blog` +directory. + +Follow these steps: + + +#. Navigate to the top level of the website’s root directory: + + .. code-block:: bash + + cd /var/www/html + +#. Download the latest version of WordPress: + + .. code-block:: bash + + sudo curl -O https://wordpress.org/latest.tar.gz + +#. Extract all files and directories from the downloaded file: + + .. code-block:: bash + + sudo tar –xzvf latest.tar.gz + +#. Rename the top-level WordPress directory to “blog”: + + .. code-block:: bash + + sudo mv wordpress blog + +#. Remove the downloaded tar file: + + .. code-block:: bash + + sudo rm latest.tar.gz + +Set up WordPress with web-based GUI +=================================== + +Recall that you created a database and user when you installed phpMyAdmin when you +set up a |CL| based :ref:`web server `. Next, you must +connect WordPress to the database and install WordPress. + +To continue with the setup, go to: \http:///blog/wp-admin/install.php. +The WordPress language option screen appears, as shown in figure 1. + +#. Select :guilabel:`English` and click :guilabel:`Continue`. + + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/wp-install-1.png + :alt: WordPress language selection + :width: 600 + + `Figure 1: WordPress language selection screen.` + + + The WordPress installation continues until the Welcome screen appears, as shown in + figure 2: + + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/wp-install-2.png + :alt: WordPress welcome screen + :width: 600 + + `Figure 2: WordPress Welcome screen.` + +#. Click :guilabel:`Let’s go!`. + +#. Enter database connection specifics in the screen that appears, as shown in figure 3 + below. + + * Database name: WordPress + * Database username: wordpressuser + * Database password: wp-example (asterisks will not appear in the text box) + * Database host: localhost + * Table prefix: wp\_ + + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/wp-install-3.png + :alt: Database connection details + :width: 600 + + `Figure 3: Information necessary for WordPress to connect to the database.` + +#. Click :guilabel:`Submit` to complete the setup. + + Figure 4 shows the confirmation screen that verifies a successful setup. WordPress + is connected to the MariaDB database. + + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/wp-install-4.png + :alt: Successful database connection. + :width: 600 + + `Figure 4: Successful WordPress connection.` + +#. Click :guilabel:`Run the install`. + The installer runs until WordPress is fully installed on your system. + +Complete successful login +========================= + +Once the installation is complete, you can name your blog and create a WordPress username +and password. See figure 5. + +.. rst-class:: dropshadow + +.. figure:: ../_figures/wordpress/wp-install-5.png + :alt: WordPress user creation + :width: 600 + + `Figure 5: WordPress site information screen.` + + +#. Enter all required information. +#. Click :guilabel:`Install WordPress`. +#. Verify that the initial login screen appears once the installation is complete. See figure 6: + + .. rst-class:: dropshadow + + .. figure:: ../_figures/wordpress/wp-install-6.png + :alt: WordPress login + :width: 600 + + `Figure 6: The WordPress login screen.` + +#. Enter your WordPress username and password. +#. Check :guilabel:`Remember me` to save your credentials. +#. Click :guilabel:`Log in`. + +Figure 7 shows the WordPress dashboard after a successful login: + +.. rst-class:: dropshadow + +.. figure:: ../_figures/wordpress/wp-install-7.png + :alt: WordPress Dashboard + :width: 600 + + `Figure 7: The WordPress dashboard.` + +You are ready to go! + +To check out your blog as it is seen by the outside world, enter: +\http:///blog on your browser. Figure 8 shows the result: + +.. figure:: ../_figures/wordpress/wp-install-8.png + :alt: WordPress blog + :width: 600 + + `Figure 8: Your WordPress blog.` + +**Congratulations, your WordPress blog is up and running!** + +You have successfully installed WordPress on a host system. + +Add new entries to your blog and share them with the world using |CL|! + +.. _`step-by-step guide`: + https://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install + +.. _`NUC6i5SYH product page`: + http://www.intel.com/content/www/us/en/nuc/nuc-kit-nuc6i5syh.html diff --git a/source/tutorials/wordpress/wp-install.rst b/source/tutorials/wordpress/wp-install.rst deleted file mode 100644 index e5fcd1eb..00000000 --- a/source/tutorials/wordpress/wp-install.rst +++ /dev/null @@ -1,198 +0,0 @@ -.. _wp-install: - -Set up WordPress\* on a LAMP web server -####################################### - -This tutorial shows you how to install the WordPress\* components on your |CL| -:abbr:`LAMP (Linux, Apache, MySQL, PHP)` server. At the end of -:ref:`web-server-install`, you created a WordPress-ready database using -phpMyAdmin\* and MariaDB\*. Now that the LAMP server is up and running, you -can add the WordPress components needed to host a WordPress website on your system. - -Before you begin -**************** - -This tutorial assumes that you have successfully completed -:ref:`bare-metal-install-desktop` and you have :ref:`web-server-install`. - -Create a WordPress server -************************* - -WordPress can be installed in a variety of ways. These instructions are -written for users who have followed our instructions for installing phpMyAdmin -when they :ref:`set up a LAMP web server `. Note that -all steps in this tutorial have been tested using a NUC6i5SYH Intel® NUC. -Visit the `NUC6i5SYH product page`_ for detailed information. - -Numerous online articles are available to help you name your website and -acquire the necessary certificates. Those tasks are beyond the scope of this tutorial. - -You can take several actions to harden your website from attacks. The security -of your website and the data it contains are complex and ever-evolving tasks. -Prioritize security if you plan to expose your website to the outside world. -This tutorial does not address security measures that you can take to harden -your site but we strongly encourage you to take action. - -.. note:: - - Throughout this tutorial, we reference your website name as . - - -Download WordPress and manage directories -========================================= - -For this tutorial, you will create a WordPress blog that can be accessed at: -\http:///blog. - -To accomplish this setup, you must add WordPress components to the :file:`/var/www/html/blog` -directory. - -Follow these steps: - - -#. Navigate to the top level of the website’s root directory: - - .. code-block:: bash - - cd /var/www/html - -#. Download the latest version of WordPress: - - .. code-block:: bash - - sudo curl -O https://wordpress.org/latest.tar.gz - -#. Extract all files and directories from the downloaded file: - - .. code-block:: bash - - sudo tar –xzvf latest.tar.gz - -#. Rename the top-level WordPress directory to “blog”: - - .. code-block:: bash - - sudo mv wordpress blog - -#. Remove the downloaded tar file: - - .. code-block:: bash - - sudo rm latest.tar.gz - -Set up WordPress with web-based GUI -=================================== - -Recall that you created a database and user when you installed phpMyAdmin when you -set up a |CL| based :ref:`web server `. Next, you must -connect WordPress to the database and install WordPress. - -To continue with the setup, go to: \http:///blog/wp-admin/install.php. -The WordPress language option screen appears, as shown in figure 1. - -#. Select :guilabel:`English` and click :guilabel:`Continue`. - - .. figure:: /_figures/wordpress/wp-install-1.png - :alt: WordPress language selection - :width: 600 - - `Figure 1: WordPress language selection screen.` - - - The WordPress installation continues until the Welcome screen appears, as shown in - figure 2: - - .. figure:: /_figures/wordpress/wp-install-2.png - :alt: WordPress welcome screen - :width: 600 - - `Figure 2: WordPress Welcome screen.` - -#. Click :guilabel:`Let’s go!`. - -#. Enter database connection specifics in the screen that appears, as shown in figure 3 - below. - - * Database name: WordPress - * Database username: wordpressuser - * Database password: wp-example (asterisks will not appear in the text box) - * Database host: localhost - * Table prefix: wp\_ - - .. figure:: /_figures/wordpress/wp-install-3.png - :alt: Database connection details - :width: 600 - - `Figure 3: Information necessary for WordPress to connect to the database.` - -#. Click :guilabel:`Submit` to complete the setup. - - Figure 4 shows the confirmation screen that verifies a successful setup. WordPress - is connected to the MariaDB database. - - .. figure:: /_figures/wordpress/wp-install-4.png - :alt: Successful database connection. - :width: 600 - - `Figure 4: Successful WordPress connection.` - -#. Click :guilabel:`Run the install`. - The installer runs until WordPress is fully installed on your system. - -Complete successful login -========================= - -Once the installation is complete, you can name your blog and create a WordPress username -and password. See figure 5. - -.. figure:: /_figures/wordpress/wp-install-5.png - :alt: WordPress user creation - :width: 600 - - `Figure 5: WordPress site information screen.` - - -#. Enter all required information. -#. Click :guilabel:`Install WordPress`. -#. Verify that the initial login screen appears once the installation is complete. See figure 6: - - .. figure:: /_figures/wordpress/wp-install-6.png - :alt: WordPress login - :width: 600 - - `Figure 6: The WordPress login screen.` - -#. Enter your WordPress username and password. -#. Check :guilabel:`Remember me` to save your credentials. -#. Click :guilabel:`Log in`. - -Figure 7 shows the WordPress dashboard after a successful login: - -.. figure:: /_figures/wordpress/wp-install-7.png - :alt: WordPress Dashboard - :width: 600 - - `Figure 7: The WordPress dashboard.` - -You are ready to go! - -To check out your blog as it is seen by the outside world, enter: -\http:///blog on your browser. Figure 8 shows the result: - -.. figure:: /_figures/wordpress/wp-install-8.png - :alt: WordPress blog - :width: 600 - - `Figure 8: Your WordPress blog.` - -**Congratulations, your WordPress blog is up and running!** - -You have successfully installed WordPress on a host system. - -Add new entries to your blog and share them with the world using |CL|! - -.. _`step-by-step guide`: - https://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install - -.. _`NUC6i5SYH product page`: - http://www.intel.com/content/www/us/en/nuc/nuc-kit-nuc6i5syh.html