Difference between pages "Compiling Xen" and "OwnCloud"

From Wikislax
(Difference between pages)
Jump to: navigation, search
 
(Creating the OwnCloud database)
 
Line 1: Line 1:
 
{{RightTOC}}
 
{{RightTOC}}
  
== What is Xen ? ==
+
== What is OwnCloud ? ==
  
[http://wiki.xen.org/wiki/Xen_Overview Xen] is an hypervisor, a thin software layer executing multiple virtual machines, each running its own operating system. Xen is normally used as a server virtualization platform, running on headless servers without graphical console and controlled through the network. However it is also possible to run Xen on graphical desktops, and with proper hardware virtualization, to dedicate the primary graphics card (and keyboard / mouse) to a virtual machine, making it possible to have high performance full 3D and video acceleration in a virtual machine (see [http://wiki.xen.org/wiki/Xen_VGA_Passthrough Xen VGA Passthru]). Xen is otherwise free and open source.
+
[http://owncloud.com/ OwnCloud] is a file synchronization server. It affords keeping a hierarchy of files synchronized on different clients and operating systems.
  
== A few quirks ==
+
The [https://doc.owncloud.com/server/10.15/admin_manual/installation/quick_guides/ubuntu_20_04.html/ Owncloud install doc] provided is for Ubuntu.
  
The '''dev86-0.16.21-x86_64-1.txz''' package included with Slackware 14.2 does not afford compiling '''xen-4.9.0''' properly, and must be replaced by '''[{{SERVER}}/wikislax/download/dev86-0.16.17-x86_64-2.txz dev86-0.16.17-x86_64-2.txz]''', that can be found on the Slackware 13.37, 14.0, or 14.1 distribution disks, in directory '''slackware64/d'''. Trying to compile dev86 [http://v3.sk/~lkundrak/dev86/ from source] is not an alternative : dev86 source versions 0.16.18 to 0.16.21 have the same issue compiling xen-4.9.0, and older 0.16.17 does not compile on Slackware 14.2.
+
It is adapted below for Slackware 15.0.
  
# removepkg /var/log/packages/dev86-0.16.21-x86_64-1.txz
+
== Installing OwnCloud ==
# installpkg dev86-0.16.17-x86_64-2.txz
 
  
Also, the '''grub-2.00''' included with Slackware 14.2 does not afford booting xen. However, getting the latest version '''grub-2.02''' from source does work.
+
OwnCloud is a PHP application. [https://owncloud.com/download-server download] tarball then untar and install.
  
== Hardware requirements ==
+
# tar -C /usr/local -xvf owncloud-complete-20240724.tar.bz2
 +
# chown -R apache:apache owncloud
 +
# cd /var/www/htdocs
 +
# ln -s /usr/local/owncloud owncloud
 +
# chown -R apache:apache owncloud
  
Xen runs on Intel X86 hardware and requires a processor and motherboard supporting VT-x and optionally VT-d for hardware virtualization. See this [http://www.intel.com/support/motherboards/desktop/sb/cs-030922.htm page] for a list of Intel compatible motherboards and chipsets and this [http://ark.intel.com/ page] for a list of compatible processors. Our system running Xen successfully at the time of this writing (and since June 2012) is based on a DZ77GA70K Intel motherboard, an Intel® Core™ i7-3770 Processor (the overclockable i7-3770 "K" model does not afford virtualization), 32 Gb of PC12800 memory and an MSI GeForce G210 graphics board.
+
== Creating the occ helper script ==
  
== Documentation difficulties ==
+
occ is an OwnCloud administration command.
  
Although the software itself works well and is pretty straighforward, good quality Internet information is missing. The volume of information on the Xen wiki is plethoric, but mostly irrelevant as pertaining to old versions of everything. Building the big picture requires interpretation of tiny bits in forum messages, a pretty painful process, although I have to recognize that it worked for me in the end. An alternative is to use one of these old-style information repositories named "books". Yes it is pretty old-fashionned ;) but actually there are good ones on the topic. Here is [http://www.amazon.co.uk/The-Book-Xen-Practical-Administrator/dp/1593271867/ref=sr_1_1?s=books&ie=UTF8&qid=1341037874&sr=1-1 the most recent I found], it is a good value but of course you can find more on [http://www.amazon.co.uk/s/ref=nb_sb_noss_2?url=search-alias%3Dstripbooks&field-keywords=xen&x=0&y=0 amazon(.co.uk)].
+
# FILE="/usr/local/bin/occ"
 +
# cat <<EOM >$FILE
 +
> #! /bin/bash
 +
> cd /usr/local/owncloud
 +
> sudo -E -u apache /usr/bin/php /usr/local/owncloud/occ "\$@"
 +
> EOM
 +
# chmod u+x $FILE
  
== Software constraints ==
+
== Creating the OwnCloud database ==
  
To make a long story short, at the time of this writing (and since June 2012) working with nVidia graphic boards on Xen and X11 requires the "nouveau" driver. Other drivers like nv or the nVidia proprietary driver do not support Xen and switch off the screen when launched or do not display properly. "Nouveau" requires a fairly recent version of X11. Slackware 13.37 or newer is required. "Nouveau" is available in kernel 3.4.2 upstream and was previously included as a staging driver. Xen dom0 support was included in kernel 3.0. To benefit from both Xen and "Nouveau", the best is to use kernel 3.4.2 upstream.
+
OwnCloud can use a variety of databases. We will be using MySQL. The database can be created as follows :
  
== Installing acpica ==
+
# mysql -u root -e \
 +
  "CREATE DATABASE IF NOT EXISTS owncloud; \
 +
  CREATE USER IF NOT EXISTS 'owncloud'@'localhost' IDENTIFIED BY 'password'; \
 +
  GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' WITH GRANT OPTION; \
 +
  FLUSH PRIVILEGES;"
 +
# mysql -u root -e \
 +
  CREATE USER 'owncloud'@'127.0.0.1' IDENTIFIED BY 'z0m8upnt';
 +
  GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'127.0.0.1';
 +
  FLUSH PRIVILEGES;
 +
#
  
Xen requires acpica. [https://www.acpica.org/downloads Download] then install as below :
+
It is also possible to create user owncloud@localhost and database from phpmyadmin.
  
# tar -C /usr/local -xvf acpica-unix-yyyymmdd.tar.gz
+
== setting up the owncloud database ==
# cd /usr/local
 
# chown -R root:root acpica-unix-yyyymmdd
 
# cd acpica-unix-yyyymmdd
 
# make
 
# make install
 
  
== Installing yajl ==
+
The admin user is the one who will manage the other users and OwnCloud from the OwnCloud web page.
  
Xen 4.19.1 requires yajl. [http://lloyd.github.io/yajl/ Download] then install as below. <u>Note</u> : there is no option to specify the target library directory so the files need to be moved manually.
+
# occ maintenance:install \
 +
    --database "mysql" \
 +
    --database-name "owncloud" \
 +
    --database-user "owncloud" \
 +
    --database-pass "password" \
 +
    --data-dir "/var/www/htdocs/owncloud/data" \
 +
    --admin-user "admin" \
 +
    --admin-pass "admin"
 +
ownCloud was successfully installed
 +
#
  
# tar -C /usr/local -xvf lloyd-yajl-17b1790.tar.gz
+
== Configure ownCloud’s Trusted Domains ==
# cd /usr/local
 
# chown -R root:root lloyd-yajl-17b1790
 
# cd lloyd-yajl-17b1790
 
# ./configure
 
# make
 
# make install
 
# cd ../lib
 
# mv libyajl* ../lib64
 
# ldconfig
 
  
== Compiling Xen ==
+
# my_ip=$(hostname -I|cut -f1 -d ' ')
 +
# occ config:system:set trusted_domains 1 --value="$my_ip"
 +
System config value trusted_domains => 1 set to string x.y.z.t
 +
# occ config:system:set trusted_domains 2 --value="$HOSTNAME"
 +
System config value trusted_domains => 2 set to string your.domain.tld
 +
#
  
[http://xen.org/products/xen_source.html Download Xen] from the official [http://www.xen.org xen.org] site. <u>Note</u> : File stubs-32.h is missing in the compiler includes so we add a link to the existing stubs-64.h. Also, some Xen Python scripts are installed in /usr/local/lib64/python-2.7/site-packages which python cannot find so we add links from the standard library as well.
+
== Configure the cron jobs ==
  
# cd /usr/include/gnu
+
Set your background job mode to cron:
# ln -s stubs-64.h stubs-32.h
 
# cd
 
# tar -C /usr/local -xvf xen-x.y.z.tar.gz
 
# cd /usr/local
 
# chown -R root:root xen-x.y.z
 
# cd xen-x.y.z
 
# ./configure --libdir=/usr/local/lib64 --with-initddir=/etc/rc.d
 
# make world
 
# make install
 
# make clean
 
# cd ../lib64/python2.7/site-packages
 
# ln -s xen /usr/lib64/python2.7/site-packages
 
# ln -s xen-3.0-py2.7.egg-info /usr/lib64/python2.7/site-packages
 
  
== Adjusting rc.local* ==
+
# occ background:cron
 +
Set mode for background jobs to 'cron'
 +
#
  
Xen needs a couple of daemons to run to ensure VM management. Add these lines to rc.local and rc.local_shutdown :
+
== Configure the execution of the cron job to every 15 min and the cleanup of chunks every night at 2 am: ==
  
  PATH=/usr/local/sbin:/usr/local/bin:$PATH
+
  # echo "MIN HOUR DAY MONTH DAYOFWEEK COMMAND" >> /var/spool/cron/crontabs/apache
  export PATH
+
# echo "*/15 * * * * /var/www/htdocs/owncloud/occ system:cron" >> /var/spool/cron/crontabs/apache
   
+
  # echo "0  2 * * * /var/www/htdocs/owncloud/occ dav:cleanup-chunks" >> /var/spool/cron/crontabs/apache
  # start xencommons
+
# chgrp apache /var/spool/cron/crontabs/apache
  if [ -x /etc/rc.d/xencommons ]; then
+
  #
    /etc/rc.d/xencommons start
 
  fi
 
   
 
  # stop xencommons
 
  if [ -x /etc/rc.d/xencommons ]; then
 
    /etc/rc.d/xencommons stop
 
  fi
 
  
== Compiling a dom0 Kernel ==
+
== Configure Log Rotation ==
  
Domain-0 (dom0 for short) is a special guest (virtual machine) that the Xen hypervisor always loads on host startup. Dom0 is used to control and manage the Xen hypervisor, and provides virtual disks and networks for other unprivileged guests (=domUs). Dom0 support was introduced in Linux kernel 3.0. The kernel generated must include the .config file domU and [http://wiki.xen.org/wiki/Mainline_Linux_Kernel_Configs#Configuring_the_kernel dom0 options]. Here is a minimal example of such a [{{SERVER}}/wikislax/download/config-dom0 .config dom0] file. Feel free to use it as a base, replacing device drivers as required. The rest of the kernel compilation is nominal :
+
# FILE="/etc/logrotate.d/owncloud"
 +
# cat <<EOM >$FILE
 +
/var/www/htdocs/owncloud/data/owncloud.log {
 +
size 10M
 +
rotate 12
 +
copytruncate
 +
missingok
 +
compress
 +
compresscmd /bin/gzip
 +
}
 +
EOM
 +
#
  
# tar -C /usr/src -xvf linux-4.4.88.tar.bz2
+
<br clear=all>
# cd /usr/local
 
# rm linux
 
# ln -s linux-4.4.88 linux
 
# cd linux
 
# make menuconfig
 
# make
 
# make modules_install
 
# cp arch/x86_64/boot/bzImage /boot/vmlinuz-4.4.88-dom0
 
# cp System.map /boot/System.map-4.4.88-dom0
 
# cp .config /boot/config-4.4.88-dom0
 
  
We're now all set up, Xen is ready to be booted by grub2 !
+
{{pFoot|[[Asterisk]]|[[Main Page]]|[[Desktop software]]}}
 
 
<br/>
 
 
 
{{ pFoot |[[Compiling from Source]]|[[Main Page]]|[[Using Grub2]]}}
 

Revision as of 15:43, 21 March 2026

What is OwnCloud ?

OwnCloud is a file synchronization server. It affords keeping a hierarchy of files synchronized on different clients and operating systems.

The Owncloud install doc provided is for Ubuntu.

It is adapted below for Slackware 15.0.

Installing OwnCloud

OwnCloud is a PHP application. download tarball then untar and install.

# tar -C /usr/local -xvf owncloud-complete-20240724.tar.bz2
# chown -R apache:apache owncloud
# cd /var/www/htdocs
# ln -s /usr/local/owncloud owncloud
# chown -R apache:apache owncloud

Creating the occ helper script

occ is an OwnCloud administration command.

# FILE="/usr/local/bin/occ"
# cat <<EOM >$FILE
> #! /bin/bash
> cd /usr/local/owncloud
> sudo -E -u apache /usr/bin/php /usr/local/owncloud/occ "\$@"
> EOM
# chmod u+x $FILE

Creating the OwnCloud database

OwnCloud can use a variety of databases. We will be using MySQL. The database can be created as follows :

# mysql -u root -e \
  "CREATE DATABASE IF NOT EXISTS owncloud; \
  CREATE USER IF NOT EXISTS 'owncloud'@'localhost' IDENTIFIED BY 'password'; \
  GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' WITH GRANT OPTION; \
  FLUSH PRIVILEGES;"
# mysql -u root -e \
  CREATE USER 'owncloud'@'127.0.0.1' IDENTIFIED BY 'z0m8upnt';
  GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'127.0.0.1';
  FLUSH PRIVILEGES;
#

It is also possible to create user owncloud@localhost and database from phpmyadmin.

setting up the owncloud database

The admin user is the one who will manage the other users and OwnCloud from the OwnCloud web page.

# occ maintenance:install \
    --database "mysql" \
    --database-name "owncloud" \
    --database-user "owncloud" \
    --database-pass "password" \
    --data-dir "/var/www/htdocs/owncloud/data" \
    --admin-user "admin" \
    --admin-pass "admin"
ownCloud was successfully installed
#

Configure ownCloud’s Trusted Domains

# my_ip=$(hostname -I|cut -f1 -d ' ')
# occ config:system:set trusted_domains 1 --value="$my_ip"
System config value trusted_domains => 1 set to string x.y.z.t
# occ config:system:set trusted_domains 2 --value="$HOSTNAME"
System config value trusted_domains => 2 set to string your.domain.tld
#

Configure the cron jobs

Set your background job mode to cron:

# occ background:cron
Set mode for background jobs to 'cron'
#

Configure the execution of the cron job to every 15 min and the cleanup of chunks every night at 2 am:

# echo "MIN HOUR DAY MONTH DAYOFWEEK COMMAND" >> /var/spool/cron/crontabs/apache
# echo "*/15  *  *  *  * /var/www/htdocs/owncloud/occ system:cron" >> /var/spool/cron/crontabs/apache
# echo "0  2  *  *  * /var/www/htdocs/owncloud/occ dav:cleanup-chunks" >> /var/spool/cron/crontabs/apache
# chgrp apache /var/spool/cron/crontabs/apache
#

Configure Log Rotation

# FILE="/etc/logrotate.d/owncloud"
# cat <<EOM >$FILE
/var/www/htdocs/owncloud/data/owncloud.log {
size 10M
rotate 12
copytruncate
missingok
compress
compresscmd /bin/gzip
}
EOM
#


Asterisk Main Page Desktop software