CentOS 7.x create lightsail owncloud instance
From Notes_Wiki
Home > CentOS > CentOS 7.x > Web Based Tools > owncloud > CentOS 7.x create lightsail owncloud instance
Home > CentOS > CentOS 7.x > CentOS 7.x Setup lightsail instances > CentOS 7.x create lightsail owncloud instance
To create a lighstail CentOS 7.x instance with owncloud, use following steps:
- Create appropriate lightsail instance
- For production instances create static IP and attach with instance
- Create DNS entry for FQDN mapping to static IP
- This is required for owncloud for which FQDN is critical.
- Allow HTTPS access to server in lightsail instance networking firewall section
- Download corresponding regions private key
- chmod 400 <private-key>
- ssh -i <private-key> centos@<instance-public-ip>
- sudo su -
- Disable SELinux
- yum -y install vim
- vim ~/.ssh/authorized_keys
- Add own key, Allow <private-key> direct root aaccess. (First line 155x)
- Set hostname
- hostname <desired-fqdn>
- vim /etc/hostname
- Exit
- ssh directly as root with self public key
- Search for bitnami installer URL
- yum -y install epel-release
- yum -y install wget
- wget '<Download-URL>' -O '<Installer-filename>'
- yum -y install perl-Data-Dumper
- Create appropriate swap space using CentOS 7.x adding swap space using file
- chmod +x <Installer-filename>
- ./<Installer-filename>
- Give standard answers with simple password and admin username. Email can be configured later.
- Setup fail2ban using CentOS 7.x fail2ban including firewalld using CentOS 7.x Basic firewalld configuration
- Configure system to store history date time using Storing date / time along with commands in history
- exit and ssh again for history settings to take effect
- cd /opt/owncloud-<ver>/apache2/htdocs
- mv index.html index-old.html
- wget sbarjatiya.com
- vim index.html
- Add redirect for /redmine, Remove google identifier, Set appropriate name
- Test login into owncloud by name
- 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/
- 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
- Open site using https://<fqdn> and verify that it is opening properly
- 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]
- /opt/owncloud-<ver>/ctlscript.sh restart apache
- Test whether automatic redirection to https is working in private browser
- yum -y install bzip2
- Open /opt/owncloud-<ver>/apps/owncloud/htdocs/config/config.php and see dbname, dbuser and dbpassword
- Test connection using
- /opt/owncloud-<ver>/mysql/bin/mysql -u bn_owncloud -p bitnami_owncloud
-
- with password read in above step
- 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
- chmod +x above file and test it by running.
- Configure backup for /opt folder which executes /opt/take-database-backup.sh before backup.
- Install logwatch and set /etc/aliases for root user
- Set correct time zone CentOS 7.x Change system timezone
Home > CentOS > CentOS 7.x > Web Based Tools > owncloud > CentOS 7.x create lightsail owncloud instance
Home > CentOS > CentOS 7.x > CentOS 7.x Setup lightsail instances > CentOS 7.x create lightsail owncloud instance