AWSLinux4Magento: Difference between revisions

From Wiki RB4
 
(33 intermediate revisions by the same user not shown)
Line 4: Line 4:
==Creation==
==Creation==
* AWS Console -> EC2 -> Instances -> Launch Instance
* AWS Console -> EC2 -> Instances -> Launch Instance
* Select Magento Certified by Bitnami | 2.3.3-3 on Ubuntu 16.04 | 64-bit (x86) Amazon Machine Image (AMI) | Updated: 11/14/19 (see [https://aws.amazon.com/marketplace/pp/B00NNZTA6Y?ref=cns_srchrow here])
* Select in AWS Marketplace 'Magento Certified by Bitnami | 2.3.3-4 on Ubuntu 16.04 | 64-bit (x86) Amazon Machine Image (AMI) | Updated: 11/14/19 (see [https://aws.amazon.com/marketplace/pp/B00NNZTA6Y?ref=cns_srchrow here])'
* select t.large
* select t2.large
* add 20 GB with name /dev/sdb/
* add 20 GB with name /dev/sda1/
* confirm standard security group [[File:AWSMagentoMedium1.PNG|400px]]
* select security group 'Magento Certified by Bitnami ....' [[File:AWSMagentoMedium1.PNG|400px]]
* copied creation system log file in C:\Uwes\owncloud\documents\computer\AWSMediumLinux4Magento\CreationSystemLog.txt
* copied creation system log file from AWS Console -> Select Instance -> Instance Settings -> Get System Log in C:\Uwes\owncloud\documents\computer\AWSMediumLinux4Magento\CreationSystemLog.txt


The installation process will create several sub-directories under the <code>/opt/bitnami</code> directory:
The installation process will create several sub-directories under the <code>/opt/bitnami</code> directory:
Line 20: Line 20:
==General Data==
==General Data==
* Key Pairs: LinuxMedium4Magento (local ppk file in C:\Uwes\owncloud\documents\computer\AWSMediumLinux4Magento\)
* Key Pairs: LinuxMedium4Magento (local ppk file in C:\Uwes\owncloud\documents\computer\AWSMediumLinux4Magento\)
* SSH user: ubuntu or bitnami
* Availabity zone: us-west-2a
* General Password from system.log OcGHZBu6Bt0R
* users and its groups:
** root - root
** bitnami - bitnami, bitnami-admins, sudo, .... (see groups command)
** ubuntu - bitnami, bitnami-admins
* Putty configuratino: MediumLinux4Magento
* Putty configuratino: MediumLinux4Magento
* Instance ID i-03c59ca379643f8e8
* Instance ID i-03c59ca379643f8e8


==Bitnami AMI Documentation==
==Bitnami AMI Documentation==
* [https://docs.bitnami.com/aws/apps/magento/ Bitnami Magento Stack for AWS Cloud]
* [https://docs.bitnami.com/aws/apps/magento/ Bitnami Magento Stack for AWS Cloud -> Administration]
* [https://docs.bitnami.com/general/apps/magento/ Bitnami Magento Stack]
* [https://docs.bitnami.com/general/apps/magento/ Bitnami Magento Stack]
==ToDos==
* [https://lifehacker.com/geek-to-live-mirror-files-across-systems-with-rsync-196122 rsync]


==Applications==
==Applications==
Line 51: Line 59:
====Configuration====
====Configuration====
* see also [https://docs.bitnami.com/aws/apps/magento/administration/use-single-domain/ here]
* see also [https://docs.bitnami.com/aws/apps/magento/administration/use-single-domain/ here]
/opt/bitnami/apache2/conf/bitnami/bitnami.conf
  includes /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf
    includes /opt/bitnami/apps/phpmyadmin/conf/httpd-prefix.conf
    includes /opt/bitnami/apps/magento/conf/httpd-prefix.conf
      rewrite ...
      includes /opt/bitnami/apps/magento/conf/httpd-app.conf


===Magento===
===Magento===
Line 73: Line 87:


===PHP===
===PHP===
* configuration file in <code>/opt/bitnami/php/etc/php.ini</code>
  php -v
  php -v
  PHP 7.2.24 (cli) (built: Nov  8 2019 13:59:42) ( NTS )
  PHP 7.2.24 (cli) (built: Nov  8 2019 13:59:42) ( NTS )
  Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.24, Copyright (c) 1999-2018, by Zend Technologies
  Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.24, Copyright (c) 1999-2018, by Zend Technologies
====Debugging====
* [https://weitzman.github.io/blog/phpstorm-deployment here]
* decomment XDebug section in configuration file php.ini (see above) and restart Apache
sudo /opt/bitnami/ctlscript.sh restart apache
sudo /opt/bitnami/ctlscript.sh restart php-fpm
* enable debugging according to [https://www.rehanvdm.com/aws/debugging-php-with-xdebug-php-storm-and-aws-elastic-beanstalk/index.html here]


===PHPMyAdmin===
===PHPMyAdmin===
* enable remote access and not by recommended SSH tunnel by editing (see UH marker)
* enable remote access (and not by recommended SSH tunnel) by editing (see UH marker)
  /opt/bitnami/varnish/etc/varnish/magento.vcl
  /opt/bitnami/varnish/etc/varnish/magento.vcl
  /opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf
  /opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf
* restart varnish and apache
* restart [[AWSLinux4Magento#Varnish|Varnish]] and [[AWSLinux4Magento#Apache|Apache]]
* access by HTTPS with MySQL credentials 'root' and 'favmRC7s6yZx'
* access by HTTPS with MySQL credentials 'root' and 'OcGHZBu6Bt0R'
 
===SSH===
====enable password login via SSH====
* set password for user
sudo passwd ubuntu
aHalloo0@1a
* change in /etc/ssh/sshd_config
PasswordAuthentication yes
* restart service
sudo service ssh restart
====give user ubuntu root priviledges====
sudo usermod -G root ubuntu // by adding user ubuntu to group root
 
=====map to windows directory=====
* on windows pc map network drive with to start a root on server
\\sshfs\ubuntu@<SERVER_NAME>/../..
* or in command line (not tested yet)
net use Z: \\sshfs\ubuntu@<SERVER_NAME>\..\..


===Varnish===
===Varnish===
* restart by
* restart by
  sudo /opt/bitnami/ctlscript.sh restart varnish
  sudo /opt/bitnami/ctlscript.sh restart varnish

Latest revision as of 13:12, 30 January 2020

Purpose[edit]

A machine big enough to run a Magento 2 shop and enable remote debugging.

Creation[edit]

  • AWS Console -> EC2 -> Instances -> Launch Instance
  • Select in AWS Marketplace 'Magento Certified by Bitnami | 2.3.3-4 on Ubuntu 16.04 | 64-bit (x86) Amazon Machine Image (AMI) | Updated: 11/14/19 (see here)'
  • select t2.large
  • add 20 GB with name /dev/sda1/
  • select security group 'Magento Certified by Bitnami ....'
  • copied creation system log file from AWS Console -> Select Instance -> Instance Settings -> Get System Log in C:\Uwes\owncloud\documents\computer\AWSMediumLinux4Magento\CreationSystemLog.txt

The installation process will create several sub-directories under the /opt/bitnami directory:

  • Servers and related tools: apache2/, mysql/, postgresql/, apache-tomcat/, etc.
  • Languages: php/, python/, ruby/, tcl/, etc.
  • Application files: apps/phpMyAdmin/, apps/drupal/, apps/joomla/, apps/redmine/, etc.
  • Common libraries: common/
  • Licenses of the components included in the stack: licenses/
  • Configuration file for the Apache Web server: /opt/bitnami/apps/APPNAME/conf/

General Data[edit]

  • Key Pairs: LinuxMedium4Magento (local ppk file in C:\Uwes\owncloud\documents\computer\AWSMediumLinux4Magento\)
  • Availabity zone: us-west-2a
  • General Password from system.log OcGHZBu6Bt0R
  • users and its groups:
    • root - root
    • bitnami - bitnami, bitnami-admins, sudo, .... (see groups command)
    • ubuntu - bitnami, bitnami-admins
  • Putty configuratino: MediumLinux4Magento
  • Instance ID i-03c59ca379643f8e8

Bitnami AMI Documentation[edit]

ToDos[edit]

Applications[edit]

General[edit]

sudo /opt/bitnami/ctlscript.sh status // overview of all Bitnami services
sudo /opt/bitnami/ctlscript.sh start // start all Bitnami services
sudo /opt/bitnami/ctlscript.sh stop // stop all Bitnami services
sudo /opt/bitnami/ctlscript.sh restart // restart all Bitnami services

Apache[edit]

httpd -v
Server version: Apache/2.4.41 (Unix)
sudo /opt/bitnami/ctlscript.sh restart apache // restart Apache
  • web pages directory /opt/bitnami/apache2/htdocs/

Log Files[edit]

  • /opt/bitnami/apache2/logs/access.log
  • /opt/bitnami/apache2/logs/error.log

Configuration[edit]

/opt/bitnami/apache2/conf/bitnami/bitnami.conf
 includes /opt/bitnami/apache2/conf/bitnami/bitnami-apps-prefix.conf
   includes /opt/bitnami/apps/phpmyadmin/conf/httpd-prefix.conf
   includes /opt/bitnami/apps/magento/conf/httpd-prefix.conf
     rewrite ...
     includes /opt/bitnami/apps/magento/conf/httpd-app.conf

Magento[edit]

Configuration[edit]

Because standard admin user 'user' did not work created an additional admin user by command line (use of magento-cli instead of magento was forced by bitnami):

sudo bin/magento-cli admin:user:create --admin-user=admin --admin-password=mHalloo0@1m
admin@email.com
adminfirst
adminlast

Set admin session timeout by Stores -> Settings -> Configuration -> Advanced-> Admin -> Security -> Admin Session Lifetime

MySQL[edit]

Version[edit]

  • inital
mysqld --version
/opt/bitnami/mysql/bin/mysqld.bin  Ver 8.0.18 for linux-glibc2.12 on x86_64 (MySQL Community Server - GPL)

Logon[edit]

mysql -u root -p
favmRC7s6yZx

PHP[edit]

  • configuration file in /opt/bitnami/php/etc/php.ini
php -v
PHP 7.2.24 (cli) (built: Nov  8 2019 13:59:42) ( NTS )
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.2.24, Copyright (c) 1999-2018, by Zend Technologies

Debugging[edit]

  • here
  • decomment XDebug section in configuration file php.ini (see above) and restart Apache
sudo /opt/bitnami/ctlscript.sh restart apache
sudo /opt/bitnami/ctlscript.sh restart php-fpm
  • enable debugging according to here

PHPMyAdmin[edit]

  • enable remote access (and not by recommended SSH tunnel) by editing (see UH marker)
/opt/bitnami/varnish/etc/varnish/magento.vcl
/opt/bitnami/apps/phpmyadmin/conf/httpd-app.conf
  • restart Varnish and Apache
  • access by HTTPS with MySQL credentials 'root' and 'OcGHZBu6Bt0R'

SSH[edit]

enable password login via SSH[edit]

  • set password for user
sudo passwd ubuntu
aHalloo0@1a
  • change in /etc/ssh/sshd_config
PasswordAuthentication yes
  • restart service
sudo service ssh restart

give user ubuntu root priviledges[edit]

sudo usermod -G root ubuntu // by adding user ubuntu to group root
map to windows directory[edit]
  • on windows pc map network drive with to start a root on server
\\sshfs\ubuntu@<SERVER_NAME>/../..
  • or in command line (not tested yet)
net use Z: \\sshfs\ubuntu@<SERVER_NAME>\..\..

Varnish[edit]

  • restart by
sudo /opt/bitnami/ctlscript.sh restart varnish