Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
#SSH to your instance
#example :
#chmod 600 YOURPEMKEY.pem
#update current packages
sudo yum update -y
#install prerequisites
sudo rpm -ivh
sudo rpm -ivh
sudo yum –enablerepo=webtatic
sudo amazon-linux-extras install -y lamp-mariadb10.2-php7.2 php7.2
sudo yum install -y httpd mariadb-server
sudo yum remove -y php*
sudo yum install -y php72w php72w-gd php72w-json php72w-pdo php72w-curl php72w-intl php72w-mcrypt php72w-zip php72w-xml php72w-mbstring php72w-mysqlnd
#Install Owncloud
sudo yum –enablerepo=epel install php-pear-Net-Curl php-pear-MDB2-Driver-mysqli
cd /etc/yum.repos.d/
sudo rpm --import
sudo wget
sudo yum -y install owncloud-files
sudo chown -R apache.apache /var/www/html/owncloud/
#Start and enable httpd and mariadb
sudo systemctl start httpd
sudo systemctl start mariadb
sudo systemctl enable httpd
sudo systemctl enable mariadb
sudo mysql_secure_installation
#configure Owncloud db
mysql -u root -p
# Press enter when they ask you for password
MariaDB [(none)]> create database clouddb;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all on clouddb.* to 'clouddbuser'@'localhost' identified by 'YOUR_PASSWORD';
Query OK, 0 rows affected (0.00 sec)
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>exit
#Setup second disk to be able to receive owncloud files
[root@ip-YOUR_ELASTIC_IP ] lsblk
xvda 202:0 0 8G 0 disk
└─xvda1 202:1 0 8G 0 part /
xvdb 202:16 0 500G 0 disk
#Mount the disk, more detail here :
#So here we see that my disk is name xvdb
#Let's mount it
sudo file -s /dev/xvdb
sudo mkfs -t ext4 /dev/xvdb
sudo mkdir /owncloudDisk
sudo mount /dev/xvdb /owncloudDisk
sudo cp /etc/fstab /etc/fstab.orig
sudo file -s /dev/xvdb
sudo vim /etc/fstab
# Add a line with your UID example : UUID=YOURUID /owncloudDisk ext4 quiet,defaults,permissions,locale=en_US.utf8 0 2
sudo mount -a
sudo chmod 0770 /owncloudDisk/
sudo chown -R apache:apache /owncloudDisk
sudo service httpd restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.