Skip to content

Instantly share code, notes, and snippets.

@stefancrain
Created April 12, 2013 19:54
Show Gist options
  • Save stefancrain/5374657 to your computer and use it in GitHub Desktop.
Save stefancrain/5374657 to your computer and use it in GitHub Desktop.
#!/bin/bash
# largly from
# http://www.nickyeoman.com/blog/system-administration/184-installing-owncloud-on-ubuntu-1204
#Setup Server
sudo su
# make sure you have dependentcies
apt-get install -y apache2 php5 php5-gd php-xml-parser php5-sqlite libcurl3-dev php5-ldap php5-curl libsqlite0 unzip sqlite-doc libsqlite0 mp3info sqlite unzip zip git wget lm-sensors hddtemp sysstat iptraf
vi /etc/apache2/httpd.conf
# ServerName ownCloud
# :x
service apache2 restart
sudo vi /etc/php5/apache2/php.ini
#Change the following line to something like:
# upload_max_filesize = 750M
# :x
service apache2 restart
a2enmod headers rewrite
service apache2 restart
#connect to mysql
mysql -u root -p
CREATE DATABASE owncloud;
GRANT ALL PRIVILEGES ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'OwnCloudPass';
quit
mkdir /owncloud
cd /owncloud
mkdir files sql scripts
touch README.txt
wget http://download.owncloud.org/community/owncloud-5.0.4.tar.bz2
tar -xjf owncloud-5.*.tar.bz2
mv owncloud public
rm owncloud-5.*.tar.bz2
chown -R www-data:www-data public/
chown -R www-data:www-data files/
cd /etc/apache2/sites-available
vi owncloud
# insert this into the above file
<VirtualHost *:80>
ServerName your.domain.name.or.ip #change me
DocumentRoot /owncloud/public/
ServerAdmin webmaster@owncloud
<Directory /owncloud/public/ >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ErrorLog /var/log/apache2/error_owncloud.log
</VirtualHost>
a2ensite owncloud
service apache2 reload
# edit /etc/apache2/sites-enabled/000-default and change line 11 to 'AllowOverride All'
vi /etc/apache2/sites-enabled/000-default
a2enmod headers
a2enmod rewrite
service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment