Computer, telephone
and mobile phone
systems specialists
Telephone: +44 208 292 1691 (English or Japanese speeker)
Telephone: +44 870 392 5969 (Japanese speaker)
Telephone: 050 5327 8990 (Domestic Japan)
Email: contact@ukuniversalsupport.com
English   

日本語     
2019063002 Magento Upgrade

Magento upgrade in Centos 7.


Update Magento from 2.2.4 to 2.3.2.

Refer https://www.goivvy.com/blog/magento-2-upgrade for the basic knowledge.

If your are a professional engineer, keep the seLinux mode ENFORCED. This example gives some advices to keep seLinux enforced.

優秀な技術者を目指すなら、seLinuxはOnのままね。


==== php7.3 ====
# yum install http://rpms.famillecollet.com/enterprise/remi-release-7.rpm

# yum-config-manager --disable remi-php54
# yum-config-manager --enable remi-php73
yum install php php-intl php-common php-mbstring php-imap php-cli php-soap php-process php-mysqlnd php-gd php-json php-zip php-xml

# vi /etc/php.ini
max_execution_time = 600
max_input_time = 600
memory_limit = 512M

default_charset = "UTF-8"

iconv.internal_encoding = "UTF-8"
iconv.output_encoding = "UTF-8"

mbstring.language = Japanese If you mainly use Japanese language.
mbstring.internal_encoding = "UTF-8"
mbstring.http_input = auto
mbstring.http_output = "UTF-8"
mbstring.encoding_translation = On
mbstring.detect_order = auto
mbstring.substitute_character = none
mbstring.func_overload = 0
mbstring.strict_detection = On


==== apache ====
# yum install httpd mod_php mod_ssl

# vi /etc/httpd/conf/httpd.conf
Please configure yourself.


# vi /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/Server.cert.pem

SSLCertificateKeyFile /etc/Server.PrivateKey.NoPassPhrase.pem

SSLCACertificateFile /etc/CA.cert.pem

SSLVerifyClient require
SSLVerifyDepth 10

SSLCARevocationCheck chain
SSLCARevocationFile /etc/crl.pemReject resigned staffs by Certificate Revocation List.


==== Z-push ====
In the following example, NextCloud is used for a Calender and an AddressBook.
# setsebool -P httpd_can_sendmail 1 This allow https to send email.

# vi /etc/yum.repos.d/z-push.repo
[z-push]
name=Z-Push noarch Enterprise Linux 7 - $basearch
baseurl=http://repo.z-hub.io/z-push:/final/RHEL_7
failovermethod=priority
enabled=1
gpgcheck=0

# yum install z-push-common z-push-config-apache z-push-backend-caldav z-push-backend-carddav z-push-backend-combined z-push-backend-imap z-push-ipc-memcached z-push-ipc-sharedmemory

# vi /etc/httpd/conf.d/z-push.conf
DefaultLanguage ja Add to the bottom.

The original Z-push codes have the issue when a login name is different from an email address. Therefore, fix some codes.
# vi /usr/share/z-push/backend/imap/imap.php
private function settingsUserInformation(&$userinformation) {
$userinformation->Status = SYNC_SETTINGSSTATUS_USERINFO_SUCCESS;
if (Request::GetProtocolVersion() >= 14.1) {
$account = new SyncAccount();
$emailaddresses = new SyncEmailAddresses();
$emailaddresses->smtpaddress[] = $this->username;
$emailaddresses->primarysmtpaddress = $this->username;
$account->emailaddresses = $emailaddresses;
$userinformation->accounts[] = $account;
}
// UKUS else {
// UKUS $userinformation->emailaddresses[] = $this->username;
// UKUS }
return true;
}

