From owner-freebsd-chat@freebsd.org Sat Sep 29 14:18:09 2018 Return-Path: Delivered-To: freebsd-chat@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 250AC109FABF for ; Sat, 29 Sep 2018 14:18:09 +0000 (UTC) (envelope-from tdteoenming@gmail.com) Received: from mail-yw1-xc41.google.com (mail-yw1-xc41.google.com [IPv6:2607:f8b0:4864:20::c41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0B887C4DF for ; Sat, 29 Sep 2018 14:18:08 +0000 (UTC) (envelope-from tdteoenming@gmail.com) Received: by mail-yw1-xc41.google.com with SMTP id z143-v6so3813827ywa.7 for ; Sat, 29 Sep 2018 07:18:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=m5SixqPrDfkx1SbmhW98nkdLNVMVeQ9qW5LOANaYpQ8=; b=bQrk1XSWkUwZJ5CsEX7y3EJfSiIT1RnPO4zbRnu21HIPcjPFgfhTyaq3/ZlP971NXb bLkd4rKxuElDrLkbOiD+LckpqQvnO6epcgDD6DirqWuwhH7DTViG4kEvNTx6Kda0wEat 7/xB8LKI5F3cneA/8np4QwZ6yVn+RcBljRfQ1JXtOnCHvgyFXedF1OyOZuMAVK0Mi1Ky 09qYFAxl7vT1xaqNexAZ4N/V7nGGc6NfOadeYMVCQgjyqwZhbNCiiDU2Zg5UcWHHEwsv ZymcLPLmkIptJUK6N9t9ZIVV3IuBUeBfALE6yO2VsNdvCWovLwhPSd7FEKKRTuevVVVP z4GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc :content-transfer-encoding; bh=m5SixqPrDfkx1SbmhW98nkdLNVMVeQ9qW5LOANaYpQ8=; b=EXP6DjraCFg2AbjtyZ/P7WrmlrbY51nBVqU1ReUIxJdKkzqrah5bSUooQzarEJvlE1 Kz4NIO3fVzu1dl8ybAbTKk3onPzjNFidmBmK6i2IEMAdSFYK70O6Dnbz3eJFD48OgpFL 2etitz23PYYkinLfGKBn51NrqQvIdAcW478Aa8G9kxPlYbw0J06P/tlNYRLR+4qiD5VQ s6xngeVr+ucJBmsNfRgM2DYePOjKCp7DJ3fSbaeCxdhn8VJMQ/eaiPMi3Le5xbVtfvYw QnBNjMwwgnMMoXB09Y6kTxpjXWqKf+F15v0bZxxTmp/4BnbNksFekTVYcAjyQwkwkj5v 3IsQ== X-Gm-Message-State: ABuFfojZUNxo9oInMBbk12zwkdd2FlRNgb/IoDM/dzRysY360qKtfhMh 88nPmWXSRU42l5uEOLwtDqW/Q9bZm9Gfvf+06TvRYCk= X-Google-Smtp-Source: ACcGV61O2kSJvyMIMDd4Dex2EQatJI5QwTVFYPLLFFYd1lVXsARlVOLEsM03E0vAoH/3dqCd4YHEuNhfFOnrj7OlnwU= X-Received: by 2002:a81:1c41:: with SMTP id c62-v6mr31827ywc.269.1538230687740; Sat, 29 Sep 2018 07:18:07 -0700 (PDT) MIME-Version: 1.0 From: Turritopsis Dohrnii Teo En Ming Date: Sat, 29 Sep 2018 22:14:34 +0800 Message-ID: Subject: Step-by-Step Tutorial: How to Setup Your Own e-Commerce Online Store using WooCommerce 3.4.5, Wordpress 4.9.8, and CentOS 1805 (LAMP) in Amazon AWS Cloud To: freebsd-chat@freebsd.org Cc: Turritopsis Dohrnii Teo En Ming Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: freebsd-chat@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Non technical items related to the community List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Sep 2018 14:18:09 -0000 Step-by-Step Tutorial: How to Setup Your Own e-Commerce Online Store using WooCommerce 3.4.5, Wordpress 4.9.8, and CentOS 1805 (LAMP) in Amazon AWS Cloud Author: Mr. Turritopsis Dohrnii Teo En Ming Country: Singapore Date: 28th September 2018 Friday Document Version: 1809.01 Abbreviations =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D LAMP: Linux + Apache Web Server + MySQL/MariaDB + PHP WAMP: Windows + Apache Web Server + MySQL/MariaDB + PHP SECTION 1 CREATING YOUR CENTOS 7.5 (1805) LINUX INSTANCE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D 001. Login to Amazon Web Services. 002. Click Services > Compute > EC2. 003. Click Network & Security > Key Pairs 004. Click Create Key Pair. 005. Enter your key pair name. Then click Create. 006. Be sure to download your private key in the form of a .PEM file. You will need to convert it to a .PPK file later. 007. Click Instances > Instances. 008. Click Launch Instance. 009. Click AWS Marketplace. 010. Search for CentOS. 011. Select CentOS 7 (x86_64) - with Updates HVM Amazon Machine Image (AMI)= . 012. Click Continue. 013. Select General Purpose, t2.micro, 1 vCPU, 1 GB RAM (FREE TIER ELIGIBLE= ). 014. Click Next: Configure Instance Details. 015. Select Network: 016. Select Subnet: 017. Click Protect against accidental termination. 018. Click Next: Add Storage. 019. Click Next: Add Tags. Click Add tag. 020. Enter Key =3D Name and Value =3D Online Store. 021. Click Next: Configure Security Group 022. Click Select an existing security group. 023. Select VS_SG (Virtual Server Security Group). 024. Click Review and Launch. Click Launch. 025. Select a key pair. Click Launch Instances. 026. Click View Instances. 027. Click Network & Security > Elastic IPs. 028. Select an unused IPv4 address. 029. Click Actions > Associate address. 030. Select the Online Store instance. 031. Click Allow Elastic IP to be reassociated if already attached. 032. Click Associate. Click Close. 033. Login to CentOS 7.5 Linux using Putty. SECTION 2 INSTALLING WORDPRESS 4.9.8 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 034. sudo yum install php php-mysql php-devel php-gd php-pecl-memcache php-pspell php-snmp php-xmlrpc php-xml Guide: How To Install MySQL / MariaDB on CentOS 7 Link: https://www.liquidweb.com/kb/how-to-install-mysql-mariadb-on-centos-7= / 035. sudo yum -y install mariadb-server mariadb 036. sudo yum install wget Guide: Installing WordPress: Detailed Instructions Link: https://codex.wordpress.org/Installing_WordPress#Detailed_Instruction= s 037. wget https://wordpress.org/latest.tar.gz 038. tar xfvz latest.tar.gz 039. sudo passwd root 040. su - 041. systemctl start mariadb 042. systemctl enable mariadb 043. mysql 044. MariaDB [(none)]> CREATE DATABASE wordpress; 045. MariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress.* TO "wordpress"@"localhost" IDENTIFIED BY "password"; 046. MariaDB [(none)]> FLUSH PRIVILEGES; 047. MariaDB [(none)]> EXIT 048. cd /home/centos/wordpress AFAIK Wordpress 4.9.8 cannot be installed in a subdirectory. If you encounter a HTTP error code 500 doing so, be sure to check the Apache Web Server error logs, that is, tail -f /var/log/httpd/error_log. 049. cp -R * /var/www/html 050. systemctl start httpd 051. systemctl enable httpd 052. sudo yum install nano 053. nano /etc/httpd/conf/httpd.conf 054. Append the following line AddType application/x-httpd-php .php 055. systemctl restart httpd Wordpress 4.9.8's PHP code won't execute on php-5.4.16, which is installed by default on CentOS 7.5. It will return a HTTP error code of 500. Install PHP-7.2.10 instead. Guide: How to Install PHP 7 in CentOS 7 Link: https://www.tecmint.com/install-php-7-in-centos-7/ 056. yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 057. yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm 058. yum install yum-utils You will need minimum PHP 7.2. 059. yum-config-manager --enable remi-php72 060. yum install php php-mcrypt php-cli php-gd php-curl php-mysql php-ldap php-zip php-fileinfo 061. php -v PHP 7.2.10 is now installed. 062. systemctl stop httpd && systemctl start httpd 063. Go to http:// 064. Click Let's go! 065. Fill in the following MySQL/MariaDB database connection information. Database Name: wordpress Username: wordpress Password: password Database Host: localhost Table Prefix: wp_ 066. Click Submit. 067. cd /var/www/html 068. nano wp-config.php 069. Copy and paste the contents of wp-config.php shown on the Wordpress installation screen on your browser. 070. Click Run the installation. 071. Fill in the following information. Site Title: Teo En Ming Corporation Online Store Username: admin Password: password Your email: user@example.com Uncheck Discourage search engines from indexing this site 072. Click Install wordpress. 073. Click Login. SECTION 3 INSTALLING WOOCOMMERCE 3.4.5 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Follow the WooCommerce installation guide here: https://docs.woocommerce.com/document/installing-uninstalling-woocommerce/ 074. Login to your new wordpress site. 075. Click Plugins > Add new. 076. Search for WooCommerce. 077. Click Install Now on WooCommerce by Automattic. Installing FTP Server in CentOS 7.5. Guide: How to Install and Configure vsftpd on CentOS 7 Link: https://www.liquidweb.com/kb/how-to-install-and-configure-vsftpd-on-c= entos-7/ 078. sudo yum -y install vsftpd 079. sudo nano /etc/vsftpd/vsftpd.conf anonymous_enable=3DNO local_enable=3DYES write_enable=3DYES chroot_local_user=3DYES 080. sudo systemctl restart vsftpd 081. sudo systemctl enable vsftpd 082. sudo passwd centos Change National Security Agency (NSA)=E2=80=99s SELinux mode. 083. sudo nano /etc/selinux/config SELINUX=3Dpermissive 084. reboot 085. su - 086. echo 'allow_writeable_chroot=3DYES' >> /etc/vsftpd/vsftpd.conf 087. systemctl restart vsftpd 088. Go back to WooCommerce installation page on your browser. 089. Fill in the Connection Information. Hostname: FTP Username: ftpuser FTP Password: password Connection type: FTP 090. Click Proceed. Installation failed: Unable to locate WordPress content directory (wp-conte= nt). To resolve this issue, see https://wordpress.stackexchange.com/questions/206022/unable-to-locate-wordp= ress-content-directory-wp-content 091. cd /var/www/html 092. nano wp-config.php Append the following lines if(is_admin()) { add_filter('filesystem_method', create_function('$a', 'return "direct";'= )); define( 'FS_CHMOD_DIR', 0751 ); } 093. Go back to WooCommerce installation page. 094. Fill in the Connection Information. Hostname: FTP Username: ftpuser FTP Password: password Connection type: FTP 095. Click Proceed. WooCommerce will be installed. 096. Click Activate. 097. Click Run the Setup Wizard. 098. WooCommerce Store setup page: Where is your store based? Singapore Address: Singapore City: Singapore Postcode/ZIP: 123456 What currency do you accept payments in? Singapore dollar ($ / SGD) What type of products do you plan to sell? I plan to sell both physical and digital products Check I will also be selling products or services in person. Check Help WooCommerce improve with usage tracking. 099. Click Let's go! 100. WooCommerce Payment page: Stripe: Enabled Click Create a new Stripe account for me Paypal: Enabled Click Accept payments without linking a PayPal account Expand Offline Payments. Check Payments: Enabled Bank transfer (BACS) payments: Enabled Cash on delivery: Enabled 101. Click Continue. 102. WooCommerce Shipping page: Shipping Zone Singapore: Flat Rate Cost: $5 Locations not covered by your other zones: Flat Rate Cost: $5 Weight unit: kg Dimension unit: cm 103. Click Continue. 104. Recommended for All WooCommerce Stores page: Storefront Theme: Enabled MailChimp: Enabled 105. Click Continue. 106. Click Continue with Jetpack. 107. Create an account to set up Jetpack Your email address: user@example.com Choose a username: jetpackuser Choose a password: password 108. WooCommerce Ready! page: 109. Click Create a Product SECTION 4 INSTALLING MOD_SSL TO SERVE SECURE WEB PAGES =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D 110. sudo yum -y install mod_ssl 110. sudo systemctl restart httpd SSL is now available. 111. Go to https:///wp-admin and logi= n. 112. On the Dashboard, click Let's go! 113. Click Publish. 114. Setup is complete. SECTION 5 CREATING DNS HOST RECORD =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D SECTION 5.1 CPANEL =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 115. Login to your cpanel. 116. Click DNS Functions > Edit DNS Zone. 117. Choose a zone to edit. Click Edit. 118. On the Add New Entries Below this Line section, fill in the following information: store.example.com. Select A record IPv4 address: 119. Click Save. 120. Repeat Steps 116 to 119 for other DNS Zones. 121. Click DNS Functions > Synchronize DNS Records 122. Select Synchronize all zones to all servers 123. Click Synchronize. Error: DNS Records failed to synchronize! I will need to investigate further why the cPanel virtual server failed to synchronize DNS records with the 2 name servers. SECTION 5.2 WINDOWS SERVER 2019 ACTIVE DIRECTORY DNS SERVER =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D 115. Login to your Windows Server 2019 Domain Controller. 116. Under Server Manager, click Tools > DNS. 117. Click Forward Lookup Zones > EXAMPLE.COM 118. Right click, select New Host (A or AAAA)... Name (uses parent domain name if blank): store Fully qualified domain name (FQDN): EXAMPLE.COM IP address: 119. Click Add Host. Click Done. 120. Right Click, select Reload. Click Yes. SECTION 6 WORDPRESS Address Settings =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 6.1 Go to https://store.example.com/wp-admin and login. 6.2 Click Settings > General Settings. WordPress Address (URL): https://store.example.com Site Address (URL): https://store.example.com 6.3 Click Save Changes SECTION 7 Purchase and Install SSL Certificate =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 7.1 Please remember to purchase and install SSL certificate in your Apache web server! There are free 90-day SSL certificates available. All done! I have just completed setting up my Teo En Ming Corporation Online Store. Have you done yours? If all of these sound too technical and complicated for you, I may be able to help you in setting up your very own e-Commerce Online Store! =3D=3D=3DBEGIN SIGNATURE=3D=3D=3D Turritopsis Dohrnii Teo En Ming's Academic Qualifications as at 30 Oct 2017 [1] https://tdtemcerts.wordpress.com/ [2] http://tdtemcerts.blogspot.sg/ [3] https://www.scribd.com/user/270125049/Teo-En-Ming =3D=3D=3DEND SIGNATURE=3D=3D=3D