CentOS 7.x create lightsail owncloud instance

From Notes_Wiki
Revision as of 07:20, 26 January 2019 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb self="create lightsail owncloud instance">CentOS_7.x_Owncloud|Owncloud</yambe:breadcrumb> <yambe:breadcrumb self="create lightsail owncloud instance">CentOS_...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb self="create lightsail owncloud instance">CentOS_7.x_Owncloud|Owncloud</yambe:breadcrumb> <yambe:breadcrumb self="create lightsail owncloud instance">CentOS_7.x_Setup_lightsail_instances|Setup lightsail instances</yambe:breadcrumb>

CentOS7.x create lightsail owncloud instance

To create a lighstail CentOS 7.x instance with owncloud, use following steps:

  1. Create appropriate lightsail instance
  2. For production instances create static IP and attach with instance
  3. Create DNS entry for FQDN mapping to static IP
    This is required for owncloud for which FQDN is critical.
  4. Allow HTTPS access to server in fail2ban instance networking firewall section
  5. Download corresponding regions private key
  6. chmod 400 <private-key>
  7. ssh -i <private-key> centos@<instance-public-ip>
  8. sudo su -
  9. yum -y install vim
  10. vim ~/.ssh/authorized_keys
    Add own key, Allow <private-key> direct root aaccess. (First line 155x)
  11. Set hostname
    hostname <desired-fqdn>
    vim /etc/hostname
  12. Exit
  13. ssh directly as root with self public key
  14. Search for bitnami installer URL
  15. yum -y install epel-release
  16. yum -y install wget
  17. wget '<Download-URL>' -O '<Installer-filename>'
  18. yum -y install perl-Data-Dumper
  19. Create appropriate swap space using CentOS 7.x adding swap space using file
  20. chmod +x <Installer-filename>
  21. ./<Installer-filename>
    Give standard answers with simple password and admin username. Email can be configured later.
  22. Setup fail2ban using CentOS 7.x fail2ban including firewalld using CentOS 7.x Basic firewalld configuration
  23. Configure system to store history date time using Storing date / time along with commands in history
  24. exit and ssh again for history settings to take effect
  25. cd /opt/owncloud-<ver>/apache2/htdocs
  26. mv index.html index-old.html
  27. wget sbarjatiya.com
  28. vim index.html
    Add redirect for /redmine, Remove google identifier, Set appropriate name
  29. Test login into owncloud by name
  30. Generate lets-encrypt certificate if public DNS FQDN is set using:
    /opt/owncloud-<ver>/letsencrypt/scripts/generate-certificate.sh -m <admin-email-id> -d <FQDN>
    Run above command again if it fails first time.
    Refer: https://docs.bitnami.com/aws/how-to/generate-install-lets-encrypt-ssl/
  31. crontab -e and update
    0 0 1 * * /opt/redmine-4.0.0-0/letsencrypt/lego
    line to to have first two digit 0 and 0 randomized to minutes between 5 to 55 and hour between 1 to 4
  32. Open site using https://<fqdn> and verify that it is opening properly
  33. For compulsary https access edit /opt/owncloud-<ver>/apache2/conf/bitnami/bitnami.conf and under
    DocumentRoot "/opt/owncloud-<ver>/apache2/htdocs"
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]
  34. /opt/owncloud-<ver>/ctlscript.sh restart apache
  35. Test whether automatic redirection to https is working in private browser
  36. yum -y install bzip2
  37. Open /opt/owncloud-<ver>/apps/owncloud/htdocs/config/config.php and see dbname, dbuser and dbpassword
  38. Test connection using
    /opt/owncloud-<ver>/mysql/bin/mysql -u bn_owncloud -p bitnami_owncloud
    with password read in above step
  39. Create /opt/take-database-backup.sh with following contents:
    /opt/ownlcoud-<ver>/mysql/bin/mysqldump -u bn_owncloud -p<password> bitnami_owncloud | bzip2 > /opt/bitnami_owncloud.sql.bz2
  40. chmod +x above file and test it by running.
  41. Configure backup for /opt folder which executes /opt/take-database-backup.sh before backup.
  42. Install logwatch and set /etc/aliases for root user
  43. Set correct time zone CentOS 7.x Change system timezone



<yambe:breadcrumb self="create lightsail owncloud instance">CentOS_7.x_Owncloud|Owncloud</yambe:breadcrumb> <yambe:breadcrumb self="create lightsail owncloud instance">CentOS_7.x_Setup_lightsail_instances|Setup lightsail instances</yambe:breadcrumb>