https://wiki.archlinux.org/api.php?action=feedcontributions&user=Qlonik&feedformat=atomArchWiki - User contributions [en]2024-03-28T08:37:41ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Xbindkeys&diff=355272Xbindkeys2015-01-04T02:27:39Z<p>Qlonik: add new option to change volume for a sink for pulseaudio</p>
<hr />
<div>[[Category:Keyboards]]<br />
[[Category:X Server]]<br />
[[fr:Xbindkeys]]<br />
[[ru:Xbindkeys]]<br />
[[tr:Xbindkeys]]<br />
{{Related articles start}}<br />
{{Related|Xmodmap}}<br />
{{Related articles end}}<br />
<br />
Xbindkeys is a program that enables us to bind commands to certain keys or key combinations on the keyboard. Xbindkeys works with multimedia keys and is window manager / DE independent, so if you switch much, xbindkeys is very handy. <br />
<br />
== Installation ==<br />
<br />
[[pacman|Install]] Xbindkeys with the package {{Pkg|xbindkeys}}, available in the [[official repositories]].<br />
<br />
For those who prefer a GUI, there is the {{AUR|xbindkeys_config}} package in the [[AUR]].<br />
<br />
== Configuration ==<br />
<br />
Create a file named {{ic|.xbindkeysrc}} in your home directory:<br />
$ touch ~/.xbindkeysrc<br />
<br />
Alternatively, you can create a sample file by invoking<br />
$ xbindkeys -d > ~/.xbindkeysrc<br />
<br />
Now you can either edit {{ic|~/.xbindkeysrc}} to set keybindings, or you can do that with the GUI.<br />
<br />
=== Xbindkeysrc ===<br />
<br />
To see the format of a configuration file entry, enter the following command:<br />
$ xbindkeys -k<br />
<br />
A blank window will pop up. Press the key(s) to which you wish to assign a command and ''xbindkeys'' will output a handy snippet that can be entered into {{ic|~/.xbindkeysrc}}. For example, while the blank window is open, press {{ic|Alt+o}} to get the following output (results may vary):<br />
"(Scheme function)"<br />
m:0x8 + c:32<br />
Alt + o<br />
<br />
The first line represents a command. The second contains the state (0x8) and keycode (32) as reported by {{ic|xev}}. The third line contains the keysyms associated with the given keycodes. To use this output, copy either one of the last two lines to {{ic|~/.xbindkeysrc}} and replace "(Scheme function)" with the command you wish to perform. Here is an example configuration file that binds Fn key combos on a laptop to {{AUR|pamixer}} commands that adjust sound volume. Note that pound (#) symbols can be used to create comments.<br />
# Increase volume<br />
"pamixer --increase 5"<br />
XF86AudioRaiseVolume<br />
<br />
# Decrease volume<br />
"pamixer --decrease 5"<br />
m:0x0 + c:122<br />
or<br />
"pamixer --decrease 5"<br />
XF86AudioLowerVolume<br />
<br />
Alternatively, instead of {{AUR|pamixer}} it is also possible to use ''pactl'' to control a running [[PulseAudio]] and to change volume level (replace above ''pamixer'' command with the following):<br />
pactl set-sink-volume 0 -- +2%<br />
pactl set-sink-volume 0 -- -2%<br />
pactl set-sink-mute 0 toggle<br />
<br />
Instead of setting forcefully sink number it is possible to use {{ic|@DEFAULT_SINK@}}:<br />
pactl set-sink-volume @DEFAULT_SINK@ -- +2%<br />
pactl set-sink-volume @DEFAULT_SINK@ -- -2%<br />
pactl set-sink-mute @DEFAULT_SINK@ toggle<br />
<br />
Another possibilty is to use amixer (part of the alsa-utils package)<br />
amixer -c 1 set Master 5+<br />
amixer -c 1 set Master 5-<br />
amixer -c 1 set Master toggle<br />
<br />
<br />
{{Tip|Use {{ic|xbindkeys -mk}} to keep the key prompt open for multiple keypresses. Press {{ic|q}} to quit.}}<br />
<br />
=== GUI method ===<br />
<br />
If you installed the xbindkeys_config package (in the AUR), just run:<br />
$ xbindkeys_config<br />
<br />
== Usage ==<br />
<br />
Once you're done configuring your keys, edit your {{ic|~/.xinitrc}} and place <br />
xbindkeys<br />
<br />
before the line that starts your window manager or DE.<br />
<br />
== Simulating multimedia keys ==<br />
<br />
The XF86Audio* and other multimedia keys [http://wiki.linuxquestions.org/wiki/XF86_keyboard_symbols] are pretty-much well-recognized by the major DEs. For keyboards without such keys, you can simulate their effect with other keys<br />
# Decrease volume on pressing Super-minus<br />
"amixer set Master playback 1-"<br />
m:0x50 + c:20<br />
Mod2+Mod4 + minus<br />
However, to actually call the keys themselves you can use tools like xdotool [http://www.semicomplete.com/projects/xdotool/] (its in official repositories) and xmacro [http://xmacro.sourceforge.net/] (in the AUR). Unfortunately since you'd already be holding down some modifier key (Super or Shift, for example), X will see the result as {{ic|Super-XF86AudioLowerVolume}} which won't do anything useful. Here's a script based on ''xmacro'' and ''xmodmap'' from the {{Pkg|xorg-server-utils}} package for doing this[https://bbs.archlinux.org/viewtopic.php?pid=843395].<br />
{{bc|<br />
#!/bin/sh<br />
echo 'KeyStrRelease Super_L KeyStrRelease minus' | xmacroplay :0<br />
xmodmap -e 'remove Mod4 = Super_L'<br />
echo 'KeyStrPress XF86AudioLowerVolume KeyStrRelease XF86AudioLowerVolume' | xmacroplay :0<br />
xmodmap -e 'add Mod4 = Super_L'<br />
}}<br />
This works for calling XF86AudioLowerVolume once (assuming you are using {{ic|Super+minus}}), but repeatedly calling it without releasing the Super key (like tapping on a volume button) does not work. If you would like it to work that way, add the following line to the bottom of the script.<br />
echo 'KeyStrPress Super_L' | xmacroplay :0<br />
With this modified script, if you press the key combination fast enough your Super_L key will remain 'on' till the next time you hit it, which may result in some interesting side-effects. Just tap it again to remove that state, or use the original script if you want things to 'just work' and do not mind not multi-tapping on volume up/down.<br />
<br />
These instructions are valid for pretty much any one of the XF86 multimedia keys (important ones would be XF86AudioRaiseVolume, XF86AudioLowerVolume, XF86AudioPlay, XF86AudioPrev, XF86AudioNext).<br />
<br />
== Troubleshooting ==<br />
<br />
If, for any reason, a hotkey you ''already'' set in {{ic|~/.xbindkeysrc}} doesn't work, open up a terminal and type the following:<br />
$ xbindkeys -n<br />
<br />
By pressing the non-working key, you will be able to see any error ''xbindkeys'' encounter (e.g: mistyped command/keycode,...).</div>Qlonikhttps://wiki.archlinux.org/index.php?title=Nextcloud&diff=279221Nextcloud2013-10-21T02:31:17Z<p>Qlonik: remove not working method</p>
<hr />
<div>[[Category:Web Server]]<br />
[[fr:Owncloud]]<br />
[[ja:Owncloud]]<br />
From [[Wikipedia:ownCloud|Wikipedia]]:<br />
: ''ownCloud is a software suite that provides a location-independent storage area for data (cloud storage).''<br />
<br />
== Installation ==<br />
<br />
{{AUR|owncloud}} is available in the [[AUR]].<br />
# First of all set up the [[LAMP]] stack. You will probably need to install the MDB2 pear package as well: {{ic|# pear install mdb2}}<br />
# Install the {{AUR|owncloud}} package as described in [[AUR#Installing_packages|AUR wiki page]].<br />
# Copy {{ic|/usr/share/doc/owncloud/examples/apache.conf_example}} to {{ic|/etc/httpd/conf/extra/owncloud.conf}} (if using owncloud-git)<br />
# Add the following lines into {{ic|/etc/httpd/conf/httpd.conf}} (php5 should have been configured during the LAMP stack setup):<br />
Include /etc/httpd/conf/extra/owncloud.conf<br />
LoadModule php5_module modules/libphp5.so<br />
Include conf/extra/php5_module.conf<br />
Uncomment extensions in {{ic|/etc/php/php.ini}}:<br />
gd.so<br />
intl.so<br />
openssl.so<br />
xmlrpc.so<br />
zip.so<br />
iconv.so<br />
Depending on which database backend you are going to use uncomment either one of the following extensions in {{ic|/etc/php/php.ini}}:<br />
sqlite.so<br />
sqlite3.so<br />
pdo_sqlite.so<br />
'''or''':<br />
mysql.so<br />
mysqli.so<br />
pdo_mysql.so<br />
Now [[Daemons#Restarting|restart]] httpd (Apache) and open [http://localhost http://localhost] in your browser. You should now be able to create a user account and follow the installation wizard.<br />
<br />
== Custom configurations ==<br />
<br />
=== Filesize limitations ===<br />
<br />
With the default configuration ownCloud only allows the upload of filesizes less than 2MB.<br />
This can be changed by changing the following line in {{ic|/etc/php/php.ini}} to your liking.<br />
<br />
'''As of version 4.0 this is no longer necessary! The maximum upload size is now set via the ownCloud gui'''<br />
upload_max_filesize = 2M<br />
<br />
As of version 4.5, upload limits are set in {{ic|/usr/share/webapps/owncloud/.htaccess}}. This won't work if [[LAMP#Using_php5_with_apache2-mpm-worker_and_mod_fcgid|PHP is set up to run as CGI]], so you need to change the limits in {{ic|/etc/php/php.ini}}. You also need to change open_basedir.<br />
{{bc|<nowiki><br />
upload_max_filesize = 512M<br />
post_max_size = 512M<br />
memory_limit = 512M<br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/<br />
</nowiki>}}<br />
<br />
=== Running ownCloud in a subdirectory ===<br />
<br />
By including the default '''owncloud.conf''' in '''httpd.conf''', owncloud will take control of port 80 and your localhost domain. If you would like to have owncloud run in a subdirectory, then skip the 'Include /etc/httpd/conf/extra/owncloud.conf' line altogether and just use a symbolic link like so: <br />
# ln -s /usr/share/webapps/owncloud/ /srv/http/<br />
<br />
In that case, you'll also have to ensure /usr/share/webapps is in the open_basedir line of php.ini, and that per-directory .htaccess files are read by apache. <br />
<br />
Alternatively, you could follow the standard procedure, but comment out the VirtualHost part of the include file, and skip the symlink/basedir/htaccess part.<br />
<br />
== Filling ownCloud with data ==<br />
<br />
=== Small files ===<br />
<br />
==== WebDav ====<br />
<br />
Always use [[WebDAV]] or the web interface to add new files to your ownCloud. Otherwise they will not show up correctly, as they do not get indexed right.<br />
No further configuration is necessary to enable [[WebDAV]] uploads in ownCloud. <br />
<br />
Consider installing and enabling [[php-apc]] to speed up WebDAV.<br />
<br />
==== SABnzbd ====<br />
<br />
When using [[SABnzbd]], you might want to set<br />
folder_rename 0<br />
in your sabnzbd.ini file, because ownCloud will scan the files as soon as they get uploaded, preventing SABnzbd from removing UNPACKING prefixes etc.<br />
<br />
=== Big files ===<br />
<br />
WebDAV isn't suitable for big files, because it fills up all the RAM and CPU.<br />
<br />
With the current version, it looks like, there is no good way of copying huge amounts of data to your ownCloud.<br />
<br />
Here's a Workaround:<br />
<br />
Copy the files directly to your ownCloud and do a full re-scan of your database (you could use the [http://apps.owncloud.com/content/show.php?content=151948&forumpage=0&PHPSESSID=37b915160effcc0f37cc761ad2ab88be Re-scan filesystem] add-on for example).<br />
<br />
But beware that this will not work as easily in the future, when end-to-end encryption gets added to ownCloud (this is a planned feature).<br />
<br />
== Important notes ==<br />
<br />
* When using a subdomain (like cloud.example.net), make sure it is covered by your certificate. Otherwise, connection via the owncloud client or webdav might fail.<br />
<br />
* If you are planning on using OwnCloud's [http://owncloud.org/sync-clients/ sync-clients], make sure to have [[NTP]] installed and running on your OwnCloud server, otherwise the sync-clients will fail.<br />
<br />
* Add some [[LAMP#SSL|SSL encryption]] to your connection!<br />
(If adding SSL encryption as above, be sure to edit /etc/httpd/conf/extra/httpd-ssl.conf and change DocumentRoot "/srv/http" to DocumentRoot "/usr/share/webapps/owncloud" )<br />
<br />
* More Apps for ownCloud can be found [http://apps.owncloud.com/ here]<br />
<br />
* To install an new application, download the zip from the apps store, extract it into /srv/http/owncloud/apps/.<br />
Afterwards restart httpd:<br />
<br />
systemctl restart httpd<br />
<br />
log into your server go to the app sections you should see the new apps in there,<br />
<br />
== Nginx + uwsgi_php alternative ==<br />
<br />
You can avoid the use of Apache, and run owncloud in it's own process by using the [https://www.archlinux.org/packages/uwsgi-plugin-php wsgi_php] application server. uWSGI itself has a wealth of features to limit the resource use, and to harden the security of the application, and by being a separate process it can run under its own user.<br />
<br />
The nginx config is:<br />
{{bc|<nowiki><br />
#this is to avoid Request Entity Too Large error<br />
client_max_body_size 1000M;<br />
# deny access to some special files<br />
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {<br />
deny all;<br />
}<br />
# pass all .php or .php/path urls to uWSGI<br />
location ~ ^(.+\.php)(.*)$ {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
uwsgi_pass 127.0.0.1:3001;<br />
}<br />
# everything else goes to the filesystem,<br />
# but / will be mapped to index.php and run through uwsgi<br />
location / {<br />
root /usr/share/webapps/owncloud;<br />
index index.php;<br />
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;<br />
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;<br />
}<br />
</nowiki>}}<br />
The uWSGI /etc/uwsgi/owncloud.ini config file (run it with uwsgi_php --ini /etc/uwsgi/owncloud.ini):<br />
{{bc|<nowiki><br />
[uwsgi]<br />
socket = 127.0.0.1:3001<br />
master = true<br />
chdir = /srv/http/owncloud<br />
php-docroot = /usr/share/webapps/owncloud<br />
php-index = index.php<br />
<br />
# only allow these php files, I don't want to inadvertently run something else<br />
php-allowed-ext = /index.php<br />
php-allowed-ext = /public.php<br />
php-allowed-ext = /remote.php<br />
php-allowed-ext = /cron.php<br />
php-allowed-ext = /status.php<br />
php-allowed-ext = /settings/apps.php<br />
php-allowed-ext = /core/ajax/update.php<br />
php-allowed-ext = /core/ajax/share.php<br />
php-allowed-ext = /core/ajax/requesttoken.php<br />
php-allowed-ext = /core/ajax/translations.php<br />
php-allowed-ext = /search/ajax/search.php<br />
php-allowed-ext = /search/templates/part.results.php<br />
php-allowed-ext = /settings/admin.php<br />
php-allowed-ext = /settings/users.php<br />
php-allowed-ext = /settings/personal.php<br />
php-allowed-ext = /settings/help.php<br />
php-allowed-ext = /settings/ajax/getlog.php<br />
php-allowed-ext = /settings/ajax/setlanguage.php<br />
php-allowed-ext = /settings/ajax/setquota.php<br />
php-allowed-ext = /settings/ajax/userlist.php<br />
php-allowed-ext = /settings/ajax/createuser.php<br />
php-allowed-ext = /settings/ajax/removeuser.php<br />
php-allowed-ext = /settings/ajax/enableapp.php<br />
php-allowed-ext = /core/ajax/appconfig.php<br />
<br />
php-set = date.timezone=Europe/Skopje<br />
php-set = open_basedir=/srv/http/owncloud:/tmp/:/usr/share/pear/:/usr/share/webapps/owncloud<br />
<br />
processes = 10<br />
cheaper = 2<br />
cron = -1 -1 -1 -1 -1 /usr/bin/curl -H https://localhost/cron.php<br />
<br />
</nowiki>}}<br />
Finally, a simple systemd unit file to start the uwsgi instance can be (this is without using the emperor):<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=OwnCloud service via uWSGI-PHP<br />
<br />
[Service]<br />
User=http<br />
ExecStart=/usr/bin/uwsgi_php --ini /etc/uwsgi/owncloud.ini<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
KillSignal=SIGQUIT<br />
Restart=always<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Sync Clients ==<br />
<br />
The offical clients can be found in this page : [http://owncloud.org/install/ Sync Clients]<br />
Also take notice that while the offical owncloud android app is a payed app on the play store, it is not a payed app on [https://f-droid.org/ F-Droid].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Self-signed certificate not accepted ===<br />
<br />
OwnCloud uses [[Wikipedia:cURL]] and [[Wikipedia:SabreDAV]] to check if [[WebDAV]] is enabled. If you use a SSL/TLS with a self-signed certificate, e.g. as shown in [[LAMP]] and access ownClouds admin panel, you will see the following error message:<br />
<br />
Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.<br />
<br />
Assuming that you followed the [[LAMP]]-tutorial, execute the following steps:<br />
<br />
Create local directory for non-distribution certificates and copy [[LAMP]]s certificate there. This will prevent {{Ic|ca-certificates}}-updates to overwrite it.<br />
<br />
$ mkdir -p /usr/local/share/ca-certificates<br />
$ cp /etc/httpd/conf/server.crt /usr/local/share/ca-certificates/''WWW.EXAMPLE.COM.crt''<br />
<br />
Add ''WWW.EXAMPLE.COM.crt'' to {{ic|/etc/ca-certificates.conf}}:<br />
<br />
''WWW.EXAMPLE.COM.crt''<br />
<br />
Now, regenerate your certificate store:<br />
<br />
$ update-ca-certificates<br />
<br />
Restart the httpd service to activate your certificate.<br />
<br />
=== Can't create data directory (/path/to/dir) ===<br />
<br />
Check your httpd conf file (like owncloud.conf). Add your data dir to <br />
php_admin_value open_basedir "/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/path/to/dir/"<br />
<br />
Restart the httpd service to activate the change.<br />
<br />
=== CSync faild to find a specific file. ===<br />
<br />
Most probably a certificate issue, recreate it, and don't leave the common name empty or you will see the error again.<br />
<br />
openssl genrsa -out server.key 2048<br />
openssl req -new -key server.key -x509 -days 365 -out server.crt<br />
<br />
=== Seeing white page after login ===<br />
<br />
The cause is probably a new app that you installed, to fix that you can either use phpMyAdmin by editing the oc_appconfig table(in the case you got lucky and the table has edit option) or do it by hand with mysql:<br />
<br />
mysql -u root -p owncloud<br />
MariaDB [owncloud]> '''delete from''' oc_appconfig '''where''' appid='<nameOfExtension>' '''and''' configkey='enabled' '''and''' configvalue='yes'<br />
MariaDB [owncloud]> '''insert into''' oc_appconfig (appid,configkey,configvalue) '''values''' ('<nameOfExtension>','enabled','no');<br />
<br />
This should delete the relevant configuration from the table and add it again.</div>Qlonikhttps://wiki.archlinux.org/index.php?title=Nextcloud&diff=279213Nextcloud2013-10-20T21:22:54Z<p>Qlonik: change subtitle indent</p>
<hr />
<div>[[Category:Web Server]]<br />
[[fr:Owncloud]]<br />
[[ja:Owncloud]]<br />
From [[Wikipedia:ownCloud|Wikipedia]]:<br />
: ''ownCloud is a software suite that provides a location-independent storage area for data (cloud storage).''<br />
<br />
== Installation ==<br />
<br />
{{AUR|owncloud}} is available in the [[AUR]].<br />
# First of all set up the [[LAMP]] stack. You will probably need to install the MDB2 pear package as well: {{ic|# pear install mdb2}}<br />
# Install the {{AUR|owncloud}} package as described in [[AUR#Installing_packages|AUR wiki page]].<br />
# Copy {{ic|/usr/share/doc/owncloud/examples/apache.conf_example}} to {{ic|/etc/httpd/conf/extra/owncloud.conf}} (if using owncloud-git)<br />
# Add the following lines into {{ic|/etc/httpd/conf/httpd.conf}} (php5 should have been configured during the LAMP stack setup):<br />
Include /etc/httpd/conf/extra/owncloud.conf<br />
LoadModule php5_module modules/libphp5.so<br />
Include conf/extra/php5_module.conf<br />
Uncomment extensions in {{ic|/etc/php/php.ini}}:<br />
gd.so<br />
intl.so<br />
openssl.so<br />
xmlrpc.so<br />
zip.so<br />
iconv.so<br />
Depending on which database backend you are going to use uncomment either one of the following extensions in {{ic|/etc/php/php.ini}}:<br />
sqlite.so<br />
sqlite3.so<br />
pdo_sqlite.so<br />
'''or''':<br />
mysql.so<br />
mysqli.so<br />
pdo_mysql.so<br />
Now [[Daemons#Restarting|restart]] httpd (Apache) and open [http://localhost http://localhost] in your browser. You should now be able to create a user account and follow the installation wizard.<br />
<br />
== Custom configurations ==<br />
<br />
=== Filesize limitations ===<br />
<br />
With the default configuration ownCloud only allows the upload of filesizes less than 2MB.<br />
This can be changed by changing the following line in {{ic|/etc/php/php.ini}} to your liking.<br />
<br />
'''As of version 4.0 this is no longer necessary! The maximum upload size is now set via the ownCloud gui'''<br />
upload_max_filesize = 2M<br />
<br />
As of version 4.5, upload limits are set in {{ic|/usr/share/webapps/owncloud/.htaccess}}. This won't work if [[LAMP#Using_php5_with_apache2-mpm-worker_and_mod_fcgid|PHP is set up to run as CGI]], so you need to change the limits in {{ic|/etc/php/php.ini}}. You also need to change open_basedir.<br />
{{bc|<nowiki><br />
upload_max_filesize = 512M<br />
post_max_size = 512M<br />
memory_limit = 512M<br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/<br />
</nowiki>}}<br />
<br />
=== Running ownCloud in a subdirectory ===<br />
<br />
==== Method 1: Exclude owncloud.conf ====<br />
By including the default '''owncloud.conf''' in '''httpd.conf''', owncloud will take control of port 80 and your localhost domain. If you would like to have owncloud run in a subdirectory, then skip the 'Include /etc/httpd/conf/extra/owncloud.conf' line altogether and just use a symbolic link like so: <br />
# ln -s /usr/share/webapps/owncloud/ /srv/http/<br />
<br />
In that case, you'll also have to ensure /usr/share/webapps is in the open_basedir line of php.ini, and that per-directory .htaccess files are read by apache. <br />
<br />
Alternatively, you could follow the standard procedure, but comment out the VirtualHost part of the include file, and skip the symlink/basedir/htaccess part.<br />
<br />
==== Method 2: Modify owncloud.conf ====<br />
By changing this line in /etc/httpd/conf/extra/owncloud.conf <br />
<VirtualHost *:80><br />
to something like this<br />
<VirtualHost *:80/owncloud><br />
your owncloud will be available at example.com/owncloud<br />
<br />
== Filling ownCloud with data ==<br />
<br />
=== Small files ===<br />
<br />
==== WebDav ====<br />
<br />
Always use [[WebDAV]] or the web interface to add new files to your ownCloud. Otherwise they will not show up correctly, as they do not get indexed right.<br />
No further configuration is necessary to enable [[WebDAV]] uploads in ownCloud. <br />
<br />
Consider installing and enabling [[php-apc]] to speed up WebDAV.<br />
<br />
==== SABnzbd ====<br />
<br />
When using [[SABnzbd]], you might want to set<br />
folder_rename 0<br />
in your sabnzbd.ini file, because ownCloud will scan the files as soon as they get uploaded, preventing SABnzbd from removing UNPACKING prefixes etc.<br />
<br />
=== Big files ===<br />
<br />
WebDAV isn't suitable for big files, because it fills up all the RAM and CPU.<br />
<br />
With the current version, it looks like, there is no good way of copying huge amounts of data to your ownCloud.<br />
<br />
Here's a Workaround:<br />
<br />
Copy the files directly to your ownCloud and do a full re-scan of your database (you could use the [http://apps.owncloud.com/content/show.php?content=151948&forumpage=0&PHPSESSID=37b915160effcc0f37cc761ad2ab88be Re-scan filesystem] add-on for example).<br />
<br />
But beware that this will not work as easily in the future, when end-to-end encryption gets added to ownCloud (this is a planned feature).<br />
<br />
== Important notes ==<br />
<br />
* When using a subdomain (like cloud.example.net), make sure it is covered by your certificate. Otherwise, connection via the owncloud client or webdav might fail.<br />
<br />
* If you are planning on using OwnCloud's [http://owncloud.org/sync-clients/ sync-clients], make sure to have [[NTP]] installed and running on your OwnCloud server, otherwise the sync-clients will fail.<br />
<br />
* Add some [[LAMP#SSL|SSL encryption]] to your connection!<br />
(If adding SSL encryption as above, be sure to edit /etc/httpd/conf/extra/httpd-ssl.conf and change DocumentRoot "/srv/http" to DocumentRoot "/usr/share/webapps/owncloud" )<br />
<br />
* More Apps for ownCloud can be found [http://apps.owncloud.com/ here]<br />
<br />
* To install an new application, download the zip from the apps store, extract it into /srv/http/owncloud/apps/.<br />
Afterwards restart httpd:<br />
<br />
systemctl restart httpd<br />
<br />
log into your server go to the app sections you should see the new apps in there,<br />
<br />
== Nginx + uwsgi_php alternative ==<br />
<br />
You can avoid the use of Apache, and run owncloud in it's own process by using the [https://www.archlinux.org/packages/uwsgi-plugin-php wsgi_php] application server. uWSGI itself has a wealth of features to limit the resource use, and to harden the security of the application, and by being a separate process it can run under its own user.<br />
<br />
The nginx config is:<br />
{{bc|<nowiki><br />
#this is to avoid Request Entity Too Large error<br />
client_max_body_size 1000M;<br />
# deny access to some special files<br />
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {<br />
deny all;<br />
}<br />
# pass all .php or .php/path urls to uWSGI<br />
location ~ ^(.+\.php)(.*)$ {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
uwsgi_pass 127.0.0.1:3001;<br />
}<br />
# everything else goes to the filesystem,<br />
# but / will be mapped to index.php and run through uwsgi<br />
location / {<br />
root /usr/share/webapps/owncloud;<br />
index index.php;<br />
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;<br />
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;<br />
}<br />
</nowiki>}}<br />
The uWSGI /etc/uwsgi/owncloud.ini config file (run it with uwsgi_php --ini /etc/uwsgi/owncloud.ini):<br />
{{bc|<nowiki><br />
[uwsgi]<br />
socket = 127.0.0.1:3001<br />
master = true<br />
chdir = /srv/http/owncloud<br />
php-docroot = /usr/share/webapps/owncloud<br />
php-index = index.php<br />
<br />
# only allow these php files, I don't want to inadvertently run something else<br />
php-allowed-ext = /index.php<br />
php-allowed-ext = /public.php<br />
php-allowed-ext = /remote.php<br />
php-allowed-ext = /cron.php<br />
php-allowed-ext = /status.php<br />
php-allowed-ext = /settings/apps.php<br />
php-allowed-ext = /core/ajax/update.php<br />
php-allowed-ext = /core/ajax/share.php<br />
php-allowed-ext = /core/ajax/requesttoken.php<br />
php-allowed-ext = /core/ajax/translations.php<br />
php-allowed-ext = /search/ajax/search.php<br />
php-allowed-ext = /search/templates/part.results.php<br />
php-allowed-ext = /settings/admin.php<br />
php-allowed-ext = /settings/users.php<br />
php-allowed-ext = /settings/personal.php<br />
php-allowed-ext = /settings/help.php<br />
php-allowed-ext = /settings/ajax/getlog.php<br />
php-allowed-ext = /settings/ajax/setlanguage.php<br />
php-allowed-ext = /settings/ajax/setquota.php<br />
php-allowed-ext = /settings/ajax/userlist.php<br />
php-allowed-ext = /settings/ajax/createuser.php<br />
php-allowed-ext = /settings/ajax/removeuser.php<br />
php-allowed-ext = /settings/ajax/enableapp.php<br />
php-allowed-ext = /core/ajax/appconfig.php<br />
<br />
php-set = date.timezone=Europe/Skopje<br />
php-set = open_basedir=/srv/http/owncloud:/tmp/:/usr/share/pear/:/usr/share/webapps/owncloud<br />
<br />
processes = 10<br />
cheaper = 2<br />
cron = -1 -1 -1 -1 -1 /usr/bin/curl -H https://localhost/cron.php<br />
<br />
</nowiki>}}<br />
Finally, a simple systemd unit file to start the uwsgi instance can be (this is without using the emperor):<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=OwnCloud service via uWSGI-PHP<br />
<br />
[Service]<br />
User=http<br />
ExecStart=/usr/bin/uwsgi_php --ini /etc/uwsgi/owncloud.ini<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
KillSignal=SIGQUIT<br />
Restart=always<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Sync Clients ==<br />
<br />
The offical clients can be found in this page : [http://owncloud.org/install/ Sync Clients]<br />
Also take notice that while the offical owncloud android app is a payed app on the play store, it is not a payed app on [https://f-droid.org/ F-Droid].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Self-signed certificate not accepted ===<br />
<br />
OwnCloud uses [[Wikipedia:cURL]] and [[Wikipedia:SabreDAV]] to check if [[WebDAV]] is enabled. If you use a SSL/TLS with a self-signed certificate, e.g. as shown in [[LAMP]] and access ownClouds admin panel, you will see the following error message:<br />
<br />
Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.<br />
<br />
Assuming that you followed the [[LAMP]]-tutorial, execute the following steps:<br />
<br />
Create local directory for non-distribution certificates and copy [[LAMP]]s certificate there. This will prevent {{Ic|ca-certificates}}-updates to overwrite it.<br />
<br />
$ mkdir -p /usr/local/share/ca-certificates<br />
$ cp /etc/httpd/conf/server.crt /usr/local/share/ca-certificates/''WWW.EXAMPLE.COM.crt''<br />
<br />
Add ''WWW.EXAMPLE.COM.crt'' to {{ic|/etc/ca-certificates.conf}}:<br />
<br />
''WWW.EXAMPLE.COM.crt''<br />
<br />
Now, regenerate your certificate store:<br />
<br />
$ update-ca-certificates<br />
<br />
Restart the httpd service to activate your certificate.<br />
<br />
=== Can't create data directory (/path/to/dir) ===<br />
<br />
Check your httpd conf file (like owncloud.conf). Add your data dir to <br />
php_admin_value open_basedir "/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/path/to/dir/"<br />
<br />
Restart the httpd service to activate the change.<br />
<br />
=== CSync faild to find a specific file. ===<br />
<br />
Most probably a certificate issue, recreate it, and don't leave the common name empty or you will see the error again.<br />
<br />
openssl genrsa -out server.key 2048<br />
openssl req -new -key server.key -x509 -days 365 -out server.crt<br />
<br />
=== Seeing white page after login ===<br />
<br />
The cause is probably a new app that you installed, to fix that you can either use phpMyAdmin by editing the oc_appconfig table(in the case you got lucky and the table has edit option) or do it by hand with mysql:<br />
<br />
mysql -u root -p owncloud<br />
MariaDB [owncloud]> '''delete from''' oc_appconfig '''where''' appid='<nameOfExtension>' '''and''' configkey='enabled' '''and''' configvalue='yes'<br />
MariaDB [owncloud]> '''insert into''' oc_appconfig (appid,configkey,configvalue) '''values''' ('<nameOfExtension>','enabled','no');<br />
<br />
This should delete the relevant configuration from the table and add it again.</div>Qlonikhttps://wiki.archlinux.org/index.php?title=Nextcloud&diff=279212Nextcloud2013-10-20T21:20:25Z<p>Qlonik: /* Running ownCloud in a subdirectory */ add new method</p>
<hr />
<div>[[Category:Web Server]]<br />
[[fr:Owncloud]]<br />
[[ja:Owncloud]]<br />
From [[Wikipedia:ownCloud|Wikipedia]]:<br />
: ''ownCloud is a software suite that provides a location-independent storage area for data (cloud storage).''<br />
<br />
== Installation ==<br />
<br />
{{AUR|owncloud}} is available in the [[AUR]].<br />
# First of all set up the [[LAMP]] stack. You will probably need to install the MDB2 pear package as well: {{ic|# pear install mdb2}}<br />
# Install the {{AUR|owncloud}} package as described in [[AUR#Installing_packages|AUR wiki page]].<br />
# Copy {{ic|/usr/share/doc/owncloud/examples/apache.conf_example}} to {{ic|/etc/httpd/conf/extra/owncloud.conf}} (if using owncloud-git)<br />
# Add the following lines into {{ic|/etc/httpd/conf/httpd.conf}} (php5 should have been configured during the LAMP stack setup):<br />
Include /etc/httpd/conf/extra/owncloud.conf<br />
LoadModule php5_module modules/libphp5.so<br />
Include conf/extra/php5_module.conf<br />
Uncomment extensions in {{ic|/etc/php/php.ini}}:<br />
gd.so<br />
intl.so<br />
openssl.so<br />
xmlrpc.so<br />
zip.so<br />
iconv.so<br />
Depending on which database backend you are going to use uncomment either one of the following extensions in {{ic|/etc/php/php.ini}}:<br />
sqlite.so<br />
sqlite3.so<br />
pdo_sqlite.so<br />
'''or''':<br />
mysql.so<br />
mysqli.so<br />
pdo_mysql.so<br />
Now [[Daemons#Restarting|restart]] httpd (Apache) and open [http://localhost http://localhost] in your browser. You should now be able to create a user account and follow the installation wizard.<br />
<br />
== Custom configurations ==<br />
<br />
=== Filesize limitations ===<br />
<br />
With the default configuration ownCloud only allows the upload of filesizes less than 2MB.<br />
This can be changed by changing the following line in {{ic|/etc/php/php.ini}} to your liking.<br />
<br />
'''As of version 4.0 this is no longer necessary! The maximum upload size is now set via the ownCloud gui'''<br />
upload_max_filesize = 2M<br />
<br />
As of version 4.5, upload limits are set in {{ic|/usr/share/webapps/owncloud/.htaccess}}. This won't work if [[LAMP#Using_php5_with_apache2-mpm-worker_and_mod_fcgid|PHP is set up to run as CGI]], so you need to change the limits in {{ic|/etc/php/php.ini}}. You also need to change open_basedir.<br />
{{bc|<nowiki><br />
upload_max_filesize = 512M<br />
post_max_size = 512M<br />
memory_limit = 512M<br />
open_basedir = /srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/<br />
</nowiki>}}<br />
<br />
=== Running ownCloud in a subdirectory ===<br />
<br />
==Method 1: Exclude owncloud.conf==<br />
By including the default '''owncloud.conf''' in '''httpd.conf''', owncloud will take control of port 80 and your localhost domain. If you would like to have owncloud run in a subdirectory, then skip the 'Include /etc/httpd/conf/extra/owncloud.conf' line altogether and just use a symbolic link like so: <br />
# ln -s /usr/share/webapps/owncloud/ /srv/http/<br />
<br />
In that case, you'll also have to ensure /usr/share/webapps is in the open_basedir line of php.ini, and that per-directory .htaccess files are read by apache. <br />
<br />
Alternatively, you could follow the standard procedure, but comment out the VirtualHost part of the include file, and skip the symlink/basedir/htaccess part.<br />
<br />
==Method 2: Modify owncloud.conf==<br />
By changing this line in /etc/httpd/conf/extra/owncloud.conf <br />
<VirtualHost *:80><br />
to something like this<br />
<VirtualHost *:80/owncloud><br />
your owncloud will be available at example.com/owncloud<br />
<br />
== Filling ownCloud with data ==<br />
<br />
=== Small files ===<br />
<br />
==== WebDav ====<br />
<br />
Always use [[WebDAV]] or the web interface to add new files to your ownCloud. Otherwise they will not show up correctly, as they do not get indexed right.<br />
No further configuration is necessary to enable [[WebDAV]] uploads in ownCloud. <br />
<br />
Consider installing and enabling [[php-apc]] to speed up WebDAV.<br />
<br />
==== SABnzbd ====<br />
<br />
When using [[SABnzbd]], you might want to set<br />
folder_rename 0<br />
in your sabnzbd.ini file, because ownCloud will scan the files as soon as they get uploaded, preventing SABnzbd from removing UNPACKING prefixes etc.<br />
<br />
=== Big files ===<br />
<br />
WebDAV isn't suitable for big files, because it fills up all the RAM and CPU.<br />
<br />
With the current version, it looks like, there is no good way of copying huge amounts of data to your ownCloud.<br />
<br />
Here's a Workaround:<br />
<br />
Copy the files directly to your ownCloud and do a full re-scan of your database (you could use the [http://apps.owncloud.com/content/show.php?content=151948&forumpage=0&PHPSESSID=37b915160effcc0f37cc761ad2ab88be Re-scan filesystem] add-on for example).<br />
<br />
But beware that this will not work as easily in the future, when end-to-end encryption gets added to ownCloud (this is a planned feature).<br />
<br />
== Important notes ==<br />
<br />
* When using a subdomain (like cloud.example.net), make sure it is covered by your certificate. Otherwise, connection via the owncloud client or webdav might fail.<br />
<br />
* If you are planning on using OwnCloud's [http://owncloud.org/sync-clients/ sync-clients], make sure to have [[NTP]] installed and running on your OwnCloud server, otherwise the sync-clients will fail.<br />
<br />
* Add some [[LAMP#SSL|SSL encryption]] to your connection!<br />
(If adding SSL encryption as above, be sure to edit /etc/httpd/conf/extra/httpd-ssl.conf and change DocumentRoot "/srv/http" to DocumentRoot "/usr/share/webapps/owncloud" )<br />
<br />
* More Apps for ownCloud can be found [http://apps.owncloud.com/ here]<br />
<br />
* To install an new application, download the zip from the apps store, extract it into /srv/http/owncloud/apps/.<br />
Afterwards restart httpd:<br />
<br />
systemctl restart httpd<br />
<br />
log into your server go to the app sections you should see the new apps in there,<br />
<br />
== Nginx + uwsgi_php alternative ==<br />
<br />
You can avoid the use of Apache, and run owncloud in it's own process by using the [https://www.archlinux.org/packages/uwsgi-plugin-php wsgi_php] application server. uWSGI itself has a wealth of features to limit the resource use, and to harden the security of the application, and by being a separate process it can run under its own user.<br />
<br />
The nginx config is:<br />
{{bc|<nowiki><br />
#this is to avoid Request Entity Too Large error<br />
client_max_body_size 1000M;<br />
# deny access to some special files<br />
location ~ ^/(data|config|\.ht|db_structure\.xml|README) {<br />
deny all;<br />
}<br />
# pass all .php or .php/path urls to uWSGI<br />
location ~ ^(.+\.php)(.*)$ {<br />
include uwsgi_params;<br />
uwsgi_modifier1 14;<br />
uwsgi_pass 127.0.0.1:3001;<br />
}<br />
# everything else goes to the filesystem,<br />
# but / will be mapped to index.php and run through uwsgi<br />
location / {<br />
root /usr/share/webapps/owncloud;<br />
index index.php;<br />
rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;<br />
rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;<br />
}<br />
</nowiki>}}<br />
The uWSGI /etc/uwsgi/owncloud.ini config file (run it with uwsgi_php --ini /etc/uwsgi/owncloud.ini):<br />
{{bc|<nowiki><br />
[uwsgi]<br />
socket = 127.0.0.1:3001<br />
master = true<br />
chdir = /srv/http/owncloud<br />
php-docroot = /usr/share/webapps/owncloud<br />
php-index = index.php<br />
<br />
# only allow these php files, I don't want to inadvertently run something else<br />
php-allowed-ext = /index.php<br />
php-allowed-ext = /public.php<br />
php-allowed-ext = /remote.php<br />
php-allowed-ext = /cron.php<br />
php-allowed-ext = /status.php<br />
php-allowed-ext = /settings/apps.php<br />
php-allowed-ext = /core/ajax/update.php<br />
php-allowed-ext = /core/ajax/share.php<br />
php-allowed-ext = /core/ajax/requesttoken.php<br />
php-allowed-ext = /core/ajax/translations.php<br />
php-allowed-ext = /search/ajax/search.php<br />
php-allowed-ext = /search/templates/part.results.php<br />
php-allowed-ext = /settings/admin.php<br />
php-allowed-ext = /settings/users.php<br />
php-allowed-ext = /settings/personal.php<br />
php-allowed-ext = /settings/help.php<br />
php-allowed-ext = /settings/ajax/getlog.php<br />
php-allowed-ext = /settings/ajax/setlanguage.php<br />
php-allowed-ext = /settings/ajax/setquota.php<br />
php-allowed-ext = /settings/ajax/userlist.php<br />
php-allowed-ext = /settings/ajax/createuser.php<br />
php-allowed-ext = /settings/ajax/removeuser.php<br />
php-allowed-ext = /settings/ajax/enableapp.php<br />
php-allowed-ext = /core/ajax/appconfig.php<br />
<br />
php-set = date.timezone=Europe/Skopje<br />
php-set = open_basedir=/srv/http/owncloud:/tmp/:/usr/share/pear/:/usr/share/webapps/owncloud<br />
<br />
processes = 10<br />
cheaper = 2<br />
cron = -1 -1 -1 -1 -1 /usr/bin/curl -H https://localhost/cron.php<br />
<br />
</nowiki>}}<br />
Finally, a simple systemd unit file to start the uwsgi instance can be (this is without using the emperor):<br />
{{bc|<nowiki><br />
[Unit]<br />
Description=OwnCloud service via uWSGI-PHP<br />
<br />
[Service]<br />
User=http<br />
ExecStart=/usr/bin/uwsgi_php --ini /etc/uwsgi/owncloud.ini<br />
ExecReload=/bin/kill -HUP $MAINPID<br />
KillSignal=SIGQUIT<br />
Restart=always<br />
<br />
[Install]<br />
WantedBy=multi-user.target<br />
</nowiki>}}<br />
<br />
== Sync Clients ==<br />
<br />
The offical clients can be found in this page : [http://owncloud.org/install/ Sync Clients]<br />
Also take notice that while the offical owncloud android app is a payed app on the play store, it is not a payed app on [https://f-droid.org/ F-Droid].<br />
<br />
== Troubleshooting ==<br />
<br />
=== Self-signed certificate not accepted ===<br />
<br />
OwnCloud uses [[Wikipedia:cURL]] and [[Wikipedia:SabreDAV]] to check if [[WebDAV]] is enabled. If you use a SSL/TLS with a self-signed certificate, e.g. as shown in [[LAMP]] and access ownClouds admin panel, you will see the following error message:<br />
<br />
Your web server is not yet properly setup to allow files synchronization because the WebDAV interface seems to be broken.<br />
<br />
Assuming that you followed the [[LAMP]]-tutorial, execute the following steps:<br />
<br />
Create local directory for non-distribution certificates and copy [[LAMP]]s certificate there. This will prevent {{Ic|ca-certificates}}-updates to overwrite it.<br />
<br />
$ mkdir -p /usr/local/share/ca-certificates<br />
$ cp /etc/httpd/conf/server.crt /usr/local/share/ca-certificates/''WWW.EXAMPLE.COM.crt''<br />
<br />
Add ''WWW.EXAMPLE.COM.crt'' to {{ic|/etc/ca-certificates.conf}}:<br />
<br />
''WWW.EXAMPLE.COM.crt''<br />
<br />
Now, regenerate your certificate store:<br />
<br />
$ update-ca-certificates<br />
<br />
Restart the httpd service to activate your certificate.<br />
<br />
=== Can't create data directory (/path/to/dir) ===<br />
<br />
Check your httpd conf file (like owncloud.conf). Add your data dir to <br />
php_admin_value open_basedir "/srv/http/:/home/:/tmp/:/usr/share/pear/:/usr/share/webapps/:/path/to/dir/"<br />
<br />
Restart the httpd service to activate the change.<br />
<br />
=== CSync faild to find a specific file. ===<br />
<br />
Most probably a certificate issue, recreate it, and don't leave the common name empty or you will see the error again.<br />
<br />
openssl genrsa -out server.key 2048<br />
openssl req -new -key server.key -x509 -days 365 -out server.crt<br />
<br />
=== Seeing white page after login ===<br />
<br />
The cause is probably a new app that you installed, to fix that you can either use phpMyAdmin by editing the oc_appconfig table(in the case you got lucky and the table has edit option) or do it by hand with mysql:<br />
<br />
mysql -u root -p owncloud<br />
MariaDB [owncloud]> '''delete from''' oc_appconfig '''where''' appid='<nameOfExtension>' '''and''' configkey='enabled' '''and''' configvalue='yes'<br />
MariaDB [owncloud]> '''insert into''' oc_appconfig (appid,configkey,configvalue) '''values''' ('<nameOfExtension>','enabled','no');<br />
<br />
This should delete the relevant configuration from the table and add it again.</div>Qlonik