# vi lib/default/backend.php
if ($settings instanceof SyncUserInformation) {
$settings->Status = SYNC_SETTINGSSTATUS_SUCCESS;
if (Request::GetProtocolVersion() >= 14.1) {
$account = new SyncAccount();
$emailaddresses = new SyncEmailAddresses();
$emailaddresses->smtpaddress[] = ZPush::GetBackend()->GetUserDetails(Request::GetUser())['emailaddress'];
$emailaddresses->primarysmtpaddress = ZPush::GetBackend()->GetUserDetails(Request::GetUser())['emailaddress'];
$account->emailaddresses = $emailaddresses;
$settings->accounts[] = $account;
}
else {
// UKUS $settings->emailaddresses = array(ZPush::GetBackend()->GetUserDetails(Request::GetUser())['emailaddress']);
}

// UKUS $settings->emailaddresses = array(ZPush::GetBackend()->GetUserDetails(Request::GetUser())['emailaddress']);

}
if ($settings instanceof SyncRightsManagementTemplates) {
$settings->Status = SYNC_COMMONSTATUS_IRMFEATUREDISABLED;
}
return $settings;

# vi /etc/z-push/z-push.conf.php
define('TIMEZONE', 'UTC');

define('SCRIPT_TIMEOUT', 120);

define('LOGBACKEND', 'syslog');
define('LOGAUTHFAIL', true);
// define('LOGFILEDIR', '/var/log/z-push/'); As selinux does not allow a direct update of a file under /var/log, syslog should be used to avoid the issue.
// define('LOGFILE', LOGFILEDIR . 'z-push.log');
// define('LOGERRORFILE', LOGFILEDIR . 'z-push-error.log');
define('LOG_SYSLOG_FACILITY', LOG_MAIL);

define('SYNC_FILTERTIME_MAX', SYNC_FILTERTYPE_3MONTHS);

define('SYNC_MAX_ITEMS', 50);

define('BACKEND_PROVIDER', 'BackendCombined');

