Actions

Install/2-0/ServerPackages: Difference between revisions

From Convention Master Documentation

No edit summary
(update to mysql 8 and php 8)
 
Line 5: Line 5:


= Installing Software on the Server =
= Installing Software on the Server =
'''''Note: This is not a comprehensive guide on how to set up a properly secured server for production. Please look into and take steps to harden a production server, such as setting up the firewall and proper sshd settings.'''''


This section of the guide will walk you through the configuration of a server running Ubuntu Server 22.04 LTS, on which Convention Master can run. If your server is not yet installed, you can follow the official Ubuntu guide to do so:
This section of the guide will walk you through the configuration of a server running Ubuntu Server 22.04 LTS, on which Convention Master can run. If your server is not yet installed, you can follow the official Ubuntu guide to do so:
Line 33: Line 36:


'''MySQL 8.0'''
'''MySQL 8.0'''
Currently several people are running MySQL 8.0, and not having any issues at all. We are curently still "testing" 8.0 and probably will continue to classify as "testing". If you would prefer to use MySQL 5.7 see the instructions below, otherwise feel free to run 8.0
Currently, MySQL 8.0.x is the recommended version for Convention Master.
 
To install the MySQL database server software, run the following command:
<syntaxhighlight lang="bash">
    sudo apt install mysql-server
    sudo systemctl start mysql.service
</syntaxhighlight>
 


'''MySQL 5.7'''
You will need to take some extra steps to get the user accounts and special settings Convention Master needs set up.  
With the server restarted, we will prepare your server to install MySQL 5.7, which is not available on Ubuntu 22.04 LTS from either the default Ubuntu or MySQL repositories. As a result, we need to manually configure where to get these packages.


Use the following command to get into the MySQL prompt
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 5072E1F5
     sudo mysql
    sudo echo 'deb http://repo.mysql.com/apt/ubuntu bionic mysql-5.7' | sudo tee /etc/apt/sources.list.d/mysql.list
    sudo apt update
</syntaxhighlight>
</syntaxhighlight>




'''NOTE:''' We are aware that official support from MySQL for version 5.7 ends in October 2023. We have run Convention Master on MySQL 8.0 in a number of scenarios without incident, however we have not yet completed specific testing on 8.0 in order to make it our supported version. We expect to have this testing completed by the release of CM v11.
While in the MySQL prompt type the following commands. Note: replace your_new_mysql_root_password with your own unique password that you make sure you don't forget.
<syntaxhighlight lang="MySQL">
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_mysql_root_password';
    exit;
</syntaxhighlight>
 


With MySQL configured, you can use the following command to install all the packages a standard Convention Master setup needs.
This will make sure you don't get locked out by the next step. If you need to get back into the MySQL prompt in the future, you will use this command "mysql -u root -p" and enter the password you just set.


Next we should take some basic steps to secure the MySQL server. Run the following command to start a wizard that will walk you through some changes to your MySQL server.
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     sudo apt install -y php8.1 php8.1-cli php8.1-curl php8.1-gd php8.1-mysql php8.1-mbstring php8.1-intl
     sudo mysql_secure_installation
    subversion ntp nano joe apache2 libapache2-mod-php7.4 bind9 bind9utils samba html2ps
    htmldoc mysql-client=5.7* mysql-server=5.7* mcrypt python3-pil curl
</syntaxhighlight>
</syntaxhighlight>




'''PHP 7.x:''' Convention Master 10.x will technically run on PHP 7.x. However, these versions of PHP are no longer supported by Zend, so we highly recommend immediately upgrading your server to PHP 8.x for best security and compatibility. Convention Master will cease supporting PHP 7.x as of version 11, currently under development at time of writing.
* When it starts, it will ask you for your MySQL root password. This will be the same one you set above.  
* It will ask if you want to enable the VALIDATE PASSWORD COMPONENT - enter N
* It will ask if you want to change your root password - you can say no since you already set a password
* From there, you can press Y and then ENTER to accept the defaults for all the subsequent questions. This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MySQL immediately respects the changes you have made.
 
Once the script completes, MySQL is now installed. You will need to make some configuration changes to properly run Convention Master which will be covered in step 3.2


Finally, let's go ahead and run the wizard to properly secure your new MySQL installation:
With MySQL configured, you can use the following command to install all the packages a standard Convention Master setup needs.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
     sudo mysql_secure_installation
     sudo apt install -y php8.1 php8.1-cli php8.1-curl php8.1-gd php8.1-mysql php8.1-mbstring php8.1-intl
    subversion ntp nano joe apache2 libapache2-mod-php8.1 html2ps
    htmldoc mcrypt python3-pil curl
</syntaxhighlight>
</syntaxhighlight>

Latest revision as of 19:02, 6 October 2023

<<Previously: 1.0 - Pre-Requisites

Installing Software on the Server

Note: This is not a comprehensive guide on how to set up a properly secured server for production. Please look into and take steps to harden a production server, such as setting up the firewall and proper sshd settings.


This section of the guide will walk you through the configuration of a server running Ubuntu Server 22.04 LTS, on which Convention Master can run. If your server is not yet installed, you can follow the official Ubuntu guide to do so:

https://tutorials.ubuntu.com/tutorial/tutorial-install-ubuntu-server

Note: Convention Master can run on any system meeting the Apache/PHP/MySQL requirement, but we will provide documentation only for Ubuntu. If you wish to use another operating system, such as CentOS or Windows, be aware that some of the steps in this guide may not apply, may have to be modified in order to work, or additional steps may be required. Convention Master can only guarantee official support for the Ubuntu Server OS.


Configure Server

Once your server's operating system is installed, we can begin installing the packages you will need to run Convention Master. Log in as the user you created during installation (or any user with sudo rights), and input the following commands.

    sudo apt update
    sudo apt dist-upgrade -y


These will ensure your server has the very latest versions of its available packages and kernel. With those done, run...

    sudo reboot


...to restart the server.

MySQL 8.0 Currently, MySQL 8.0.x is the recommended version for Convention Master.

To install the MySQL database server software, run the following command:

    sudo apt install mysql-server
    sudo systemctl start mysql.service


You will need to take some extra steps to get the user accounts and special settings Convention Master needs set up.

Use the following command to get into the MySQL prompt

    sudo mysql


While in the MySQL prompt type the following commands. Note: replace your_new_mysql_root_password with your own unique password that you make sure you don't forget.

    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_mysql_root_password';
    exit;


This will make sure you don't get locked out by the next step. If you need to get back into the MySQL prompt in the future, you will use this command "mysql -u root -p" and enter the password you just set.

Next we should take some basic steps to secure the MySQL server. Run the following command to start a wizard that will walk you through some changes to your MySQL server.

    sudo mysql_secure_installation


  • When it starts, it will ask you for your MySQL root password. This will be the same one you set above.
  • It will ask if you want to enable the VALIDATE PASSWORD COMPONENT - enter N
  • It will ask if you want to change your root password - you can say no since you already set a password
  • From there, you can press Y and then ENTER to accept the defaults for all the subsequent questions. This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MySQL immediately respects the changes you have made.

Once the script completes, MySQL is now installed. You will need to make some configuration changes to properly run Convention Master which will be covered in step 3.2

With MySQL configured, you can use the following command to install all the packages a standard Convention Master setup needs.

    sudo apt install -y php8.1 php8.1-cli php8.1-curl php8.1-gd php8.1-mysql php8.1-mbstring php8.1-intl
    subversion ntp nano joe apache2 libapache2-mod-php8.1 html2ps
    htmldoc mcrypt python3-pil curl