Difference between pages "X11 over the network" and "OwnCloud"

From Wikislax
(Difference between pages)
Jump to: navigation, search
(Xdm)
 
(Creating the OwnCloud database)
 
Line 1: Line 1:
 
{{RightTOC}}
 
{{RightTOC}}
  
Using X over the network affords accessing remote servers graphically as if you were on the console. So for instance, from your Windows workstation, you can run Windows and Linux side by side, full screen, and switch with function-key combinations such as alt-tab or ctrl-alt-F7 or F8. A very handy feature. X is natively present and fast on Linux. On Windows, it will always be a bit slower, and you need to install an X server. [https://sourceforge.net/projects/vcxsrv/ VcXrv] is a very competent one.
+
== What is OwnCloud ? ==
  
The software presenting an X window on a terminal is called an X server, which is contrary to what we are used to, as the X server is not on the server but actually on the client ! Over the Internet, you will always encapsulate X11 in SSH ('''X11 forwarding''', to configure in '''/etc/ssh/sshd_config''') as the X protocols are not secure. However, X needs a significant bandwidth so it is not likely that you will use it over an ADSL connection as it would be too slow. Optical fiber could be OK though.
+
[http://owncloud.com/ OwnCloud] is a file synchronization server. It affords keeping a hierarchy of files synchronized on different clients and operating systems.
  
For more information on using remote X applications, check this [http://www.xs4all.nl/~zweije/xauth.html mini-HOWTO] or this excellent [http://shop.oreilly.com/product/9780596101954.do O'Reilly book].
+
The [https://doc.owncloud.com/server/10.15/admin_manual/installation/quick_guides/ubuntu_20_04.html/ Owncloud install doc] provided is for Ubuntu.
  
== Xdm, Kdm, Gdm ==
+
It is adapted below for Slackware 15.0.
  
X requires a daemon on the server to handle connections. The base daemon is Xdm, that offers a graphical login directly under X, with no desktop manager. Access can be local on the computer console, or can be from an X terminal or X emulated terminal on the network.
+
== Installing OwnCloud ==
  
The KDE and Gnome desktop environments Kdm and Gdm come with Xdm variants that have a different look and feel. It is possible to run one or several of the three, provided that they will not compete for management of the same terminals.
+
OwnCloud is a PHP application. [https://owncloud.com/download-server download] tarball then untar and install.
  
However it makes sense to use only one. Kdm is a good choice as it affords choosing the Session Window Manager (Kde, Xfce4, ...) from the connection dialog box.
+
# 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
  
== Kdm ==
+
== Creating the occ helper script ==
  
For KDE to manage X terminals over the network, update '''/etc/kde/kdm/kdmrc''' specifying '''Enable=true''' for '''[Xdmcp]'''.
+
occ is an OwnCloud administration command.
  
In '''/etc/kde/kdm/Xaccess''', uncomment line '''#* # any host can get a login window''' to authorize connection from any incoming IP address (or to restrict usage to your local network).
+
# 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
  
Another trick using KDM : to be able to connect as root, update '''/etc/kde/kdm/kdmrc''', specifying '''AllowRootLogin=true''' for '''[X-*-Core]'''.
+
== Creating the OwnCloud database ==
  
== Xdm ==
+
OwnCloud can use a variety of databases. We will be using MySQL. The database can be created as follows :
  
In '''/etc/X11/xdm/xdm-config''', comment out the line '''#DisplayManager.requestPort:   0''' to authorize X terminal access from the network. Else port 177 won't be listened, as can be verified using '''nmap -sU localhost''', that lists the listening UDP ports. If checking with tcpdump, '''udp port xdmcp unreachable''' will be seen on the wire.
+
# 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;"
 +
#
  
In '''/etc/X11/xdm/Xaccess''', uncomment line  '''#* # any host can get a login window''' to authorize connection from any incoming IP address (or to restrict usage to your local network). In '''/etc/X11/xdm/Xservers''', comment out the line with ''':0''' to avoid getting an X login screen on the console.
+
It is also possible to create user owncloud@localhost and database from phpmyadmin.
  
To automatically launch '''xdm''' during Slackware init, add the following lines to '''/etc/rc.d/rc.local''' :
+
== setting up the owncloud database ==
  
# Xdm
+
The admin user is the one who will manage the other users and OwnCloud from the OwnCloud web page.
if [ -x /usr/X11/bin/xdm ]; then
 
        /usr/X11/bin/xdm
 
fi
 
  
== X11 firewalling ==
+
# 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
 +
#
  
At the firewall level, the X terminal must be able to contact the host using '''UDP 177''' and the host must be able to callback the X terminal using '''TCP 6000:6063'''. Open the corresponding ports, but to avoid login information to be sent over the wire, restrict usage to the local network :
+
== Configure ownCloud’s Trusted Domains ==
  
  # SSH-tunnelled X-Window output appears as input on interface lo
+
  # my_ip=$(hostname -I|cut -f1 -d ' ')
  iptables -A INPUT -p udp -j ACCEPT --dport 177 -s 192.168.0.0/24
+
  # occ config:system:set trusted_domains 1 --value="$my_ip"
  iptables -A INPUT -p tcp -j ACCEPT --dport 6000:6063 -m state --state NEW -s 192.168.0.0/24
+
System config value trusted_domains => 1 set to string x.y.z.t
  iptables -A INPUT -i lo -p tcp -j ACCEPT --dport 6000:6063 -m state --state NEW -s 192.168.0.0/24
+
  # occ config:system:set trusted_domains 2 --value="$HOSTNAME"
 +
System config value trusted_domains => 2 set to string your.domain.tld
 +
  #
  
For access from the Internet, il will be better to encapsulate X11 within an SSH session, using the X11 forwarding option. Due to encryption, this is however much slower. In this case, instead of KDE, prefer a less network-intensive window manager such as xfce4.
+
== Configure the cron jobs ==
  
== X11 server ==
+
Set your background job mode to cron:
  
The X terminal can be a Linux computer on which you run the X server to display X from a remote client. For instance typing '''nohup X -query <i>host</i> :1 &''' will display X from host <i>host</i> on virtual terminal 8. This way you will be able to keep local X and remote X side by side and switch between them using '''<ctrl><alt><F7>''' and '''<ctrl><alt><F8>'''.
+
# occ background:cron
 +
Set mode for background jobs to 'cron'
 +
#
  
The X terminal can also be a Windows PC equipped with an X emulator such as [https://sourceforge.net/projects/vcxsrv/ VcXrv] or other software found from the Internet. At the time of this writing though, such software is frustrating due to unstability or poor licensing conditions, so VcXrv seems to currently be the better choice, although a bit slow. <u>'''Note'''</u> : Specify in the configuration that you will be using XDMCP.
+
== Configure the execution of the cron job to every 15 min and the cleanup of chunks every night at 2 am: ==
  
== Windows firewall ==
+
# 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
 +
#
  
On Windows, use the firewall with «'''Allow exceptions'''» and create an entry in the firewall for the X11 protocol (port 6000), specifying in the scope the server IP address or the local network (not the Internet).
+
== Configure Log Rotation ==
  
<br/>
+
# 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
 +
#
  
{{pFoot|[[X11 configuration]]|[[Main Page]]|[[Compiling the Kernel]]}}
+
<br clear=all>
 +
 
 +
{{pFoot|[[Asterisk]]|[[Main Page]]|[[Desktop software]]}}

Revision as of 15:30, 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;"
#

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