# vi /etc/z-push/combined.conf.php
public static function GetBackendCombinedConfig() {
//use a function for it because php does not allow
//assigning variables to the class members (expecting T_STRING)
return array(
//the order in which the backends are loaded.
//login only succeeds if all backend return true on login
//sending mail: the mail is sent with first backend that is able to send the mail
'backends' => array(
'i' => array(
'name' => 'BackendIMAP',
),
'c' => array(
'name' => 'BackendCalDAV',
),
'd' => array(
'name' => 'BackendCardDAV',
),
/*
'z' => array(
'name' => 'BackendKopano',
),
'm' => array(
'name' => 'BackendMaildir',
),
'l' => array(
'name' => 'BackendLDAP',
),
'v' => array(
'name' => 'BackendVCardDir',
),
*/
'delimiter' => '/',
//force one type of folder to one backend
//it must match one of the above defined backends
'folderbackend' => array(
SYNC_FOLDER_TYPE_INBOX => 'i',
SYNC_FOLDER_TYPE_DRAFTS => 'i',
SYNC_FOLDER_TYPE_WASTEBASKET => 'i',
SYNC_FOLDER_TYPE_SENTMAIL => 'i',
SYNC_FOLDER_TYPE_OUTBOX => 'i',
SYNC_FOLDER_TYPE_TASK => 'c',
SYNC_FOLDER_TYPE_APPOINTMENT => 'c',
SYNC_FOLDER_TYPE_CONTACT => 'd',
SYNC_FOLDER_TYPE_NOTE => 'c',
SYNC_FOLDER_TYPE_JOURNAL => 'c',
SYNC_FOLDER_TYPE_OTHER => 'i',
SYNC_FOLDER_TYPE_USER_MAIL => 'i',
SYNC_FOLDER_TYPE_USER_APPOINTMENT => 'c',
SYNC_FOLDER_TYPE_USER_CONTACT => 'd',
SYNC_FOLDER_TYPE_USER_TASK => 'c',
SYNC_FOLDER_TYPE_USER_JOURNAL => 'c',
SYNC_FOLDER_TYPE_USER_NOTE => 'c',
SYNC_FOLDER_TYPE_UNKNOWN => 'i',
),
//creating a new folder in the root folder should create a folder in one backend
'rootcreatefolderbackend' => 'i',
);
}

# vi /etc/z-push/imap.conf.php
define('IMAP_SERVER', '127.0.0.1'); // Solution to prevent the error messaged from appearing.
define('IMAP_FOLDER_CONFIGURED', true);
define('IMAP_FOLDER_INBOX', 'INBOX');
define('IMAP_FOLDER_SENT', 'Sent');
define('IMAP_FOLDER_DRAFT', 'Drafts');
define('IMAP_FOLDER_TRASH', 'Trash');
define('IMAP_FOLDER_SPAM', 'Junk');

// overwrite the "from" header with some value
// options:
// '' - do nothing, use the From header
// 'username' - the username will be set (usefull if your login is equal to your emailaddress)
// 'domain' - the value of the "domain" field is used
// 'sql' - the username will be the result of a sql query. REMEMBER TO INSTALL PHP-PDO AND PHP-DATABASE
// 'ldap' - the username will be the result of a ldap query. REMEMBER TO INSTALL PHP-LDAP!!
// '@mydomain.com' - the username is used and the given string will be appended
define('IMAP_DEFAULTFROM', '');

/* UKUS

// DSN: formatted PDO connection string
// mysql:host=xxx;port=xxx;dbname=xxx
// USER: username to DB
// PASSWORD: password to DB
// OPTIONS: array with options needed
// QUERY: query to execute
// FIELDS: columns in the query
// FROM: string that will be the from, replacing the column names with the values
define('IMAP_FROM_SQL_DSN', '');
define('IMAP_FROM_SQL_USER', '');
define('IMAP_FROM_SQL_PASSWORD', '');
define('IMAP_FROM_SQL_OPTIONS', serialize(array(PDO::ATTR_PERSISTENT => true))); //UKUS
define('IMAP_FROM_SQL_QUERY', "select first_name, last_name, mail_address from users where mail_address = '#username@#domain'");
define('IMAP_FROM_SQL_FIELDS', serialize(array('first_name', 'last_name', 'mail_address')));
define('IMAP_FROM_SQL_FROM', '#first_name #last_name <#mail_address>');
define('IMAP_FROM_SQL_FULLNAME', '#first_name #last_name');

UKUS */
/* UKUS

// SERVER: ldap server
// SERVER_PORT: ldap port
// USER: dn to use for connecting
// PASSWORD: password
// QUERY: query to execute
// FIELDS: columns in the query
// FROM: string that will be the from, replacing the field names with the values
define('IMAP_FROM_LDAP_SERVER', 'localhost');
define('IMAP_FROM_LDAP_SERVER_PORT', '389');
define('IMAP_FROM_LDAP_USER', 'cn=zpush,ou=servers,dc=zpush,dc=org');
define('IMAP_FROM_LDAP_PASSWORD', 'password');
define('IMAP_FROM_LDAP_BASE', 'dc=zpush,dc=org');
define('IMAP_FROM_LDAP_QUERY', '(mail=#username@#domain)');
define('IMAP_FROM_LDAP_FIELDS', serialize(array('givenname', 'sn', 'mail')));
define('IMAP_FROM_LDAP_FROM', '#givenname #sn <#mail>');
define('IMAP_FROM_LDAP_FULLNAME', '#givenname #sn');

UKUS */

# vi /etc/z-push/caldav.conf.php Using NextCloud for the calender.
define('CALDAV_PROTOCOL', 'http');
define('CALDAV_SERVER', '127.0.0.1');
define('CALDAV_PORT', '80');
define('CALDAV_PATH','/nextcloud/remote.php/dav/calendars/%u/');
define('CALDAV_PERSONAL', 'primary');

# vi /etc/z-push/carddav.conf.php Using NextCloud for the address book.
define('CARDDAV_PROTOCOL', 'http');
define('CARDDAV_SERVER', '127.0.0.1');
define('CARDDAV_PORT', '80');
define('CARDDAV_PATH', '/nextcloud/remote.php/dav/addressbooks/users/%u/');
define('CARDDAV_DEFAULT_PATH', '/nextcloud/remote.php/dav/addressbooks/users/%u/primary/');
// define('CARDDAV_GAL_PATH', '/caldav.php/%d/GAL/');
// define('CARDDAV_GAL_MIN_LENGTH', 5);

# vi /etc/logrotate.d/z-push.lr To clear seLinux audit, syslog is used.
#/var/log/z-push/*.log { <= Comment out all
# size 1k
# create 664 root z-push
# compress
# rotate 4
# su root z-push
#}

# chgrp -R z-push /etc/z-push To clear the seLinux audit.
# chcon -R system_u:object_r:httpd_sys_rw_content_t:s0 /etc/z-push To clear the seLinux audit.