.. Reminder for header structure:				
	Parts (H1)			    : #################### with overline
	Chapters (H2)		    : ******************** with overline
	Sections (H3)		    : ====================
	Subsections (H4)	  : --------------------
	Subsubsections (H5) : ^^^^^^^^^^^^^^^^^^^^
	Paragraphs (H6)		  : """""""""""""""""""""
.. meta::
  :description: Installing WAPT Server on CentOS7
  :keywords: WAPT, installing, CentOS7
.. |date| date::
.. role:: raw-html(raw)
  :format: html
#################################
Installing WAPT Server on CentOS7
#################################
.. _base_centos_server_install:
*************************************
Setting up the CentOS / RedHat server
*************************************
In order to install a fresh :raw-html:`CentOS7`
machine (virtual or physical) please refer to official
`CentOS documentation `_.
This documentation is also valid for Redhat7.
.. warning::
  * Install **64bit** version.
  * Install the server without the graphical user interface.
.. danger::
  From WAPT Server :program:`Nginx` is the **ONLY** supported web server.
  **Apache on Linux is no longer supported in WAPT**.
Configuring network parameters
==============================
.. include:: wapt-resources/linux-server-naming.txt
Configuring the name of WAPT Server
===================================
.. hint::
  The short name of the WAPT Server must not be longer than 15 characters
  (the limit is due to *sAMAccountName* restriction in Active Directory).
The name of the WAPT Server must be a :abbr:`FQDN (Fully Qualified Domain Name)`,
that is to say it has both the server name and the DNS suffix.
* Modify the :file:`/etc/hostname` file and write the :term:`FQDN` of the server.
.. code-block:: bash
  # /etc/hostname of the waptserver
  srvwapt.mydomain.lan
* Configure the :file:`/etc/hosts` file, be sure to put both
  the :term:`FQDN` and the short name of the server.
.. code-block:: bash
  # /etc/hosts of the waptserver
  127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
  ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
  10.0.0.10   srvwapt.mydomain.lan srvwapt
.. hint::
  * On the line defining the DNS server IP address, be sure to have the IP
    of the server (not 127.0.0.1), then the :term:`FQDN`, then the short name.
  * Do not change the line with :code:`localhost`.
Configuring the IP address of the WAPT Server
=============================================
* Modify the :file:`/etc/sysconfig/network-scripts/ifcfg-eth0` file
  and define a static IP address. The name of the file can be different,
  like :file:`ifcfg-ens0` for example.
.. code-block:: bash
  # /etc/sysconfig/network-scripts/ifcfg-eth0 of the WAPT server
  TYPE="Ethernet"
  BOOTPROTO="static"
  NAME="eth0"
  ONBOOT="yes"
  IPADDR=10.0.0.10
  NETMASK=255.255.255.0
  GATEWAY=10.0.0.254
  DNS1=10.0.0.1
  DNS2=10.0.0.2
* Apply the network configuration by rebooting the machine
  with a :code:`reboot`.
.. code-block:: bash
  reboot
* If it has not already been done, :ref:`create the DNS entries
  for the WAPT Server ` in the :term:`Organization` Active Directory
  or on your DNS server.
* After reboot, configure the system language in English in order to have
  non-localized logs for easier searching of common errors.
.. code-block:: bash
  localectl set-locale LANG=en_US.utf8
  localectl status
* Check that the machine clock is on time (with NTP installed),
  and that SELinux and the firewall are enabled.
.. code-block:: bash
  yum list installed | grep ntp
  service ntpd status
  date
  sestatus
  systemctl status firewalld
.. hint::
  If the NTP package is not installed.
  .. code-block:: bash
    yum install ntp -y
    systemctl enable ntpd.service
    systemctl start ntpd
* Update CentOS and set up the :abbr:`EPEL (Extra Packages
  for Enterprise Linux)` repository.
.. code-block:: bash
  yum update
  yum install epel-release wget sudo -y
The server is now ready. You may now go on to the next step
and :ref:`install WAPT on your CentOS/ RedHat `.
.. attention::
  The upgrade procedure is different from installation. For upgrade, please
  refer to :ref:`Upgrading the WAPT Server `.
.. _install_wapt_centos:
Installing the WAPT Server runs a few steps:
* Configuring the repositories.
* Installing additional Linux packages.
* Installing and provisioning the PostgreSQL database.
* Post-configuring the WAPT server.
**************************
Configuring RPM repository
**************************
The configuration of repositories for **WAPT Enterprise**
and **WAPT Discovery** Edition differs. **Make sure to choose the right one!**
Discovery
=========
.. important::
  Follow this procedure for getting the right packages
  for the WAPT **Discovery** Edition.
  For WAPT **Enterprise** Edition please refer to the next block.
.. note::
  Not Available as of |date|.
  WAPT Discovery will be released later. For the free version,
  refer to wapt-1.8 documentation https://www.wapt.fr/en/doc-1.8/
Enterprise
==========
.. important::
  **Follow this procedure for getting the right packages
  for the WAPT Enterprise** Edition.
  For WAPT **Discovery** Edition please refer to the previous block.
  To access WAPT **Enterprise** resources, you must use the username
  and password provided by our sales department.
* Adding Tranquil IT's repository.
  .. hint:: 
            
    Replace **user** and **password** to access WAPT Enterprise repository, with those provided by our sales department.
  .. code-block:: bash
    cat > /etc/yum.repos.d/wapt.repo <`!!