Merge branch 'wp-tut' into 'master'
Wp tut Publication of the WordPress use-case tutorial. See merge request !128
@@ -8,6 +8,6 @@ Tutorials
|
||||
ciao-deploy
|
||||
ciao-cluster-setup-quick.rst
|
||||
ciao-cluster-setup
|
||||
|
||||
tutorials/wordpress.rst
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,359 @@
|
||||
.. _bare-metal-install:
|
||||
|
||||
Clear Linux host OS install on bare metal
|
||||
#########################################
|
||||
|
||||
Verify your system hardware is supported by |CLOSIA|. |CL|can run on all
|
||||
Intel® 64bit processors which support UEFI\* and SSE\* v4.1 streaming SIMD\*
|
||||
instructions. The following processor families can run |CL|:
|
||||
|
||||
* 2nd Generation, or later, Intel® Core™ processor family.
|
||||
* Intel® Xeon® Processor E3
|
||||
* Intel® Xeon® Processor E5
|
||||
* Intel® Xeon® Processor E7
|
||||
* Intel® Atom™ processor C2000 product family for servers -- Q3 2013 version
|
||||
or later.
|
||||
* Intel® Atom™ processor E3800 series -- Q4 2013 version or later.
|
||||
|
||||
Additionally, all the steps of this tutorial were tested using a NUC6i5SYH
|
||||
Intel® NUC. Visit the `NUC6i5SYH product page`_ for detailed information.
|
||||
|
||||
If you are unsure whether or not your system is compatible with |CL|, you can
|
||||
follow these instructions to find out.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
compatibility-check.rst
|
||||
|
||||
.. note::
|
||||
|
||||
Only a system running a Linux distribution can run the compatibility
|
||||
check. There are two options:
|
||||
* Install and run a Linux distribution directly on your system.
|
||||
* Run a live image from a USB stick.
|
||||
|
||||
.. _bootable-usb:
|
||||
|
||||
Create a Clear Linux bootable USB drive
|
||||
=======================================
|
||||
|
||||
This procedure was created on an Ubuntu 16.04-based system where the USB
|
||||
drive is identified as :file:`/dev/sdb`. Make sure to map your correct USB
|
||||
device for this process. We recommend you use an 8GB USB drive or larger.
|
||||
Copying the |CL| image onto the USB drive formats the drive as a UEFI boot
|
||||
device. Therefore, the contents of the USB drive will be destroyed during the
|
||||
creation of the bootable USB drive. Make sure to save anything stored in the
|
||||
drive before proceeding.
|
||||
|
||||
Download the Latest Clear Linux Image
|
||||
-------------------------------------
|
||||
|
||||
Get the latest available |CL| installer image that you want to install
|
||||
to your system by using your web browser and downloading the latest
|
||||
:file:`clear-[release]-installer.img.xz` file from
|
||||
https://download.clearlinux.org/image/ where `[release]` is the release
|
||||
number of the current image that is available in this directory listing.
|
||||
|
||||
This example uses release 10980 so we will download the
|
||||
:file:`clear-10980-installer.img.xz` image file and, optionally, the
|
||||
:file:`clear-10980-installer.img.xz-SHA512SUMS` file needed to verify the
|
||||
download.
|
||||
|
||||
To verify the download, follow these steps:
|
||||
|
||||
1. Go to the directory with the downloaded files.
|
||||
2. To verify the integrity of the file, enter the following commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sha512sum ./clear-10980-installer.img.xz>sha.tmp
|
||||
diff clear-10980-installer.img.xz-SHA512SUMS sha.tmp
|
||||
|
||||
If the files differ, the diff command outputs the difference to the console,
|
||||
otherwise, diff does not have any output to the console and returns you to
|
||||
the command prompt.
|
||||
|
||||
3. Once the downloaded file is verified, delete the :file:`sha.tmp` file with
|
||||
the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
rm sha.tmp
|
||||
|
||||
Copy the Clear Linux image to a USB drive
|
||||
-----------------------------------------
|
||||
|
||||
This example assumes that the USB drive is connected to your system as
|
||||
:file:`/dev/sdb` and is not mounted.
|
||||
|
||||
To ensure the device is not mounted, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
umount /dev/sdb
|
||||
|
||||
To log in as root, simply enter:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
su
|
||||
|
||||
Once prompted, enter your root password.
|
||||
|
||||
To extract the downloaded image file and put it on the USB drive, enter the
|
||||
following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
xzcat –v clear-10980-installer.img.xz | dd of=/dev/sdb
|
||||
|
||||
.. note::
|
||||
|
||||
These commands only work in the directory containing the downloaded file.
|
||||
|
||||
The decompression and copy of the image file takes some time to complete and
|
||||
the –v option for xzcat displays the progress.
|
||||
|
||||
Once the image has been decompressed and copied to the USB drive, you can
|
||||
remove the USB drive from the system and move it to your target system.
|
||||
|
||||
|
||||
Install Clear Linux on your target system
|
||||
=========================================
|
||||
|
||||
The USB drive that was created in the previous step has been formatted as a
|
||||
UEFI boot device. Our target system has a hard drive installed containing a
|
||||
single primary partition. The target system needs a wired Internet connection
|
||||
with DHCP.
|
||||
|
||||
Follow these steps to install |CL| on the target system:
|
||||
|
||||
1. Insert the USB drive into an available USB slot.
|
||||
|
||||
2. Power on the system.
|
||||
|
||||
3. Open the system BIOS setup menu, normally by pressing the F2 key. Your
|
||||
BIOS setup menu entry point may vary.
|
||||
|
||||
4. In the setup menu, enable the UEFI boot and set the USB drive as the first
|
||||
option in the device boot order.
|
||||
|
||||
5. Save these settings and exit.
|
||||
|
||||
6. Reboot the target system and the |CL| Installer menu will start.
|
||||
|
||||
.. note::
|
||||
|
||||
Use the arrow keys, space bar, and enter key to navigate the menu of the
|
||||
|CL| Installer.
|
||||
|
||||
7. In this tutorial, we will enable telemetrics and select the `Automatic`
|
||||
installation type.
|
||||
|
||||
The primary drive to install |CL| onto is :file:`/dev/sdb` since the
|
||||
target system identifies the USB drive as :file:`/dev/sda`.
|
||||
|
||||
8. Follow the instructions to begin the installation.
|
||||
|
||||
The installation is completed in the following stages:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Reading configuration
|
||||
Validating configuration
|
||||
Creating partitions
|
||||
Creating file systems
|
||||
Setting up mount points
|
||||
Starting swupd. May take several minutes
|
||||
Cleaning up
|
||||
Successful installation
|
||||
|
||||
Once complete, an `<OK>` prompt appears in the dialog box, letting you know
|
||||
that you have successfully installed |CL| onto your system.
|
||||
|
||||
9. Press enter once the <OK> prompt appears. The following dialog box takes
|
||||
its place:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Successful installation, the system will be rebooted
|
||||
|
||||
<OK>
|
||||
|
||||
10. Press enter, remove the USB drive from the system, and the system will
|
||||
reboot running |CL|.
|
||||
|
||||
Clear Linux initial setup after installation
|
||||
============================================
|
||||
|
||||
Your newly installed |CL| boots on your target system and presents a full
|
||||
screen console requesting `Login:`. |CL| is designed to install with minimal
|
||||
software overhead. Therefore, some housekeeping and package installations
|
||||
must occur before you have a full-featured |CL| operating system.
|
||||
|
||||
Set up your root and user accounts
|
||||
----------------------------------
|
||||
|
||||
1. At the initial login prompt, enter: root
|
||||
2. Once you are prompted, enter a new password
|
||||
3. Re-enter the password to verify it.
|
||||
|
||||
You have set your root password and are logged in with root privileges.
|
||||
|
||||
The next step is to create a new user and set a password for
|
||||
that user:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
useradd <userid>
|
||||
passwd <userid>
|
||||
|
||||
Replace <userid> with the name of the user account you want to create.
|
||||
|
||||
Remain logged in as the root user because there are some other things to do
|
||||
before we can fully enable your new user space.
|
||||
|
||||
Software installation and updates
|
||||
---------------------------------
|
||||
|
||||
|CL| has a unique application and architecture to add and update applications
|
||||
and to perform system updates called software update utility or `swupd`.
|
||||
Software applications are installed as bundles using the command
|
||||
:command:`bundle-add`.
|
||||
|
||||
Next, we should install some useful applications using the software update
|
||||
utility. The `os-clr-on-clr` bundle installs the vast majority of
|
||||
applications useful to a system administrator or a developer. The bundle
|
||||
contains other bundles such as `sysadmin-basic`, `editors`, `c-basic`, `dev-
|
||||
utils-dev`, and other useful packages.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
swupd bundle-add os-clr-on-clr
|
||||
|
||||
.. note::
|
||||
|
||||
The image we installed may not be the latest version of |CL| available on
|
||||
the server. However, whenever the command
|
||||
:command:`swupd bundle-add <bundle>` runs, the OS is updated to the latest
|
||||
available version. Our website provides more `information about swupd`_.
|
||||
|
||||
We provide the full list of bundles and packages installed with the
|
||||
`os-clr-on-clr`_ bundle. Additionally, we have listed
|
||||
`all Clear Linux bundles`_, active or deprecated. Click any bundle on the
|
||||
list to view the manifest of the bundle.
|
||||
|
||||
Finish setting up your new user
|
||||
-------------------------------
|
||||
|
||||
Before logging off as root and logging into your new user account, we must
|
||||
enable the :command:`sudo` command for your new `<userid>`.
|
||||
|
||||
To be able to execute all applications with root privileges, we must add the
|
||||
`<userid>` to the `wheel group`_ and enable the wheel group in the
|
||||
:file:`/etc/sudoers` file.
|
||||
|
||||
1. To add `<userid>` to the wheel group, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
usermod -G wheel -a <userid>
|
||||
|
||||
2. To open the :file:`/etc/sudoers` file, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
vi /etc/sudoers
|
||||
|
||||
.. note::
|
||||
|
||||
Normally, we would use the visudo script to edit the :file:`/etc/sudoers`
|
||||
file to safely modify the contents of the file. In this instance, the file
|
||||
does not exist yet. Therefore, we create the initial instance of the file.
|
||||
|
||||
3. In the vi\* editor window, press the :kbd:`o` to open a new line.
|
||||
|
||||
4. Add the following line to the file:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
%wheel ALL=(ALL) ALL
|
||||
|
||||
5. To save the changes to the file and exit vi, press the :kbd:`ESC` key
|
||||
followed by the :kbd:`:` and :kbd:`x` keys.
|
||||
|
||||
.. important::
|
||||
|
||||
Creating the file logged as the root user keeps the permissions of the
|
||||
file with the root user.
|
||||
|
||||
Now, we can log out of root and into our new <userid>.
|
||||
|
||||
To log off as root, enter :command:`exit`.
|
||||
|
||||
The command should bring you back to the `Login:` prompt.
|
||||
|
||||
Enter your new `<userid>` and the password you created earlier.
|
||||
|
||||
You should now be in the home directory of `<userid>`. The bundle
|
||||
`os-clr-on-clr`_ contains the majority of applications that a developer or
|
||||
system administrator would want but it does not include a graphical user
|
||||
interface. The `os-utils-gui` bundle includes the XFCE graphical user
|
||||
interface.
|
||||
|
||||
To test the :command:`sudo` command and ensure we set it up correctly, we can
|
||||
install the XFCE :abbr:`GUI (graphical user interface)`.
|
||||
|
||||
To install XFCE using swupd, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo swupd bundle-add os-utils-gui
|
||||
|
||||
To start xfce, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
startx
|
||||
|
||||
**Congratulations!**
|
||||
|
||||
You have successfully installed |CL| on a bare metal system.
|
||||
|
||||
Additionally, you performed the following basic setup for your system:
|
||||
|
||||
* Setup of a root user.
|
||||
* Updated the OS to its most current version using `swupd`.
|
||||
* Installed the most common applications for system administrators and
|
||||
developers using bundles.
|
||||
* Setup of a new user.
|
||||
* Setup of `sudo` privileges for that new user.
|
||||
* Installed a GUI using those `sudo` privileges.
|
||||
|
||||
Next steps
|
||||
==========
|
||||
|
||||
With your system now running |CL| many paths are open for you.
|
||||
|
||||
We have created a :ref:`tutorial <web-server-install>` for setting up your
|
||||
|CL| system as a :abbr:`LAMP (Linux, Apache MySQL, PHP)` web sever.
|
||||
|
||||
Once you have setup your system as a web server, we recommend you try out our
|
||||
:ref:`tutorial on installing WordPress <wp-install>` to host your own
|
||||
CMS-based website on your |CL| system.
|
||||
|
||||
.. _`NUC6i5SYH product page`:
|
||||
http://www.intel.com/content/www/us/en/nuc/nuc-kit-nuc6i5syh.html
|
||||
|
||||
.. _`information about swupd`:
|
||||
https://clearlinux.org/documentation/swupdate_about_sw_update.html
|
||||
|
||||
.. _`os-clr-on-clr`:
|
||||
https://github.com/clearlinux/clr-bundles/blob/master/bundles/os-clr-on-clr
|
||||
|
||||
.. _`all Clear Linux bundles`:
|
||||
https://github.com/clearlinux/clr-bundles/tree/master/bundles
|
||||
|
||||
.. _`wheel group`:
|
||||
https://en.wikipedia.org/wiki/Wheel_(Unix_term)
|
||||
@@ -0,0 +1,37 @@
|
||||
.. _check-compatibility:
|
||||
|
||||
Check system compatibility with Clear Linux OS for Intel® Architecture
|
||||
######################################################################
|
||||
|
||||
If you’re unsure whether your system will be capable of running
|
||||
|CL|\* OS for Intel® Architecture, you can determine ahead of time by
|
||||
downloading and running the simple clear-linux-check-config.sh script locally
|
||||
on your target system if it is already running a Linux distribution.
|
||||
|
||||
This script is available in the current download directory at clearlinux.org
|
||||
and checks the hardware capabilities of your system to determine whether it
|
||||
will work with the latest release of |CL|. To run the clear-linux-
|
||||
check- config.sh script, enter the following commands on your target system:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
curl -O https://download.clearlinux.org/current/clear-linux-check-config.sh
|
||||
chmod +x clear-linux-check-config.sh
|
||||
./clear-linux-check-config.sh host
|
||||
|
||||
The script will print a list of test results similar to the output below. All
|
||||
items should return a 'SUCCESS' status and if it does, your target system
|
||||
fully supports installing and running |CL|.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Checking if host is capable of running |CL|\* OS for Intel®
|
||||
Architecture
|
||||
|
||||
SUCCESS: Intel CPU
|
||||
|
||||
SUCCESS: 64-bit CPU (lm)
|
||||
|
||||
SUCCESS: Streaming SIMD Extension v4.1 (sse4_1)
|
||||
|
||||
SUCCESS: EFI Firmware
|
||||
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 195 KiB |
|
After Width: | Height: | Size: 64 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
After Width: | Height: | Size: 167 KiB |
|
After Width: | Height: | Size: 181 KiB |
|
After Width: | Height: | Size: 169 KiB |
|
After Width: | Height: | Size: 194 KiB |
@@ -0,0 +1,391 @@
|
||||
.. _web-server-install:
|
||||
|
||||
Creating a Clear Linux based web server
|
||||
#######################################
|
||||
|
||||
Prerequisites
|
||||
=============
|
||||
|
||||
In order to create a web server using |CL| as the host OS your host
|
||||
system must be running |CL|. Therefore, this tutorial assumes you have
|
||||
already gone through the steps in :ref:`bare-metal-install`.
|
||||
|
||||
Before installing any new packages, update the |CL| OS with the
|
||||
console command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo swupd update
|
||||
|
||||
Creating a LAMP Server
|
||||
======================
|
||||
|
||||
A server with Linux\*, Apache\*, MySQL\*, and PHP\* installed is known as a
|
||||
LAMP server, allows you to set up a fully functional web server, and enables
|
||||
you to host your own website. This tutorial walks you through the process of
|
||||
creating a LAMP server by installing and configuring each component. In place
|
||||
of MySQL, we will be installing MariaDB which is a drop- in replacement for
|
||||
MySQL. Once the LAMP server component installations are complete, we add
|
||||
phpMyAdmin to manage your MariaDB databases.
|
||||
|
||||
Installing Apache
|
||||
=================
|
||||
|
||||
Apache is an open source HTTP web server application. It can run on several
|
||||
operating systems, including |CL|. Alternatively, you could install
|
||||
NGINX but this tutorial focuses on implementing an Apache server.
|
||||
Go to https://httpd.apache.org/ to learn more about it.
|
||||
|
||||
Install the web-server-basic bundle
|
||||
-----------------------------------
|
||||
|
||||
The web-server-basic bundle contains the packages needed to install the
|
||||
Apache software bundle on |CL|.
|
||||
|
||||
To install the bundle, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo swupd bundle-add web-server-basic
|
||||
|
||||
|
||||
To start the Apache service, enter the following commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo systemctl enable httpd.service
|
||||
sudo systemctl start httpd.service
|
||||
|
||||
|
||||
To verify that the Apache server application is running, go to your web
|
||||
browser and navigate to: http://localhost
|
||||
|
||||
If the service is running you will see the message “It works!” on your
|
||||
browser as shown in figure 1.
|
||||
|
||||
.. figure:: figures/web-server-install-1.png
|
||||
:alt: It works!
|
||||
:scale: 50%
|
||||
|
||||
Confirmation the Apache service is running.
|
||||
|
||||
The :file:`index.html` file is located in the :file:`/usr/share/httpd/htdocs`
|
||||
directory of your host system.
|
||||
|
||||
Installing PHP
|
||||
==============
|
||||
|
||||
With Apache installed, you can display static web pages. However, enabling
|
||||
PHP allows dynamic webpages to be generated and displayed. To add this
|
||||
functionality to your web server we need to install PHP5 on your system.
|
||||
|
||||
To get the php components, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo swupd bundle-add php-basic
|
||||
|
||||
To enable PHP, enter the following commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo systemctl enable php-fpm.service
|
||||
sudo systemctl start php-fpm.service
|
||||
sudo systemctl restart httpd.service
|
||||
|
||||
|
||||
After restarting the Apache service, we can test our PHP installation.
|
||||
|
||||
1. Create a file named :file:`phpinfo.php` in the
|
||||
:file:`/usr/share/httpd/htdocs/` directory using your favorite editor.
|
||||
|
||||
2. Add the following line to the file:
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
<?PHP phpinfo() ?>
|
||||
|
||||
3. Go to http://localhost/phpinfo.php using your browser.
|
||||
|
||||
The PHP information screen should appear, see figure 2:
|
||||
|
||||
.. figure:: figures/web-server-install-2.png
|
||||
:alt: PHP information screen
|
||||
:width: 600
|
||||
|
||||
The PHP information screen.
|
||||
|
||||
If the PHP information screen is displayed, you have successfully installed
|
||||
the PHP components and are now ready to add your database application to
|
||||
complete your LAMP server implementation.
|
||||
|
||||
Installing MariaDB
|
||||
==================
|
||||
|
||||
Most web applications require a database to store their content. Therefore,
|
||||
we must install MariaDB to fulfill this need. MariaDB is a drop-in
|
||||
replacement for MySQL and is available in the database-basic |CL|
|
||||
bundle.
|
||||
|
||||
To install the database-basic bundle, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo swupd bundle-add database-basic
|
||||
|
||||
Once MariaDB is installed, we need to start the service and check its status.
|
||||
|
||||
To start MariaDB, enter the following commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo systemctl enable mariadb
|
||||
sudo systemctl start mariadb
|
||||
|
||||
To check the status of MariaDB, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo systemctl status mariadb
|
||||
|
||||
With the MariaDB service running, we can perform some basic security
|
||||
hardening.
|
||||
|
||||
To add a basic layer of security, enter the following command and answer the
|
||||
questions presented:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
mysql_secure_installation
|
||||
|
||||
.. note:: We have included the answers after each question.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Enter current password for root (enter for none):
|
||||
|
||||
In order to secure the MariaDB, we need the current password for the root
|
||||
user. For a newly installed MariaDB without a set root password, the
|
||||
password is blank. Just press enter to continue.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
OK, successfully used password, moving on...
|
||||
|
||||
Set root password? [Y/n]
|
||||
|
||||
.. _set-password:
|
||||
|
||||
Setting the root password ensures nobody can log into the MariaDB
|
||||
as a root user without the proper authorization.
|
||||
|
||||
To set a root password, type 'y'.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
New password:
|
||||
|
||||
Type the desired password for the root user.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Re-enter new password:
|
||||
|
||||
Re-type the desired password for the root user.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
Password updated successfully!
|
||||
Reloading privilege tables..
|
||||
... Success!
|
||||
|
||||
Remove anonymous users? [Y/n]
|
||||
|
||||
By default, a MariaDB installation has an anonymous user allowing anyone to
|
||||
log into MariaDB without a user account. This anonymous user is intended only
|
||||
for testing and for a smoother the installation.
|
||||
|
||||
To remove the anonymous user and make your database more secure, type 'y'.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
... Success!
|
||||
Disallow root login remotely? [Y/n]
|
||||
|
||||
Normally, root should only be allowed to connect from the 'localhost'.
|
||||
This ensures that someone cannot guess at the root password from the network.
|
||||
|
||||
To block any remote root login, type 'y'.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
... Success!
|
||||
Remove test database and access to it? [Y/n]
|
||||
|
||||
By default, MariaDB comes with a database named 'test' which anyone can
|
||||
access. This database is also intended only for testing and should be
|
||||
removed.
|
||||
|
||||
To remove the test database, type 'y'.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
- Dropping test database...
|
||||
... Success!
|
||||
- Removing privileges on test database...
|
||||
... Success!
|
||||
Reload privilege tables now? [Y/n]
|
||||
|
||||
Reloading the privilege tables ensures all changes made so far take effect
|
||||
immediately.
|
||||
|
||||
To reload the privilege tables, type 'y'.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
... Success!
|
||||
|
||||
Cleaning up...
|
||||
|
||||
All done! If you've completed all of the above steps, your MariaDB
|
||||
installation should now be secure.
|
||||
|
||||
Thanks for using MariaDB!
|
||||
|
||||
The MariaDB installation is complete and we can now install phpMyAdmin to
|
||||
manage the databases.
|
||||
|
||||
Installing phpMyAdmin
|
||||
=====================
|
||||
|
||||
The web-based tool phpMyAdmin is a straight-forward way to manage MySQL or
|
||||
MariaDB databases. Visit https://www.phpmyadmin.net for the complete
|
||||
discussion regarding phpMyAdmin, its documentation, the latest downloads, and
|
||||
other useful information.
|
||||
|
||||
This tutorial uses the latest English version of phpMyAdmin to install it on
|
||||
our |CL| host system.
|
||||
|
||||
1. Download the :file:`phpMyAdmin-<version>-english.tar.gz` file to your
|
||||
:file:`~/Downloads` directory. Here, <version> refers to the current
|
||||
version available at https://www.phpmyadmin.net/downloads.
|
||||
|
||||
.. note:: This example downloads and uses version 4.6.4 so we will be
|
||||
downloading the file
|
||||
https://www.phpmyadmin.net/downloads/phpMyAdmin-4.6.4-english.tar.gz into
|
||||
our Downloads directory.
|
||||
|
||||
2. Once the file has been successfully downloaded and verified, uncompress
|
||||
the file and directories into the apache web server document root
|
||||
directory. Use the following commands:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
cd /usr/share/httpd/htdocs
|
||||
sudo tar –xzvf ~/Downloads/phpMyAdmin-4.6.4-english.tar.gz
|
||||
|
||||
3. To keep things simple, rename the newly created
|
||||
:file:`phpMyAdmin-4.6.4-english` directory to :file:`phpMyAdmin` with the
|
||||
following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo mv phpMyAdmin-4.6.4-english phpMyAdmin
|
||||
|
||||
Using phpMyAdmin to Manage Databases
|
||||
------------------------------------
|
||||
|
||||
If you have successfully installed all of the components for your LAMP
|
||||
server, you should be able to point your browser to
|
||||
http://localhost/phpMyAdmin and see the screen shown in figure 3 in your
|
||||
browser window.
|
||||
|
||||
.. figure:: figures/web-server-install-3.png
|
||||
:alt: phpMyAdmin login page
|
||||
:width: 600
|
||||
|
||||
The `phpMyAdmin` login page after successful installation.
|
||||
|
||||
|
||||
Log in with your root userid and the password you set up when you ran the
|
||||
:ref:`mysql_secure_installation command <set-password>`. Enter your
|
||||
credentials and select :guilabel:`Go` to log in:
|
||||
|
||||
Once logged in the main phpMyAdmin page is displayed as shown on figure 4:
|
||||
|
||||
.. figure:: figures/web-server-install-4.png
|
||||
:alt: phpMyAdmin dashboard
|
||||
:width: 600
|
||||
|
||||
The `phpMyAdmin` dashboard after successful login.
|
||||
|
||||
Our next step is to set up our first database. For example, we can call
|
||||
our new database WordPress.
|
||||
|
||||
1. Select the :guilabel:`Databases` tab in the phpMyAdmin main screen to go
|
||||
to the Databases page. Figure 5 shows the databases tab.
|
||||
|
||||
.. figure:: figures/web-server-install-5.png
|
||||
:alt: Databases tab
|
||||
:width: 600
|
||||
|
||||
The `Databases` tab of `phpMyAdmin`.
|
||||
|
||||
2. Enter 'Wordpress'. in the text field below the :guilabel:`Create database`
|
||||
label.
|
||||
|
||||
3. Pick the :guilabel:`utf8_unicode_ci` option from the collation drop-down
|
||||
menu beside the text field.
|
||||
|
||||
4. Press the :guilabel:`Create` button.
|
||||
|
||||
Once the database is created, we need to set up the user permissions.
|
||||
|
||||
1. Select the WordPress database in the left panel.
|
||||
|
||||
2. Select the :guilabel:`Privileges` tab. Figure 6 shows the contents of the
|
||||
tab.
|
||||
|
||||
.. figure:: figures/web-server-install-6.png
|
||||
:alt: Privileges tab
|
||||
:width: 600
|
||||
|
||||
The `Privileges` tab of `phpMyAdmin`
|
||||
|
||||
3. Click on :guilabel:`Add user account`
|
||||
|
||||
.. figure:: figures/web-server-install-7.png
|
||||
:alt: User accounts tab
|
||||
:width: 600
|
||||
|
||||
The `User accounts` tab showing all the required information entered
|
||||
in the next steps.
|
||||
|
||||
4. Enter the following information in the corresponding fields:
|
||||
|
||||
User name: wordpressuser
|
||||
|
||||
Password: wp-example
|
||||
|
||||
Re-type: wp-example
|
||||
|
||||
5. In the Database for user account section, select the option
|
||||
:guilabel:`Grant all privileges on database “WordPress”.`
|
||||
|
||||
6. At the bottom of the page and select :guilabel:`Go`.
|
||||
|
||||
If successful, you should see the screen shown in figure 8:
|
||||
|
||||
.. figure:: figures/web-server-install-8.png
|
||||
:alt: User added successfully
|
||||
:width: 600
|
||||
|
||||
The user **wordpressuser** was added successfully.
|
||||
|
||||
Congratulations!
|
||||
|
||||
You have now created a fully functional LAMP server along with a WordPress-
|
||||
ready database using |CL|.
|
||||
|
||||
As a next step, you could :ref:`create a WordPress server <wp-install>`
|
||||
and present it to the world.
|
||||
@@ -0,0 +1,27 @@
|
||||
.. _wordpress:
|
||||
|
||||
WordPress\* use case tutorial
|
||||
#############################
|
||||
|
||||
Welcome to our WordPress use case tutorial. The objective of the tutorial is
|
||||
to guide you from bare metal to a fully realized WordPress website using
|
||||
|CLOSIA|.
|
||||
|
||||
For your convenience, we have split this tutorial in three different
|
||||
sections. If your system is already running |CL|, you can skip the bare metal
|
||||
installation tutorial. Similarly, you can skip ahead to the WordPress
|
||||
tutorial if you have already have a |CL| based :abbr:`LAMP (Linux, Apache,
|
||||
MySQL, PHP)` web server.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
bare-metal-install/bare-metal-install.rst
|
||||
web-server-install/web-server-install.rst
|
||||
wp-install/wp-install.rst
|
||||
|
||||
.. important::
|
||||
|
||||
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.
|
||||
|
After Width: | Height: | Size: 72 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 68 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 88 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 205 KiB |
|
After Width: | Height: | Size: 953 KiB |
@@ -0,0 +1,231 @@
|
||||
.. _wp-install:
|
||||
|
||||
Creating a Clear Linux WordPress* server
|
||||
########################################
|
||||
|
||||
Prerequisites
|
||||
=============
|
||||
|
||||
This tutorial assumes you have already
|
||||
:ref:`installed Clear Linux on a bare metal system <bare-metal-install>`
|
||||
and that you have :ref:`set up a LAMP web server <web-server-install>`.
|
||||
|
||||
Additionally, all the steps on this tutorial were tested using a NUC6i5SYH
|
||||
Intel® NUC. Visit the `NUC6i5SYH product page`_ for detailed information.
|
||||
|
||||
Before installing any new packages, update the |CL| OS with the
|
||||
console command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo swupd update
|
||||
|
||||
|
||||
Creating a WordPress server
|
||||
===========================
|
||||
|
||||
This tutorial walks you through the process of installing the WordPress
|
||||
components on your |CL| LAMP server. At the end of the
|
||||
:ref:`web server tutorial <web-server-install>`, we created the initial
|
||||
WordPress MySQL database `WordPress` using phpMyAdmin\* and MariaDB\*.
|
||||
With the LAMP server up and running, we can add the WordPress components
|
||||
needed to host a WordPress website on your host system.
|
||||
|
||||
Throughout this tutorial we will reference your website name as
|
||||
<your_website>. There are numerous articles available on-line regarding how
|
||||
to name your website and acquire the necessary certificates. Those tasks are
|
||||
beyond the scope of this tutorial.
|
||||
|
||||
There are also several actions you can take to harden your website from
|
||||
attacks. The security of your website and the data it contains are complex
|
||||
and ever-evolving tasks. They should be at the top of your to do list 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 look into it.
|
||||
|
||||
Installing WordPress
|
||||
--------------------
|
||||
|
||||
The folks at WordPress have created a `step-by-step guide`_ to install
|
||||
WordPress quickly and easily. We are following this procedure very closely.
|
||||
|
||||
We are setting up a WordPress blog which can be accessed at:
|
||||
|
||||
http://<your_website>/blog
|
||||
|
||||
To accomplish this setup, we must put the WordPress components in the
|
||||
:file:`/usr/share/httpd/htdocs/blog` directory.
|
||||
|
||||
Let us get started:
|
||||
|
||||
|
||||
1. To move to the top-level of the website’s root directory, enter the
|
||||
following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
cd /usr/share/httpd/htdocs
|
||||
|
||||
2. To download the latest version of WordPress, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo curl -O https://wordpress.org/latest.tar.gz
|
||||
|
||||
3. To extract the all the files and directories from the downloaded file,
|
||||
enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo tar –xzvf latest.tar.gz
|
||||
|
||||
4. To rename the top-level WordPress directory to “blog”, enter the following
|
||||
command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo mv wordpress blog
|
||||
|
||||
5. To remove the downloaded tar file, enter the following command:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
sudo rm latest.tar.gz
|
||||
|
||||
Setting up WordPress
|
||||
--------------------
|
||||
|
||||
With the WordPress components loaded into the
|
||||
:file:`/usr/share/httpd/htdocs/blog` directory, we can set everything up.
|
||||
|
||||
Instead of editing the :file:`wp_config.php` file manually, we are using the
|
||||
web-based configuration tool to setup the database name and user. We created
|
||||
both in the :ref:`web server tutorial <web-server-install>`. In your browser,
|
||||
go to: http://<your_website>/blog/wp-admin/install.php.
|
||||
|
||||
Your screen should look like figure 1:
|
||||
|
||||
.. figure:: figures/wp-install-1.png
|
||||
:alt: WordPress language selection
|
||||
:width: 600
|
||||
|
||||
WordPress language selection screen.
|
||||
|
||||
Select :guilabel:`English` for the language and click the
|
||||
:guilabel:`Continue` button.
|
||||
|
||||
The WordPress installation continues until the welcome screen shown in figure
|
||||
2 appears:
|
||||
|
||||
.. figure:: figures/wp-install-2.png
|
||||
:alt: WordPress welcome screen
|
||||
:width: 600
|
||||
|
||||
WordPress welcome screen.
|
||||
|
||||
Click the :guilabel:`Let’s go!` button to enter the information.
|
||||
|
||||
Enter the database name, username, and password we used when creating the
|
||||
database:
|
||||
|
||||
Database name: WordPress
|
||||
|
||||
Database username: wordpressuser
|
||||
|
||||
Database password: wp-example
|
||||
|
||||
Enter the following values for the database host and the table prefix:
|
||||
|
||||
Database host: localhost
|
||||
|
||||
Table prefix: wp\_
|
||||
|
||||
Figure 3 shows the filled out fields.
|
||||
|
||||
.. figure:: figures/wp-install-3.png
|
||||
:alt: Database connection details
|
||||
:width: 600
|
||||
|
||||
These details are needed for WordPress to connect to the database.
|
||||
|
||||
.. note::
|
||||
|
||||
When you enter your password into the password field, it will be in clear
|
||||
text and not asterisks.
|
||||
|
||||
After entering all the data for accessing your database, click the
|
||||
:guilabel:`Submit` button.
|
||||
|
||||
Figure 4 shows the following screen letting you know the communication
|
||||
between WordPress and your database has been successfully set up.
|
||||
|
||||
.. figure:: figures/wp-install-4.png
|
||||
:alt: Successful database connection.
|
||||
:width: 600
|
||||
|
||||
This screen shows WordPress was able to connect to the MySQL database.
|
||||
|
||||
Click the :guilabel:`Run the install` button.
|
||||
|
||||
Let the installer run until WordPress is fully installed on your system.
|
||||
|
||||
Once the installation is completed, you can name your blog and create a
|
||||
Wordpress username and password, see figure 5.
|
||||
|
||||
.. figure:: figures/wp-install-5.png
|
||||
:alt: WordPress user creation
|
||||
:width: 600
|
||||
|
||||
Provide WordPress the needed information to create a site and a user
|
||||
with the permissions to change it.
|
||||
|
||||
.. tip::
|
||||
|
||||
You can copy the password to log in faster.
|
||||
|
||||
Enter all the required information and click the
|
||||
:guilabel:`Install WordPress` button.
|
||||
|
||||
Once the installation is complete, the initial login screen appears, see
|
||||
figure 6:
|
||||
|
||||
.. figure:: figures/wp-install-6.png
|
||||
:alt: WordPress login
|
||||
:width: 600
|
||||
|
||||
The WordPress login screen.
|
||||
|
||||
Enter your WordPress username and password.
|
||||
Check the :guilabel:`Remember me` checkbox, to save your credentials.
|
||||
Click :guilabel:`Log in`.
|
||||
|
||||
Figure 7 shows the WordPress dashboard after a successful login:
|
||||
|
||||
.. figure:: figures/wp-install-7.png
|
||||
:alt: WordPress Dashboard
|
||||
:width: 600
|
||||
|
||||
The WordPress dashboard appears after you log in successfully.
|
||||
|
||||
You are ready to go!
|
||||
|
||||
To check out your blog as it is seen by the outside world, enter:
|
||||
http://<your_website>/blog on your browser. Figure 8 shows the result:
|
||||
|
||||
.. figure:: figures/wp-install-8.png
|
||||
:alt: WordPress blog
|
||||
:width: 600
|
||||
|
||||
The final result is the fully realized 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 |CLOSIA|!
|
||||
|
||||
.. _`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
|
||||