Skip to content

Instantly share code, notes, and snippets.

@jimyang2008
Last active May 10, 2018 12:00
Show Gist options
  • Save jimyang2008/5a5a25bc7aad87d1f25e31ccf8b0899c to your computer and use it in GitHub Desktop.
Save jimyang2008/5a5a25bc7aad87d1f25e31ccf8b0899c to your computer and use it in GitHub Desktop.
install ownCloud in Linux
#!/bin/bash
set -e
err() {
echo "$@" >&2
}
prepare_redhat() {
yum update -y
yum install -y wget bzip2
}
get_distro() {
if [[ -e /etc/os-release ]]
then
. /etc/os-release
if [[ $ID == "centos" && $VERSION_ID=="7" ]]
then
echo centos_7
exit 0
fi
fi
exit 1
}
install_centos_7() {
yum install -y epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum install -y httpd mod_ssl php70w php70w-dom php70w-mbstring php70w-gd php70w-pdo php70w-json php70w-xml php70w-zip php70w-curl php70w-mcrypt php70w-pear php70w-intl setroubleshoot-server mariadb-server php70w-mysql
systemctl enable httpd
systemctl start httpd
systemctl enable mariadb
systemctl start mariadb
mysql_secure_installation
rpm --import https://download.owncloud.org/download/repositories/production/CentOS_7/repodata/repomd.xml.key
wget http://download.owncloud.org/download/repositories/production/CentOS_7/ce:stable.repo -O /etc/yum.repos.d/ce:stable.repo
yum clean all
yum install -y owncloud-files
#TAR_FILE='owncloud-10.0.8.tar.bz2'
#test -e $TAR_FILE || wget https://download.owncloud.org/community/$TAR_FILE
#tar -xjf $TAR_FILE
}
# ----------------------------------------------------------------------------
# MAIN goes here
# ----------------------------------------------------------------------------
distro=$(get_distro)
case $distro in
centos_7)
install_centos_7 ;;
*)
err unsupported distro;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment