├── .profile
├── README.md
├── conf
├── phpversion
└── phpversion.readme
├── home
├── .bash_aliases
├── .bash_vars
├── .bashrc
├── .config
│ └── mysql
│ │ └── nextcloud.cnf
├── .nano
│ └── syntax
│ │ ├── markdown.nanorc
│ │ └── nanorc.nanorc
├── .nanorc
├── bin
│ └── wu
├── etc
│ └── php
│ │ └── host
│ │ ├── nextcloud.bin
│ │ └── nextcloud.ini
└── html
└── httpdocs
├── default
├── favicon.ico
└── index.html
└── nextcloud
├── docs
├── PHP-INI.txt
├── UPGRADE.txt
└── screenshots
│ ├── nextcloud
│ └── cron.png
│ └── plesk
│ ├── README.txt
│ ├── php.png
│ ├── scheduler.png
│ ├── settings.png
│ └── webserver.png
├── nextcloud
├── config
│ └── data.config.php
├── pico.php
└── tmp
│ └── .htaccess
├── scripts
├── cronjob.sh
└── patch-htaccess.sh
└── wrapper
├── cron
└── occ
/.profile:
--------------------------------------------------------------------------------
1 | # Hack home
2 | export HOME="/home"
3 |
4 | # Switch to hacked home folder
5 | cd
6 |
7 | # Execute .bashrc
8 | if [ "$PS1" ]; then
9 | if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
10 | if [ -f ~/.bashrc ]; then
11 | . ~/.bashrc
12 | fi
13 | else
14 | PS1='$ '
15 | fi
16 | fi
17 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # webhosting-mods
2 | Various stuff for restricted webspaces
3 |
4 | # Compatibility
5 | Tested at netcup (ncLabs)
6 |
7 | # Credits
8 | * [perryflynn's parallels-shell-extensions](https://github.com/perryflynn/parallels-shell-extensions)
9 |
--------------------------------------------------------------------------------
/conf/phpversion:
--------------------------------------------------------------------------------
1 | 74
2 |
--------------------------------------------------------------------------------
/conf/phpversion.readme:
--------------------------------------------------------------------------------
1 | To set the default cli PHP version write the short PHP version string (e.g. "72" for php7.2) into the file /conf/phpversion
2 | We will re-link the PHP version in the first 15 minutes of every hour
3 | The following short PHP version strings are available on the CLI:
4 | 56
5 | 70
6 | 71
7 | 72
8 | 73
9 | 74
10 |
--------------------------------------------------------------------------------
/home/.bash_aliases:
--------------------------------------------------------------------------------
1 | alias ls="ls -lisah --color=auto"
2 |
3 | # NEXTCLOUD
4 | alias occ="/httpdocs/nextcloud/wrapper/occ"
5 | alias mysql-nc='mysql --defaults-file=~/.config/mysql/nextcloud.cnf'
6 |
--------------------------------------------------------------------------------
/home/.bash_vars:
--------------------------------------------------------------------------------
1 | NEXTCLOUD=/httpdocs/nextcloud
2 |
--------------------------------------------------------------------------------
/home/.bashrc:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | # Create a fancy prompt
4 | function farbige_shell
5 | {
6 | local GRAY="\[\033[1;30m\]"
7 | local LIGHT_GRAY="\[\033[0;37m\]"
8 | local CYAN="\[\033[0;36m\]"
9 | local LIGHT_CYAN="\[\033[1;36m\]"
10 | local NO_COLOUR="\[\033[0m\]"
11 | local BLUE="\[\033[0;34m\]"
12 | local LIGHT_BLUE="\[\033[1;34m\]"
13 | local RED="\[\033[0;31m\]"
14 | local LIGHT_RED="\[\033[1;31m\]"
15 | local GREEN="\[\033[1;32m\]"
16 | local LIGHT_GREEN="\[\033[1;32m\]"
17 | local PURPLE="\[\033[0;35m\]"
18 | local LIGHT_PURPLE="\[\033[1;35m\]"
19 | local BROWN="\[\033[0;33m\]"
20 | local YELLOW="\[\033[1;33m\]"
21 | local BLACK="\[\033[0;30m\]"
22 | local WHITE="\[\033[1;37m\]"
23 |
24 | PS1="\n$GREEN<$CYAN\u$GREEN> $GREEN[$CYAN\W$GREEN] $NO_COLOUR"
25 | }
26 | farbige_shell
27 |
28 | # Extend PATH
29 | if [ -d ~/bin ]; then
30 | export PATH="$PATH:~/bin"
31 | fi
32 |
33 | # Load variables
34 | if [ -f ~/.bash_vars ]; then
35 | . ~/.bash_vars
36 | fi
37 |
38 | # Load aliases
39 | if [ -f ~/.bash_aliases ]; then
40 | . ~/.bash_aliases
41 | fi
42 |
--------------------------------------------------------------------------------
/home/.config/mysql/nextcloud.cnf:
--------------------------------------------------------------------------------
1 | [client]
2 | host = 10.1.2.3
3 | user = k12345_nextcloud
4 | password = myssecretpassword
5 | #default-character-set = utf8mb4
6 | database = k12345_nextcloud
7 |
--------------------------------------------------------------------------------
/home/.nano/syntax/markdown.nanorc:
--------------------------------------------------------------------------------
1 | syntax "markdown" "\.md$" "\.markdown$"
2 |
3 | ## Quotations
4 | color cyan "^>.*"
5 |
6 | ## Emphasis
7 | color green "_[^_]*_"
8 | color green "\*[^\*]*\*"
9 |
10 | ## Strong emphasis
11 | color brightgreen "\*\*[^\*]*\*\*"
12 | color brightgreen "__[\_]*__"
13 |
14 | ## Underline headers
15 | color brightblue "^====(=*)"
16 | color brightblue "^----(-*)"
17 |
18 | ## Hash headers
19 | color brightblue "^#.*"
20 |
21 | ## Linkified URLs (and inline html tags)
22 | color brightmagenta start="<" end=">"
23 |
24 | ## Links
25 | color brightmagenta "\[.*\](\([^\)]*\))?"
26 |
27 | ## Link id's:
28 | color brightmagenta "^\[.*\]:( )+.*"
29 |
30 | ## Code spans
31 | color brightyellow "`[^`]*`"
32 |
33 | ## Links and inline images
34 | color brightmagenta start="!\[" end="\]"
35 | color brightmagenta start="\[" end="\]"
36 |
37 | ## Lists
38 | color yellow "^( )*(\*|\+|\-|[0-9]+\.) "
39 |
--------------------------------------------------------------------------------
/home/.nano/syntax/nanorc.nanorc:
--------------------------------------------------------------------------------
1 | syntax "nanorc" "\.?nanorc$"
2 |
3 | ## Possible errors and parameters
4 | icolor brightwhite "^[[:space:]]*((un)?set|include|syntax|i?color).*$"
5 |
6 | ## Keywords
7 | icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(autoindent|backup|backupdir|backwards|boldtext|brackets|casesensitive|const|cut|fill|historylog|matchbrackets|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|operatingdir|preserve|punct)\>" "^[[:space:]]*(set|unset)[[:space:]]+(quickblank|quotestr|rebinddelete|rebindkeypad|regexp|smarthome|smooth|speller|suspend|tabsize|tabstospaces|tempfile|view|whitespace|wordbounds)\>"
8 | icolor green "^[[:space:]]*(set|unset|include|syntax)\>"
9 |
10 | ## Colors
11 | icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>"
12 | icolor magenta "^[[:space:]]*i?color\>" "\<(start|end)="
13 |
14 | ## Strings
15 | icolor white ""(\\.|[^"])*""
16 |
17 | ## Comments
18 | icolor brightblue "^[[:space:]]*#.*$"
19 | icolor cyan "^[[:space:]]*##.*$"
20 |
--------------------------------------------------------------------------------
/home/.nanorc:
--------------------------------------------------------------------------------
1 | # Tabs sind bei uns immer schon 4 Zeichen lang.
2 | set tabsize 4
3 |
4 | # Lange Zeilen dürfen niemals umbrochen werden!
5 | set nowrap
6 |
7 | # Andauernde Anzeige der Zeilennummer/-position.
8 | set constantshow
9 |
10 | # Die erste Zeile nicht freilassen.
11 | set morespace
12 |
13 | # Suchbegriffe speichern.
14 | set historylog
15 |
16 | # Ermöglicht das Setzen des Cursors mit der Maus.
17 | # Funktioniert auch über SSH problemlos, hat aber
18 | # den gravierenden Nachteil, dass danach keine
19 | # Markierung von Text mehr möglich ist...
20 | unset mouse
21 |
22 | # Diverse gute Syntax Highlighter einbinden.
23 | # https://github.com/serialhex/nano-highlight
24 | include ~/.nano/syntax/markdown.nanorc
25 | include ~/.nano/syntax/nanorc.nanorc
26 |
--------------------------------------------------------------------------------
/home/bin/wu:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | ###########################################
3 | # #
4 | # WU v1.0.0 (Webspace Usage [DU Wrapper]) #
5 | # --------------------------------------- #
6 | # by Christian Schrötter (cs@fnx.li) #
7 | # #
8 | ###########################################
9 |
10 | set -eu -o pipefail
11 | shopt -s dotglob
12 | dir="${1:-.}"
13 |
14 | if [[ "$#" -gt 1 || ! -d "$dir" ]]
15 | then
16 | echo "Usage: $(basename "$0") [
]" 1>&2
17 | echo 1>&2
18 | echo "Webspace Usage - simple wrapper for DU command." 1>&2
19 | echo "Ignores non-writable directories at first level!" 1>&2
20 | exit 1
21 | fi
22 |
23 | pwd=$(pwd)
24 | cd -- "$dir"
25 | args=()
26 |
27 | if [[ "$dir" != "/" ]]
28 | then
29 | dir=$(sed -r 's#^\.(/|$)##' <<< "$dir")
30 | dir=$(sed -r 's#/+$##' <<< "$dir")
31 |
32 | if [[ ! -z "$dir" ]]
33 | then
34 | dir+="/"
35 | fi
36 | fi
37 |
38 | for file in ./*
39 | do
40 | if [[ -d "$file" && -w "$file" ]] || [[ -f "$file" ]]
41 | then
42 | args+=( "${dir}${file:2}" )
43 | fi
44 | done
45 |
46 | cd -- "$pwd" && du \
47 | --human-readable \
48 | --no-dereference \
49 | --one-file-system \
50 | --summarize \
51 | --time \
52 | --total \
53 | -- "${args[@]}"
54 | exit $?
55 |
--------------------------------------------------------------------------------
/home/etc/php/host/nextcloud.bin:
--------------------------------------------------------------------------------
1 | /usr/local/php80/bin/php
--------------------------------------------------------------------------------
/home/etc/php/host/nextcloud.ini:
--------------------------------------------------------------------------------
1 | [PHP]
2 | SMTP = localhost
3 | allow_url_fopen = On
4 | allow_url_include = Off
5 | asp_tags = Off
6 | auto_append_file =
7 | auto_globals_jit = On
8 | auto_prepend_file =
9 | bcmath.scale = 0
10 | cli_server.color = On
11 | date.timezone = "Europe/Vienna"
12 | default_charset = "UTF-8"
13 | default_mimetype = "text/html"
14 | default_socket_timeout = 60
15 | disable_classes =
16 | disable_functions = pcntl_exec,exec,passthru,shell_exec,system,proc_open,popen,show_source,fsockopen,socket_create,mail,putenv
17 | display_errors = On
18 | display_startup_errors = Off
19 | doc_root =
20 | enable_dl = Off
21 | engine = On
22 | error_reporting = 22519
23 | expose_php = Off
24 | file_uploads = On
25 | html_errors = On
26 | ibase.allow_persistent = 1
27 | ibase.dateformat = "%Y-%m-%d"
28 | ibase.max_links = -1
29 | ibase.max_persistent = -1
30 | ibase.timeformat = "%H:%M:%S"
31 | ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
32 | ignore_repeated_errors = Off
33 | ignore_repeated_source = Off
34 | implicit_flush = Off
35 | ldap.max_links = -1
36 | log_errors = Off
37 | log_errors_max_len = 1024
38 | mail.add_x_header = On
39 | max_execution_time = 180
40 | max_file_uploads = 20
41 | max_input_time = 60
42 | max_input_vars = 16000
43 | memory_limit = 1024M
44 | mssql.allow_persistent = On
45 | mssql.compatibility_mode = Off
46 | mssql.max_links = -1
47 | mssql.max_persistent = -1
48 | mssql.min_error_severity = 10
49 | mssql.min_message_severity = 10
50 | mssql.secure_connection = Off
51 | mysql.allow_local_infile = On
52 | mysql.allow_persistent = On
53 | mysql.cache_size = 2000
54 | mysql.connect_timeout = 60
55 | mysql.default_host =
56 | mysql.default_password =
57 | mysql.default_port =
58 | mysql.default_socket =
59 | mysql.default_user =
60 | mysql.max_links = -1
61 | mysql.max_persistent = -1
62 | mysql.trace_mode = Off
63 | mysqli.allow_persistent = On
64 | mysqli.cache_size = 2000
65 | mysqli.default_host =
66 | mysqli.default_port = 3306
67 | mysqli.default_pw =
68 | mysqli.default_socket =
69 | mysqli.default_user =
70 | mysqli.max_links = -1
71 | mysqli.max_persistent = -1
72 | mysqli.reconnect = Off
73 | mysqlnd.collect_memory_statistics = Off
74 | mysqlnd.collect_statistics = On
75 | odbc.allow_persistent = On
76 | odbc.check_persistent = On
77 | odbc.defaultbinmode = 1
78 | odbc.defaultlrl = 4096
79 | odbc.max_links = -1
80 | odbc.max_persistent = -1
81 | open_basedir = "/httpdocs/nextcloud/:/tmp/:/var/lib/php5/sessions:/var/lib/php/sessions:/tmp"
82 | output_buffering = 4096
83 | pdo_mysql.cache_size = 2000
84 | pdo_mysql.default_socket =
85 | pgsql.allow_persistent = On
86 | pgsql.auto_reset_persistent = Off
87 | pgsql.ignore_notice = 0
88 | pgsql.log_notice = 0
89 | pgsql.max_links = -1
90 | pgsql.max_persistent = -1
91 | post_max_size = 256M
92 | precision = 14
93 | register_argc_argv = Off
94 | report_memleaks = On
95 | request_order = "GP"
96 | serialize_precision = 17
97 | session.auto_start = 0
98 | session.cache_expire = 180
99 | session.cache_limiter = nocache
100 | session.cookie_domain =
101 | session.cookie_httponly =
102 | session.cookie_lifetime = 0
103 | session.cookie_path = /
104 | session.gc_divisor = 1000
105 | session.gc_maxlifetime = 1440
106 | session.gc_probability = 0
107 | session.hash_bits_per_character = 5
108 | session.hash_function = 0
109 | session.name = PHPSESSID
110 | session.referer_check =
111 | session.save_handler = files
112 | session.save_path = "/var/lib/php5/sessions"
113 | session.serialize_handler = php
114 | session.use_cookies = 1
115 | session.use_only_cookies = 1
116 | session.use_strict_mode = 0
117 | session.use_trans_sid = 0
118 | short_open_tag = Off
119 | smtp_port = 25
120 | soap.wsdl_cache_dir = "/tmp"
121 | soap.wsdl_cache_enabled = 1
122 | soap.wsdl_cache_limit = 5
123 | soap.wsdl_cache_ttl = 86400
124 | sql.safe_mode = Off
125 | sybct.allow_persistent = On
126 | sybct.max_links = -1
127 | sybct.max_persistent = -1
128 | sybct.min_client_severity = 10
129 | sybct.min_server_severity = 10
130 | tidy.clean_output = Off
131 | track_errors = Off
132 | unserialize_callback_func =
133 | upload_max_filesize = 256M
134 | upload_tmp_dir = "/httpdocs/nextcloud/nextcloud/tmp"
135 | url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
136 | user_dir =
137 | variables_order = "GPCS"
138 | zend.enable_gc = On
139 | zlib.output_compression = Off
140 |
--------------------------------------------------------------------------------
/home/html:
--------------------------------------------------------------------------------
1 | ../httpdocs
--------------------------------------------------------------------------------
/httpdocs/default/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/froonix/webhosting-mods/a7f7b1d2be9ea7d2f574e70abd3fbf0ac4d03b51/httpdocs/default/favicon.ico
--------------------------------------------------------------------------------
/httpdocs/default/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Hier entsteht eine neue Webseite.
7 |
30 |
31 |
32 |
33 |
Hier entsteht eine neue Webseite
34 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/httpdocs/nextcloud/docs/PHP-INI.txt:
--------------------------------------------------------------------------------
1 | disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,passthru,shell_exec,system,proc_open,popen,show_source,fsockopen,socket_create,mail,putenv,
2 |
--------------------------------------------------------------------------------
/httpdocs/nextcloud/docs/UPGRADE.txt:
--------------------------------------------------------------------------------
1 | # Move away custom stuff:
2 | mv -vn ../nextcloud/{tmp,pico.php} ../
3 |
4 | # Now start updating via WebUI!
5 | # ...
6 |
7 | # Move back custom stuff:
8 | mv -vn ../{tmp,pico.php} ../nextcloud/
9 |
10 | # Update .htaccess mod_rewrite rules:
11 | ../scripts/patch-htaccess.sh
12 |
--------------------------------------------------------------------------------
/httpdocs/nextcloud/docs/screenshots/nextcloud/cron.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/froonix/webhosting-mods/a7f7b1d2be9ea7d2f574e70abd3fbf0ac4d03b51/httpdocs/nextcloud/docs/screenshots/nextcloud/cron.png
--------------------------------------------------------------------------------
/httpdocs/nextcloud/docs/screenshots/plesk/README.txt:
--------------------------------------------------------------------------------
1 | Afterwards changed settings / not visible at screenshots:
2 |
3 | * allow_url_fopen = On
4 |
--------------------------------------------------------------------------------
/httpdocs/nextcloud/docs/screenshots/plesk/php.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/froonix/webhosting-mods/a7f7b1d2be9ea7d2f574e70abd3fbf0ac4d03b51/httpdocs/nextcloud/docs/screenshots/plesk/php.png
--------------------------------------------------------------------------------
/httpdocs/nextcloud/docs/screenshots/plesk/scheduler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/froonix/webhosting-mods/a7f7b1d2be9ea7d2f574e70abd3fbf0ac4d03b51/httpdocs/nextcloud/docs/screenshots/plesk/scheduler.png
--------------------------------------------------------------------------------
/httpdocs/nextcloud/docs/screenshots/plesk/settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/froonix/webhosting-mods/a7f7b1d2be9ea7d2f574e70abd3fbf0ac4d03b51/httpdocs/nextcloud/docs/screenshots/plesk/settings.png
--------------------------------------------------------------------------------
/httpdocs/nextcloud/docs/screenshots/plesk/webserver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/froonix/webhosting-mods/a7f7b1d2be9ea7d2f574e70abd3fbf0ac4d03b51/httpdocs/nextcloud/docs/screenshots/plesk/webserver.png
--------------------------------------------------------------------------------
/httpdocs/nextcloud/nextcloud/config/data.config.php:
--------------------------------------------------------------------------------
1 |
3 | Require all denied
4 |
5 |
6 | Order Allow,Deny
7 | Deny from all
8 | Satisfy All
9 |
10 |
11 | # Section for Apache 2.2
12 |
13 |
14 |
15 | Order Allow,Deny
16 | Deny from all
17 |
18 | Satisfy All
19 |
20 |
21 |
22 | # Section for Apache 2.2 to 2.6
23 |
24 | IndexIgnore *
25 |
26 |
--------------------------------------------------------------------------------
/httpdocs/nextcloud/scripts/cronjob.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euf -o pipefail
3 | cd "$(dirname "$0")"
4 |
5 | ../wrapper/cron \
6 | && exit 0; exit 1
7 |
--------------------------------------------------------------------------------
/httpdocs/nextcloud/scripts/patch-htaccess.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -euf -o pipefail
3 | file="$(dirname "$0")/../nextcloud/.htaccess"
4 | sed -i -r 's~^( RewriteRule . index.php.+)$~ RewriteCond %{REQUEST_FILENAME} !/pico.php\n\1~' "$file"
5 | sed -i -r 's~^( Options -MultiViews)$~\1\n RewriteRule ^favicon\.ico$ /apps/theming/favicon [L,R]\n RewriteRule ^(sites($|/[^/]+))$ $1/ [L,R]\n RewriteRule ^sites/ pico.php [L]~' "$file"
6 | echo -e "\n# File patched by sed substitute script.\n# Added lines: pico.php and sites rules.\n" >> "$file"
7 |
--------------------------------------------------------------------------------
/httpdocs/nextcloud/wrapper/cron:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | /home/etc/php/host/nextcloud.bin \
3 | -c /home/etc/php/host/nextcloud.ini \
4 | -f "$(dirname "$0")/../nextcloud/cron.php" \
5 | -- "$@"
6 | exit $?
7 |
--------------------------------------------------------------------------------
/httpdocs/nextcloud/wrapper/occ:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | /home/etc/php/host/nextcloud.bin \
3 | -c /home/etc/php/host/nextcloud.ini \
4 | -f "$(dirname "$0")/../nextcloud/occ" \
5 | -- "$@"
6 | exit $?
7 |
--------------------------------------------------------------------------------