diff --git a/README.md b/README.md
index d0fdbe4c..1dc7f1fa 100644
--- a/README.md
+++ b/README.md
@@ -13,12 +13,18 @@ Connect to your server as root via SSH
ssh root@your.server
```
-Download the installation script
+Download the installation script, and run it:
+```bash
+curl http://vestacp.com/pub/vst-install.sh | bash
+```
+
+If the above example does not work, try this 2 step method:
+
+Download the installation script:
```bash
curl -O http://vestacp.com/pub/vst-install.sh
```
-
-Run it
+Then run it:
```bash
bash vst-install.sh
```
diff --git a/bin/v-acknowledge-user-notification b/bin/v-acknowledge-user-notification
new file mode 100755
index 00000000..16a40e55
--- /dev/null
+++ b/bin/v-acknowledge-user-notification
@@ -0,0 +1,66 @@
+#!/bin/bash
+# info: update user notification
+# options: USER NOTIFICATION
+#
+# The function updates user notification.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument defenition
+user=$1
+nid=$2
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'USER NOTIFICATION'
+validate_format 'user' 'nid'
+is_object_valid 'user' 'USER' "$user"
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Updating notification
+update_object_value 'notifications' 'NID' "$nid" '$ACK' 'yes' 2>/dev/null
+
+# Checking last notification
+if [ -e "$USER_DATA/notifications.conf" ]; then
+ if [ -z "$(grep NID= $USER_DATA/notifications.conf)" ]; then
+ notice='no'
+ fi
+ if [ -z "$(grep "ACK='no'" $USER_DATA/notifications.conf)" ]; then
+ notice='no'
+ fi
+else
+ notice='no'
+fi
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+# Updating notification counter
+if [ "$notice" = 'no' ]; then
+ if [ -z "$(grep NOTIFICATIONS $USER_DATA/user.conf)" ]; then
+ sed -i "s/^TIME/NOTIFICATIONS='no'\nTIME/g" $USER_DATA/user.conf
+ else
+ update_user_value "$user" '$NOTIFICATIONS' "no"
+ fi
+fi
+
+# Logging
+log_event "$OK" "$EVENT"
+
+exit
diff --git a/bin/v-add-backup-ftp-host b/bin/v-add-backup-ftp-host
deleted file mode 100755
index e6c8d26c..00000000
--- a/bin/v-add-backup-ftp-host
+++ /dev/null
@@ -1,101 +0,0 @@
-#!/bin/bash
-# info: add backup ftp host
-# options: HOST USERNAME PASSWORD [PATH] [PORT]
-#
-# The function adds ftp host for system backups
-
-
-#----------------------------------------------------------#
-# Variable&Function #
-#----------------------------------------------------------#
-
-# Argument defenition
-host=$1
-ftp_user=$2
-ftp_password=$3
-ftp_path=${4-/backup}
-ftp_port=${5-21}
-A3='******'
-
-# Includes
-source $VESTA/func/main.sh
-source $VESTA/conf/vesta.conf
-
-# Defining ftp command function
-ftpc() {
- ftp -p -n $host $ftp_port <$PROXY_SYSTEM STATUS
"| tr '[:lower:]' '[:upper:]'
+ wget -qO- http://localhost:8084/
+ echo "
"
+fi
+
+# Displaying web server status
+echo "$WEB_SYSTEM STATUS
"| tr '[:lower:]' '[:upper:]'
+if [ "$WEB_SYSTEM" != 'nginx' ]; then
+ wget -qO- http://localhost:8081/server-status/ |\
+ egrep -v "html|DOCTYPE|h1>|title|head"
+else
+ wget -qO- http://localhost:8084/
+fi
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-list-user b/bin/v-list-user
index 817fb842..da4e96fd 100755
--- a/bin/v-list-user
+++ b/bin/v-list-user
@@ -73,16 +73,16 @@ conf=$USER_DATA/user.conf
HOME=$HOMEDIR/$user
# Defining fileds to select
-fields='$USER $FNAME $LNAME $PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE
- $DNS_TEMPLATE $WEB_DOMAINS $WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS
- $MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH
- $NS $SHELL $BACKUPS $CONTACT $CRON_REPORTS $RKEY $SUSPENDED
- $SUSPENDED_USERS $SUSPENDED_WEB $SUSPENDED_DNS $SUSPENDED_MAIL
- $SUSPENDED_DB $SUSPENDED_CRON $IP_AVAIL $IP_OWNED $U_USERS $U_DISK
- $U_DISK_DIRS $U_DISK_WEB $U_DISK_MAIL $U_DISK_DB $U_BANDWIDTH
- $U_WEB_DOMAINS $U_WEB_SSL $U_WEB_ALIASES $U_DNS_DOMAINS $U_DNS_RECORDS
- $U_MAIL_DOMAINS $U_MAIL_DKIM $U_MAIL_ACCOUNTS $U_DATABASES $U_CRON_JOBS
- $U_BACKUPS $LANGUAGE $HOME $TIME $DATE'
+fields='$USER $FNAME $LNAME $PACKAGE $WEB_TEMPLATE $BACKEND_TEMPLATE
+ $PROXY_TEMPLATE $DNS_TEMPLATE $WEB_DOMAINS $WEB_ALIASES $DNS_DOMAINS
+ $DNS_RECORDS $MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES $CRON_JOBS
+ $DISK_QUOTA $BANDWIDTH $NS $SHELL $BACKUPS $CONTACT $CRON_REPORTS
+ $RKEY $SUSPENDED $SUSPENDED_USERS $SUSPENDED_WEB $SUSPENDED_DNS
+ $SUSPENDED_MAIL $SUSPENDED_DB $SUSPENDED_CRON $IP_AVAIL $IP_OWNED
+ $U_USERS $U_DISK $U_DISK_DIRS $U_DISK_WEB $U_DISK_MAIL $U_DISK_DB
+ $U_BANDWIDTH $U_WEB_DOMAINS $U_WEB_SSL $U_WEB_ALIASES $U_DNS_DOMAINS
+ $U_DNS_RECORDS $U_MAIL_DOMAINS $U_MAIL_DKIM $U_MAIL_ACCOUNTS $U_DATABASES
+ $U_CRON_JOBS $U_BACKUPS $LANGUAGE $HOME $NOTIFICATIONS $TIME $DATE'
# Listing user
case $format in
diff --git a/bin/v-list-user-backup-exclusions b/bin/v-list-user-backup-exclusions
index cef78a03..87346aaa 100755
--- a/bin/v-list-user-backup-exclusions
+++ b/bin/v-list-user-backup-exclusions
@@ -74,6 +74,14 @@ is_object_valid 'user' 'USER' "$user"
# Action #
#----------------------------------------------------------#
+# Flush variables
+WEB=''
+DNS=''
+MAIL=''
+DB=''
+CRON=''
+USER=''
+
# Defining fileds to select
touch $USER_DATA/backup-excludes.conf
fields="\$WEB \$DNS \$MAIL \$DB \$CRON \$USER"
diff --git a/bin/v-list-user-favourites b/bin/v-list-user-favourites
new file mode 100755
index 00000000..8e1b8dee
--- /dev/null
+++ b/bin/v-list-user-favourites
@@ -0,0 +1,105 @@
+#!/bin/bash
+# info: list user favourites
+# options: USER [FORMAT]
+#
+# The function for getting the list of favourite user objects
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument defenition
+user=$1
+format=${2-shell}
+
+# Includes
+source $VESTA/func/main.sh
+
+# Json function
+json_list_favourites() {
+ i=1
+ fileds_count=$(echo "$fields" | wc -w)
+ fvrt_data=$(cat $USER_DATA/favourites.conf 2>/dev/null)
+ echo '{'
+ eval $fvrt_data
+ for field in $fields; do
+ eval value=$field
+ if [ $i -eq 1 ]; then
+ echo -e "\t\"$value\": {"
+ else
+ if [ $fileds_count -eq $i ]; then
+ echo -e "\t\t\"${field//$/}\": \"${value//,/, }\""
+ else
+ echo -e "\t\t\"${field//$/}\": \"${value//,/, }\","
+ fi
+ fi
+ (( ++i))
+ done
+ #if [ -n "$value" ]; then
+ echo -e ' }'
+ #fi
+ echo -e '}'
+}
+
+# Shell function
+shell_list_favourites() {
+ line=$(cat $USER_DATA/favourites.conf 2>/dev/null)
+ eval $line
+ for field in $fields; do
+ eval key="$field"
+ if [ -z "$key" ]; then
+ key='NULL'
+ fi
+ echo "${field//$/}: $key "
+ done
+}
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+# Checking args
+check_args '1' "$#" 'USER [FORMAT]'
+validate_format 'user'
+is_object_valid 'user' 'USER' "$user"
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Flushing vars
+USER=''
+WEB=''
+DNS=''
+DNS_REC=''
+MAIL=''
+MAIL_ACC=''
+DB=''
+CRON=''
+BACKUP=''
+IP=''
+PACKAGE=''
+FIREWALL=''
+
+# Defining fileds to select
+OBJ='Favourites'
+fields='$OBJ $USER $WEB $DNS $DNS_REC $MAIL $MAIL_ACC $DB $CRON $BACKUP
+ $IP $PACKAGE $FIREWALL'
+
+# Listing favourites
+case $format in
+ json) json_list_favourites ;;
+ plain) shell_list_favourites ;;
+ shell) shell_list_favourites | column -t ;;
+ *) check_args '1' '0' 'USER [FORMAT]'
+esac
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-list-user-notifications b/bin/v-list-user-notifications
new file mode 100755
index 00000000..160cf815
--- /dev/null
+++ b/bin/v-list-user-notifications
@@ -0,0 +1,97 @@
+#!/bin/bash
+# info: list user notifications
+# options: USER [FORMAT]
+#
+# The function for getting the list notifications
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument defenition
+user=$1
+format=${2-shell}
+
+# Includes
+source $VESTA/func/main.sh
+
+# Json function
+json_list_notifications() {
+ echo '{'
+ fileds_count=$(echo $fields| wc -w )
+ while read line; do
+ eval $line
+ if [ -n "$data" ]; then
+ echo -e ' },'
+ fi
+ i=1
+ IFS=' '
+ for field in $fields; do
+ eval value=\"$field\"
+ value=$(echo "$value"|sed -e 's/"/\\"/g' -e "s/%quote%/'/g")
+ if [ $i -eq 1 ]; then
+ (( ++i))
+ echo -e "\t\"$value\": {"
+ else
+ if [ $i -lt $fileds_count ]; then
+ (( ++i))
+ echo -e "\t\t\"${field//$/}\": \"${value//,/, }\","
+ else
+ echo -e "\t\t\"${field//$/}\": \"${value//,/, }\""
+ data=1
+ fi
+ fi
+ done
+ done < $conf
+ if [ -n "$data" ]; then
+ echo -e ' }'
+ fi
+ echo -e '}'
+}
+
+# Shell function
+shell_list_notifications() {
+ while read line ; do
+ eval $line
+ echo "$TOPIC" |sed -e "s/%quote%/'/g"
+ echo "$NOTICE" |sed -e "s/%quote%/'/g"
+ echo "$DATE $TIME"
+ echo "--"
+ echo
+ done < $conf
+}
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+# Checking args
+check_args '1' "$#" 'USER [FORMAT]'
+validate_format 'user'
+is_object_valid 'user' 'USER' "$user"
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Defining fileds to select
+conf=$USER_DATA/notifications.conf
+fields='$NID $TOPIC $NOTICE $TYPE $ACK $TIME $DATE'
+
+# Listing favourites
+case $format in
+ json) json_list_notifications ;;
+ plain) shell_list_notifications ;;
+ shell) shell_list_notifications ;;
+ *) check_args '1' '0' 'USER [FORMAT]'
+esac
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-list-user-packages b/bin/v-list-user-packages
index 17f7a1c3..3e189b01 100755
--- a/bin/v-list-user-packages
+++ b/bin/v-list-user-packages
@@ -19,7 +19,7 @@ source $VESTA/func/main.sh
json_list_pkgs() {
echo '{'
fileds_count=$(echo "$fields" | wc -w)
- for package in $(ls -t $VESTA/data/packages); do
+ for package in $(ls --sort=time $VESTA/data/packages |grep .pkg); do
PACKAGE=${package/.pkg/}
pkg_data=$(cat $VESTA/data/packages/$package)
eval $pkg_data
@@ -51,7 +51,7 @@ json_list_pkgs() {
# Shell fnction
shell_list_pkgs() {
- for package in $(ls -t $VESTA/data/packages); do
+ for package in $(ls -t $VESTA/data/packages |grep .pkg); do
PACKAGE=${package/.pkg/}
pkg_descr=$(cat $VESTA/data/packages/$package)
eval $pkg_descr
@@ -71,10 +71,10 @@ shell_list_pkgs() {
#----------------------------------------------------------#
# Defining fields
-fields='$PACKAGE $WEB_TEMPLATE $PROXY_TEMPLATE $DNS_TEMPLATE $WEB_DOMAINS
- $WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS $MAIL_DOMAINS $MAIL_ACCOUNTS
- $DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH $NS $SHELL $BACKUPS $TIME
- $DATE'
+fields='$PACKAGE $WEB_TEMPLATE $BACKEND_TEMPLATE $PROXY_TEMPLATE
+ $DNS_TEMPLATE $WEB_DOMAINS $WEB_ALIASES $DNS_DOMAINS $DNS_RECORDS
+ $MAIL_DOMAINS $MAIL_ACCOUNTS $DATABASES $CRON_JOBS $DISK_QUOTA $BANDWIDTH
+ $NS $SHELL $BACKUPS $TIME $DATE'
# Listing domains
case $format in
diff --git a/bin/v-list-users b/bin/v-list-users
index a6a6e645..d0f2ede6 100755
--- a/bin/v-list-users
+++ b/bin/v-list-users
@@ -73,16 +73,16 @@ shell_list_users() {
#----------------------------------------------------------#
# Defining fileds to select
-fields="\$USER \$FNAME \$LNAME \$PACKAGE \$WEB_TEMPLATE \$PROXY_TEMPLATE"
-fields="$fields \$DNS_TEMPLATE \$WEB_DOMAINS \$WEB_ALIASES \$DNS_DOMAINS"
-fields="$fields \$DNS_RECORDS \$MAIL_DOMAINS \$MAIL_ACCOUNTS \$DATABASES"
-fields="$fields \$CRON_JOBS \$DISK_QUOTA \$BANDWIDTH \$NS \$SHELL \$BACKUPS"
-fields="$fields \$CONTACT \$CRON_REPORTS \$RKEY \$SUSPENDED \$SUSPENDED_USERS"
-fields="$fields \$SUSPENDED_WEB \$SUSPENDED_DNS \$SUSPENDED_MAIL"
-fields="$fields \$SUSPENDED_DB \$SUSPENDED_CRON \$IP_AVAIL \$IP_OWNED"
-fields="$fields \$U_USERS \$U_DISK \$U_DISK_DIRS \$U_DISK_WEB \$U_DISK_MAIL"
-fields="$fields \$U_DISK_DB \$U_BANDWIDTH \$U_WEB_DOMAINS \$U_WEB_SSL"
-fields="$fields \$U_WEB_ALIASES \$U_DNS_DOMAINS \$U_DNS_RECORDS"
+fields="\$USER \$FNAME \$LNAME \$PACKAGE \$WEB_TEMPLATE \$BACKEND_TEMPLATE"
+fields="$fields \$PROXY_TEMPLATE \$DNS_TEMPLATE \$WEB_DOMAINS \$WEB_ALIASES"
+fields="$fields \$DNS_DOMAINS \$DNS_RECORDS \$MAIL_DOMAINS \$MAIL_ACCOUNTS"
+fields="$fields \$DATABASES \$CRON_JOBS \$DISK_QUOTA \$BANDWIDTH \$NS \$SHELL"
+fields="$fields \$BACKUPS \$CONTACT \$CRON_REPORTS \$RKEY \$SUSPENDED"
+fields="$fields \$SUSPENDED_USERS \$SUSPENDED_WEB \$SUSPENDED_DNS"
+fields="$fields \$SUSPENDED_MAIL \$SUSPENDED_DB \$SUSPENDED_CRON \$IP_AVAIL"
+fields="$fields \$IP_OWNED \$U_USERS \$U_DISK \$U_DISK_DIRS \$U_DISK_WEB"
+fields="$fields \$U_DISK_MAIL \$U_DISK_DB \$U_BANDWIDTH \$U_WEB_DOMAINS"
+fields="$fields \$U_WEB_SSL \$U_WEB_ALIASES \$U_DNS_DOMAINS \$U_DNS_RECORDS"
fields="$fields \$U_MAIL_DOMAINS \$U_MAIL_DKIM \$U_MAIL_ACCOUNTS"
fields="$fields \$U_DATABASES \$U_CRON_JOBS \$U_BACKUPS \$LANGUAGE"
fields="$fields \$TIME \$DATE"
diff --git a/bin/v-list-web-domain b/bin/v-list-web-domain
index 8a1c794d..fa3b1dea 100755
--- a/bin/v-list-web-domain
+++ b/bin/v-list-web-domain
@@ -76,8 +76,8 @@ conf=$USER_DATA/web.conf
# Defining fileds to select
fields='$DOMAIN $IP $IP6 $U_DISK $U_BANDWIDTH $TPL $ALIAS $STATS $STATS_USER
- $SSL $SSL_HOME $FTP_USER $FTP_PATH $PROXY $PROXY_EXT $DOCUMENT_ROOT
- $SUSPENDED $TIME $DATE'
+ $SSL $SSL_HOME $FTP_USER $FTP_PATH $BACKEND $PROXY $PROXY_EXT $AUTH_USER
+ $DOCUMENT_ROOT $SUSPENDED $TIME $DATE'
# Defining document root
DOCUMENT_ROOT="$HOMEDIR/$user/web/$domain/public_html"
diff --git a/bin/v-list-web-domain-accesslog b/bin/v-list-web-domain-accesslog
index 9fdff009..b066b2b2 100755
--- a/bin/v-list-web-domain-accesslog
+++ b/bin/v-list-web-domain-accesslog
@@ -1,6 +1,6 @@
#!/bin/bash
# info: list web domain access log
-# options: USER DOMAIN [LINES]
+# options: USER DOMAIN [LINES] [FORMAT]
#
# The function of obtaining raw access web domain logs.
@@ -12,33 +12,66 @@
# Argument defenition
user=$1
domain=$2
-lines=${3-70}
+ttl=${3-70}
+format=${4-shell}
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
+# Json function
+json_list_log() {
+ i=1
+ echo '['
+ for str in $lines; do
+ str=$(echo "$str" |sed -e 's/"/\\"/g')
+ if [ "$i" -lt "$counter" ]; then
+ echo -e "\t\"$str\","
+ else
+ echo -e "\t\"$str\""
+ fi
+ (( ++i))
+ done
+ echo "]"
+}
+
+# Shell function
+shell_list_log() {
+ echo "$lines"
+}
+
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
-check_args '2' "$#" 'USER DOMAIN [FORMAT]'
+check_args '2' "$#" 'USER DOMAIN [LINES] [FORMAT]'
+validate_format 'user' 'domain' 'ttl'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
+
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Check number of output lines
-if [ "$lines" -gt '3000' ]; then
+if [ "$ttl" -gt '3000' ]; then
read_cmd="cat"
else
- read_cmd="tail -n $lines"
+ read_cmd="tail -n $ttl"
fi
-$read_cmd /var/log/$WEB_SYSTEM/domains/$domain.log
+lines=$($read_cmd /var/log/$WEB_SYSTEM/domains/$domain.log)
+counter=$(echo "$lines" |wc -l)
+IFS=$'\n'
+
+# Listing logs
+case $format in
+ json) json_list_log ;;
+ plain) shell_list_log ;;
+ shell) shell_list_log ;;
+esac
#----------------------------------------------------------#
diff --git a/bin/v-list-web-domain-errorlog b/bin/v-list-web-domain-errorlog
index 04520213..f21b581a 100755
--- a/bin/v-list-web-domain-errorlog
+++ b/bin/v-list-web-domain-errorlog
@@ -1,6 +1,6 @@
#!/bin/bash
# info: list web domain error log
-# options: USER DOMAIN [LINES]
+# options: USER DOMAIN [LINES] [FORMAT]
#
# The function of obtaining raw error web domain logs.
@@ -12,33 +12,66 @@
# Argument defenition
user=$1
domain=$2
-lines=${3-70}
+ttl=${3-70}
+format=${4-shell}
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
+# Json function
+json_list_log() {
+ i=1
+ echo '['
+ for str in $lines; do
+ str=$(echo "$str" |sed -e 's/"/\\"/g')
+ if [ "$i" -lt "$counter" ]; then
+ echo -e "\t\"$str\","
+ else
+ echo -e "\t\"$str\""
+ fi
+ (( ++i))
+ done
+ echo "]"
+}
+
+# Shell function
+shell_list_log() {
+ echo "$lines"
+}
+
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
-check_args '2' "$#" 'USER DOMAIN [FORMAT]'
+check_args '2' "$#" 'USER DOMAIN [LINES] [FORMAT]'
+validate_format 'user' 'domain' 'ttl'
is_object_valid 'user' 'USER' "$user"
is_object_valid 'web' 'DOMAIN' "$domain"
+
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Check number of output lines
-if [ "$lines" -gt '3000' ]; then
+if [ "$ttl" -gt '3000' ]; then
read_cmd="cat"
else
- read_cmd="tail -n $lines"
+ read_cmd="tail -n $ttl"
fi
-$read_cmd /var/log/$WEB_SYSTEM/domains/$domain.error.log
+lines=$($read_cmd /var/log/$WEB_SYSTEM/domains/$domain.error.log)
+counter=$(echo "$lines" |wc -l)
+IFS=$'\n'
+
+# Listing logs
+case $format in
+ json) json_list_log ;;
+ plain) shell_list_log ;;
+ shell) shell_list_log ;;
+esac
#----------------------------------------------------------#
diff --git a/bin/v-list-web-domains b/bin/v-list-web-domains
index 95f06170..059f0e39 100755
--- a/bin/v-list-web-domains
+++ b/bin/v-list-web-domains
@@ -35,8 +35,8 @@ conf=$USER_DATA/web.conf
# Defining fileds to select
fields="\$DOMAIN \$IP \$IP6 \$U_DISK \$U_BANDWIDTH \$TPL \$ALIAS \$STATS"
-fields="$fields \$STATS_USER \$SSL \$SSL_HOME \$FTP_USER \$FTP_PATH"
-fields="$fields \$PROXY \$PROXY_EXT \$SUSPENDED \$TIME \$DATE"
+fields="$fields \$STATS_USER \$SSL \$SSL_HOME \$FTP_USER \$FTP_PATH \$AUTH_USER"
+fields="$fields \$BACKEND \$PROXY \$PROXY_EXT \$SUSPENDED \$TIME \$DATE"
# Listing domains
case $format in
diff --git a/bin/v-list-web-templates b/bin/v-list-web-templates
index d54bfc45..e4e472f1 100755
--- a/bin/v-list-web-templates
+++ b/bin/v-list-web-templates
@@ -18,7 +18,8 @@ source $VESTA/conf/vesta.conf
# Json function
json_list_wtpl() {
- templates=$(ls -t $WEBTPL/$WEB_SYSTEM | cut -f 1 -d '.' |sort -u )
+ templates=$(ls -t $WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/)
+ templates=$(echo "$templates" | grep "\.tpl" |cut -f 1 -d '.' )
t_counter=$(echo "$templates" | wc -w)
i=1
echo '['
@@ -35,7 +36,8 @@ json_list_wtpl() {
# Shell function
shell_list_wtpl() {
- templates=$(ls -t $WEBTPL/$WEB_SYSTEM | cut -f 1 -d '.' |sort -u )
+ templates=$(ls -t $WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/)
+ templates=$(echo "$templates" | grep "\.tpl" |cut -f 1 -d '.' )
if [ -z "$nohead" ]; then
echo "Templates"
echo "----------"
diff --git a/bin/v-list-web-templates-backend b/bin/v-list-web-templates-backend
new file mode 100755
index 00000000..dfcfee24
--- /dev/null
+++ b/bin/v-list-web-templates-backend
@@ -0,0 +1,73 @@
+#!/bin/bash
+# info: listing backend templates
+# options: [FORMAT]
+#
+# The function for obtaining the list of available backend templates.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument defenition
+format=${1-shell}
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+# Json function
+json_list_wtpl() {
+ t_counter=$(echo "$templates" | wc -w)
+ i=1
+ echo '['
+ for template in $templates; do
+ if [ "$i" -lt "$t_counter" ]; then
+ echo -e "\t\"$template\","
+ else
+ echo -e "\t\"$template\""
+ fi
+ (( ++i))
+ done
+ echo "]"
+ }
+
+# Shell function
+shell_list_wtpl() {
+ if [ -z "$nohead" ]; then
+ echo "Templates"
+ echo "----------"
+ fi
+ for template in $templates; do
+ echo "$template"
+ done
+}
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Proxy templates
+if [ -z "$WEB_BACKEND" ]; then
+ exit
+fi
+templates=$(ls -t $WEBTPL/$WEB_BACKEND |\
+ cut -f1 -d . |\
+ grep -v proxy_ip |\
+ sort -u )
+
+# Listing domains
+case $format in
+ json) json_list_wtpl ;;
+ plain) nohead=1; shell_list_wtpl ;;
+ shell) shell_list_wtpl ;;
+ *) check_args '1' '0' '[FORMAT]'
+esac
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-move-fs-directory b/bin/v-move-fs-directory
new file mode 100755
index 00000000..f101d995
--- /dev/null
+++ b/bin/v-move-fs-directory
@@ -0,0 +1,59 @@
+#!/bin/bash
+# info: move file
+# options: USER SRC_DIRECTORY DST_DIRECTORY
+#
+# The function moved file or directory on the file system. This function
+# can also be used to rename files just like normal mv command.
+
+user=$1
+src_dir=$2
+dst_dir=$3
+
+# Checking arguments
+if [ -z "$dst_dir" ]; then
+ echo "Usage: USER SRC_DIRECTORY DST_DIRECTORY"
+ exit 1
+fi
+
+# Checking vesta user
+if [ ! -e "$VESTA/data/users/$user" ]; then
+ echo "Error: vesta user $user doesn't exist"
+ exit 3
+fi
+
+# Checking user homedir
+homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
+if [ -z $homedir ]; then
+ echo "Error: user home directory doesn't exist"
+ exit 12
+fi
+
+# Checking source file
+if [ ! -d "$src_dir" ]; then
+ echo "Error: source directory $src_dir doesn't exist"
+ exit 3
+fi
+
+# Checking source path
+rpath=$(readlink -f "$src_dir")
+if [ -z "$(echo $rpath |egrep "^/tmp|^$homedir")" ]; then
+ echo "Error: invalid source path $src_dir"
+ exit 2
+fi
+
+# Checking destination path
+rpath=$(readlink -f "$dst_dir")
+if [ -z "$(echo $rpath |egrep "^/tmp|^$homedir")" ]; then
+ echo "Error: invalid destination path $dst_dir"
+ exit 2
+fi
+
+# Moving directory
+sudo -u $user mv "$src_dir" "$dst_dir" >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ echo "Error: directory $src_dir was not moved"
+ exit 3
+fi
+
+# Exiting
+exit
diff --git a/bin/v-move-fs-file b/bin/v-move-fs-file
new file mode 100755
index 00000000..3671e0e5
--- /dev/null
+++ b/bin/v-move-fs-file
@@ -0,0 +1,59 @@
+#!/bin/bash
+# info: move file
+# options: USER SRC_FILE DST_FLE
+#
+# The function moved file or directory on the file system. This function
+# can also be used to rename files just like normal mv command.
+
+user=$1
+src_file=$2
+dst_file=$3
+
+# Checking arguments
+if [ -z "$dst_file" ]; then
+ echo "Usage: USER SRC_FILE DST_FILE"
+ exit 1
+fi
+
+# Checking vesta user
+if [ ! -e "$VESTA/data/users/$user" ]; then
+ echo "Error: vesta user $user doesn't exist"
+ exit 3
+fi
+
+# Checking user homedir
+homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
+if [ -z $homedir ]; then
+ echo "Error: user home directory doesn't exist"
+ exit 12
+fi
+
+# Checking source file
+if [ ! -f "$src_file" ]; then
+ echo "Error: source file $src_file doesn't exist"
+ exit 3
+fi
+
+# Checking source path
+rpath=$(readlink -f "$src_file")
+if [ -z "$(echo $rpath |egrep "^/tmp|^$homedir")" ]; then
+ echo "Error: invalid source path $src_file"
+ exit 2
+fi
+
+# Checking destination path
+rpath=$(readlink -f "$dst_file")
+if [ -z "$(echo $rpath |egrep "^/tmp|^$homedir")" ]; then
+ echo "Error: invalid destination path $dst_file"
+ exit 2
+fi
+
+# Moving file
+sudo -u $user mv "$src_file" "$dst_file" >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ echo "Error: file $src_file was not moved"
+ exit 3
+fi
+
+# Exiting
+exit
diff --git a/bin/v-open-fs-file b/bin/v-open-fs-file
index d5c8ea3a..b04ad493 100755
--- a/bin/v-open-fs-file
+++ b/bin/v-open-fs-file
@@ -1,36 +1,46 @@
#!/bin/bash
-# File reader
+# info: open file
+# options: USER FILE
+#
+# The function opens/reads files on the file system
user=$1
-path=$2
+src_file=$2
# Checking arguments
-if [ -z "$path" ]; then
- echo "Usage: USER PATH"
+if [ -z "$src_file" ]; then
+ echo "Usage: USER FILE"
exit 1
fi
-# Checking users
+# Checking vesta user
if [ ! -e "$VESTA/data/users/$user" ]; then
- exit 1
+ echo "Error: vesta user $user doesn't exist"
+ exit 3
fi
-# Checking homedir
+# Checking user homedir
homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
if [ -z $homedir ]; then
- exit 1
+ echo "Error: user home directory doesn't exist"
+ exit 12
fi
# Checking path
-if [ ! -z "$path" ]; then
- # Validating absolute path
- rpath=$(readlink -f "$path")
- if [ -z "$(echo $rpath |grep $homedir)" ]; then
- exit 1
+if [ ! -z "$src_file" ]; then
+ rpath=$(readlink -f "$src_file")
+ if [ -z "$(echo $rpath |egrep "^/tmp|^$homedir")" ]; then
+ echo "Error: invalid source path $src_file"
+ exit 2
fi
fi
-cat "$path"
+# Reading file
+sudo -u $user cat "$src_file" 2>/dev/null
+if [ $? -ne 0 ]; then
+ echo "Error: file $src_file was not opened"
+ exit 3
+fi
+# Exiting
exit
-
diff --git a/bin/v-rebuild-cron-jobs b/bin/v-rebuild-cron-jobs
index 8fcd2da2..c4bac3ed 100755
--- a/bin/v-rebuild-cron-jobs
+++ b/bin/v-rebuild-cron-jobs
@@ -40,12 +40,10 @@ sync_cron_jobs
# Vesta #
#----------------------------------------------------------#
-# Restart crond
+# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Cron restart failed" >/dev/null
fi
# Logging
diff --git a/bin/v-rebuild-dns-domain b/bin/v-rebuild-dns-domain
index 7fdb0bd3..f21fad08 100755
--- a/bin/v-rebuild-dns-domain
+++ b/bin/v-rebuild-dns-domain
@@ -1,6 +1,6 @@
#!/bin/bash
# info: rebuild dns domain
-# options: USER DOMAIN [RESTART]
+# options: USER DOMAIN [RESTART] [UPDATE_SERIAL]
#
# The function rebuilds DNS configuration files.
@@ -13,6 +13,7 @@
user=$1
domain=$2
restart=$3
+update_serial=$4
# Includes
source $VESTA/func/main.sh
@@ -25,7 +26,7 @@ source $VESTA/conf/vesta.conf
# Verifications #
#----------------------------------------------------------#
-check_args '2' "$#" 'USER DOMAIN [RESTART]'
+check_args '2' "$#" 'USER DOMAIN [RESTART] [UPDATE_SERIAL]'
validate_format 'user' 'domain'
is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
is_object_valid 'user' 'USER' "$user"
@@ -59,10 +60,15 @@ if [ -e '/etc/bind/named.conf' ]; then
dns_conf='/etc/bind/named.conf'
fi
-# Remove old user's zone
+# Deleting old user's zone
sed -i "/\/$user\/conf\/dns\/$domain/d" $dns_conf
-# Starting loop
+# Updating zone serial
+if [ "$update_serial" != 'no' ]; then
+ update_domain_serial
+fi
+
+# Rebuiling zone config
rebuild_dns_domain_conf
@@ -75,12 +81,10 @@ update_user_value "$user" '$U_DNS_DOMAINS' "$user_domains"
update_user_value "$user" '$U_DNS_RECORDS' "$user_records"
update_user_value "$user" '$SUSPENDED_DNS' "$suspended_dns"
-# Restart named
+# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns "$restart"
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Bind restart failed" >/dev/null
fi
# Logging
diff --git a/bin/v-rebuild-dns-domains b/bin/v-rebuild-dns-domains
index 971a99f4..83c4d6f0 100755
--- a/bin/v-rebuild-dns-domains
+++ b/bin/v-rebuild-dns-domains
@@ -1,6 +1,6 @@
#!/bin/bash
# info: rebuild dns domains
-# options: USER [RESTART]
+# options: USER [RESTART] [UPDATE_SERIAL]
#
# The function rebuilds DNS configuration files.
@@ -12,6 +12,7 @@
# Argument defenition
user=$1
restart=$2
+update_serial=$3
# Includes
source $VESTA/func/main.sh
@@ -24,7 +25,7 @@ source $VESTA/conf/vesta.conf
# Verifications #
#----------------------------------------------------------#
-check_args '1' "$#" 'USER [RESTART]'
+check_args '1' "$#" 'USER [RESTART] [UPDATE_SERIAL]'
validate_format 'user'
is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
is_object_valid 'user' 'USER' "$user"
@@ -65,6 +66,9 @@ sed -i "/\/$user\/conf\/dns/d" $dns_conf
# Starting loop
for domain in $(search_objects 'dns' 'DOMAIN' "*" 'DOMAIN'); do
+ if [ "$update_serial" != 'no' ]; then
+ update_domain_serial
+ fi
rebuild_dns_domain_conf
done
@@ -78,12 +82,10 @@ update_user_value "$user" '$U_DNS_DOMAINS' "$user_domains"
update_user_value "$user" '$U_DNS_RECORDS' "$user_records"
update_user_value "$user" '$SUSPENDED_DNS' "$suspended_dns"
-# Restart named
+# Restarting named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Bind restart failed" >/dev/null
fi
# Logging
diff --git a/bin/v-rebuild-web-domains b/bin/v-rebuild-web-domains
index 8f4d4f43..1afb36de 100755
--- a/bin/v-rebuild-web-domains
+++ b/bin/v-rebuild-web-domains
@@ -45,22 +45,30 @@ fields='$DOMAIN'
nohead=1
domain_counter=0
+# Adding log directory
+mkdir -p /var/log/$WEB_SYSTEM/domains
+chmod 771 /var/log/$WEB_SYSTEM/domains
+
# Clean up old config
rm -f $HOMEDIR/$user/conf/tmp_*.conf
+
# Starting loop
for domain in $(shell_list); do
+ template=$(get_object_value 'web' 'DOMAIN' "$domain" '$BACKEND')
+ if [ ! -z "$WEB_BACKEND" ]; then
+ $BIN/v-add-web-domain-backend $user $domain $template
+ fi
+
((++ domain_counter))
rebuild_web_domain_conf
done
-# Config path
-web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
-proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
-
# Touch vesta configs
+web_conf="/etc/$WEB_SYSTEM/conf.d/vesta.conf"
touch $web_conf
if [ ! -z "$PROXY_SYSTEM" ]; then
+ proxy_conf="/etc/$PROXY_SYSTEM/conf.d/vesta.conf"
touch $proxy_conf
fi
@@ -72,7 +80,6 @@ if [ "$domain_counter" -lt 1 ]; then
if [ ! -z "$PROXY_SYSTEM" ]; then
sed -i "/.*\/$user\/.*$PROXY_SYSTEM.conf/d" $proxy_conf
fi
-
else
# Clean web configs
sed -i "/.*\/$user\/.*.conf/d" $web_conf
@@ -87,19 +94,25 @@ else
# Checking include
web_include=$(grep "$conf" $web_conf )
- if [ -z "$web_include" ]; then
+ if [ -z "$web_include" ] && [ "$WEB_SYSTEM" != 'nginx' ]; then
echo "Include $conf" >> $web_conf
fi
+ if [ -z "$web_include" ] && [ "$WEB_SYSTEM" = 'nginx' ]; then
+ echo "include $conf;" >> $web_conf
+ fi
# Checking SSL
if [ "$ssl_change" = 'yes' ]; then
tmp_conf="$HOMEDIR/$user/conf/web/tmp_s$WEB_SYSTEM.conf"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
mv $tmp_conf $conf
- fi
- ssl_include=$(grep "$conf" $web_conf )
- if [ -z "$ssl_include" ]; then
- echo "Include $conf" >> $web_conf
+ ssl_include=$(grep "$conf" $web_conf )
+ if [ -z "$ssl_include" ] && [ "$WEB_SYSTEM" != 'nginx' ]; then
+ echo "Include $conf" >> $web_conf
+ fi
+ if [ -z "$ssl_include" ] && [ "$WEB_SYSTEM" = 'nginx' ]; then
+ echo "include $conf;" >> $web_conf
+ fi
fi
# Checking proxy
@@ -146,16 +159,14 @@ update_user_value "$user" '$U_WEB_DOMAINS' "$user_domains"
update_user_value "$user" '$U_WEB_SSL' "$user_ssl"
update_user_value "$user" '$U_WEB_ALIASES' "$user_aliases"
-# Restart web server
+# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Web restart failed" >/dev/null
- $BIN/v-restart-proxy
- if [ $? -ne 0 ]; then
- exit $E_RESTART
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "Proxy restart failed" >/dev/null
fi
fi
diff --git a/bin/v-restart-dns b/bin/v-restart-dns
index fe960e26..9945f32e 100755
--- a/bin/v-restart-dns
+++ b/bin/v-restart-dns
@@ -25,7 +25,7 @@ send_email_report() {
email=$(echo "$email" | cut -f 2 -d "'")
tmpfile=$(mktemp)
subj="$(hostname): $DNS_SYSTEM restart failed"
- named-checkconf $dns_conf >> $tmpfile 2>&1
+ /usr/sbin/named-checkconf $dns_conf >> $tmpfile 2>&1
service $DNS_SYSTEM restart >> $tmpfile 2>&1
cat $tmpfile | $send_mail -s "$subj" $email
rm -f $tmpfile
diff --git a/bin/v-restart-web b/bin/v-restart-web
index 7962b302..78c1e7a5 100755
--- a/bin/v-restart-web
+++ b/bin/v-restart-web
@@ -50,7 +50,9 @@ rc=$?
# Workaround for Ubuntu 12.04
if [ "$WEB_SYSTEM" == 'apache2' ]; then
- if [ ! -e "/var/run/apache2.pid" ]; then
+ pid1='/var/run/apache2.pid'
+ pid2='/var/run/apache2/apache2.pid'
+ if [ ! -e "$pid1" ] && [ ! -e "$pid2" ]; then
rc=1
fi
fi
diff --git a/bin/v-restart-web-backend b/bin/v-restart-web-backend
new file mode 100755
index 00000000..b2e747ef
--- /dev/null
+++ b/bin/v-restart-web-backend
@@ -0,0 +1,65 @@
+#!/bin/bash
+# info: restart backend server
+# options: NONE
+#
+# The function reloads backend server configuration.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+send_email_report() {
+ send_mail="$VESTA/web/inc/mail-wrapper.php"
+ email=$(grep CONTACT $VESTA/data/users/admin/user.conf)
+ email=$(echo "$email" | cut -f 2 -d "'")
+ tmpfile=$(mktemp)
+ subj="$(hostname): $WEB_BACKEND restart failed"
+ service $WEB_BACKEND configtest >> $tmpfile 2>&1
+ service $WEB_BACKEND restart >> $tmpfile 2>&1
+ cat $tmpfile | $send_mail -s "$subj" $email
+ rm -f $tmpfile
+}
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Schedule restart
+if [ "$1" = 'scheduled' ]; then
+ echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe
+ exit
+fi
+if [ -z "$1" ] && [ "$SCHEDULED_RESTART" = 'yes' ]; then
+ echo "$BIN/$SCRIPT now" >> $VESTA/data/queue/restart.pipe
+ exit
+fi
+
+if [ -z "$WEB_BACKEND" ] || [ "$WEB_BACKEND" = 'remote' ]; then
+ exit
+fi
+
+# Restart system
+service $WEB_BACKEND restart >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ send_email_report
+ echo "Error: $WEB_BACKEND restart failed"
+ exit $E_RESTART
+fi
+
+# Update restart queue
+if [ -e "$VESTA/data/queue/restart.pipe" ]; then
+ sed -i "/$SCRIPT/d" $VESTA/data/queue/restart.pipe
+fi
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-restore-user b/bin/v-restore-user
index 5971ca83..33d5cdfe 100755
--- a/bin/v-restore-user
+++ b/bin/v-restore-user
@@ -89,7 +89,7 @@ fi
disk_usage=$(df $BACKUP |tail -n1 |tr ' ' '\n' |grep % |cut -f 1 -d %)
if [ "$disk_usage" -ge "$BACKUP_DISK_LIMIT" ]; then
rm -rf $tmpdir
- echo "Not enough disk space to run backup" | $send_mail -s "$subj" $email
+ echo "Not enough disk space to run restore" | $send_mail -s "$subj" $email
echo "Error: Not enough disk space"
sed -i "/ $user /d" $VESTA/data/queue/backup.pipe
log_event "$E_DISK" "$EVENT"
@@ -244,9 +244,9 @@ if [ "$web" != 'no' ]; then
# Check web template
check_tpl=$(is_web_template_valid)
- if [ ! -e "$WEBTPL/$WEB_SYSTEM/$TPL.tpl" ]; then
+ if [ ! -e "$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl" ]; then
TPL="default"
- if [ ! -e "$WEBTPL/$WEB_SYSTEM/$TPL.tpl" ]; then
+ if [ ! -e "$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl" ]; then
echo "Error: no avaiable web template"
echo "No available web template" |\
$send_mail -s "$subj" $email
@@ -280,9 +280,22 @@ if [ "$web" != 'no' ]; then
STATS_USER=$(echo "$STATS_USER" | cut -f 2,3,4,5,6,7 -d '_')
STATS_USER="${user}_${STATS_USER}"
fi
+
+ # Set default backend template
+ if [ ! -z "$WEB_BACKEND" ]; then
+ if [ ! -z "$BACKEND" ]; then
+ if [ ! -e "$WEBTPL/$WEB_BACKEND/$BACKEND.tpl" ]; then
+ BACKEND='default'
+ fi
+ else
+ BACKEND='default'
+ fi
+ fi
+
str="DOMAIN='$domain' IP='$IP' IP6='$IP6' ALIAS='$ALIAS'"
str="$str TPL='$TPL' SSL='$SSL' SSL_HOME='$SSL_HOME'"
- str="$str FTP_USER='$FTP_USER' FTP_MD5='$FTP_MD5' PROXY='$PROXY'"
+ str="$str FTP_USER='$FTP_USER' FTP_MD5='$FTP_MD5'"
+ str="$str BACKEND='$BACKEND' PROXY='$PROXY'"
str="$str PROXY_EXT='$PROXY_EXT' STATS='$STATS'"
str="$str STATS_USER='$STATS_USER' STATS_CRYPT='$STATS_CRYPT'"
str="$str U_DISK='$U_DISK' U_BANDWIDTH='0' SUSPENDED='no'"
@@ -297,6 +310,11 @@ if [ "$web" != 'no' ]; then
done
fi
+ # Rebuild backend
+ if [ ! -z "$WEB_BACKEND" ]; then
+ $BIN/v-add-web-domain-backend $user $domain $BACKEND
+ fi
+
# Rebuild web config
rebuild_web_domain_conf
@@ -307,9 +325,12 @@ if [ "$web" != 'no' ]; then
cat $tmp_conf >> $conf
rm -f $tmp_conf
web_include=$(grep "$conf" $web_conf)
- if [ -z "$web_include" ]; then
+ if [ -z "$web_include" ] && [ "$WEB_SYSTEM" != 'nginx' ]; then
echo "Include $conf" >> $web_conf
fi
+ if [ -z "$web_include" ] && [ "$WEB_SYSTEM" = 'nginx' ]; then
+ echo "include $conf;" >> $web_conf
+ fi
# Adding SSL vhost
if [ "$SSL" = 'yes' ]; then
@@ -319,9 +340,12 @@ if [ "$web" != 'no' ]; then
rm -f $tmp_conf
fi
ssl_include=$(grep "$conf" $web_conf)
- if [ -z "$ssl_include" ]; then
+ if [ -z "$ssl_include" ] && [ "$WEB_SYSTEM" != 'nginx' ]; then
echo "Include $conf" >> $web_conf
fi
+ if [ -z "$ssl_include" ] && [ "$WEB_SYSTEM" = 'nginx' ]; then
+ echo "include $conf;" >> $web_conf
+ fi
# Proxy
if [ ! -z "$PROXY_SYSTEM" ]; then
@@ -375,15 +399,23 @@ if [ "$web" != 'no' ]; then
done
+ # Add user to traff queue
+ sed -i "/ $user /d" $VESTA/data/queue/traffic.pipe
+ echo "$BIN/v-update-web-domains-traff $user" >>\
+ $VESTA/data/queue/traffic.pipe
+
# Restart WEB
$BIN/v-restart-web
if [ $? -ne 0 ]; then
exit $E_RESTART
fi
- $BIN/v-restart-proxy
- if [ $? -ne 0 ]; then
- exit $E_RESTART
+ # Restart Proxy
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ if [ $? -ne 0 ]; then
+ exit $E_RESTART
+ fi
fi
echo
@@ -617,7 +649,7 @@ if [ "$db" != 'no' ]; then
# Create domain list
db_list=$(tar -tf $BACKUP/$backup | grep "^./db" |\
- grep db.conf | cut -f 3 -d '/')
+ grep db.conf | cut -f 3 -d '/' |sort -u)
if [ ! -z "$db" ]; then
db_include_list=$(mktemp)
for db_include in ${db//,/ }; do
diff --git a/bin/v-search-fs-object b/bin/v-search-fs-object
new file mode 100755
index 00000000..3c778568
--- /dev/null
+++ b/bin/v-search-fs-object
@@ -0,0 +1,47 @@
+#!/bin/bash
+# info: search file or directory
+# options: USER OBJECT [PATH]
+#
+# The function search files and directories on the file system
+
+user=$1
+object=$2
+path=$3
+
+# Checking arguments
+if [ -z "$object" ]; then
+ echo "Usage: USER OBJECT [PATH]"
+ exit 1
+fi
+
+# Checking vesta user
+if [ ! -e "$VESTA/data/users/$user" ]; then
+ echo "Error: vesta user $user doesn't exist"
+ exit 3
+fi
+
+# Checking user homedir
+homedir=$(grep "^$user:" /etc/passwd | cut -f 6 -d :)
+if [ -z $homedir ]; then
+ echo "Error: user home directory doesn't exist"
+ exit 12
+fi
+
+# Checking path
+if [ ! -z "$path" ]; then
+ rpath=$(readlink -f "$path")
+ if [ -z "$(echo $rpath |grep $homedir)" ]; then
+ echo "Error: invalid path $dst_dir"
+ exit 2
+ fi
+else
+ path=$homedir
+fi
+
+# Listing directory
+sudo -u $user find "$path" -name "$object" \
+ -printf "%y|%m|%TY-%Tm-%Td|%TH:%TM|%u|%g|%s|%P\n" 2>/dev/null
+# -printf "%y|%m|%TY-%Tm-%Td|%TH:%TM:%TS|%u|%g|%s|%P\n" 2>/dev/null
+
+# Exiting
+exit $?
diff --git a/bin/v-start-service b/bin/v-start-service
index 970c7ca0..100b8288 100755
--- a/bin/v-start-service
+++ b/bin/v-start-service
@@ -29,14 +29,10 @@ check_args '1' "$#" 'SERVICE'
if [ "$service" != 'iptables' ]; then
service $service start >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "$service start failed" $E_RESTART
else
$BIN/v-update-firewall
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "$service start failed" $E_RESTART
fi
diff --git a/bin/v-stop-firewall b/bin/v-stop-firewall
index 1806d4fa..4087190d 100755
--- a/bin/v-stop-firewall
+++ b/bin/v-stop-firewall
@@ -40,6 +40,15 @@ echo "$iptables -F INPUT" >> $tmp
# Deleting vesta chain
echo "$iptables -X vesta" >> $tmp
+# Deleting custom chains
+chains=$(cat $VESTA/data/firewall/chains.conf 2>/dev/null)
+IFS=$'\n'
+for chain in $chains; do
+ eval $chain
+ echo "$iptables -F fail2ban-$CHAIN" >> $tmp
+ echo "$iptables -X fail2ban-$CHAIN" >> $tmp
+done
+
# Applying rules
bash $tmp 2>/dev/null
diff --git a/bin/v-stop-service b/bin/v-stop-service
index 7355a113..b05f8744 100755
--- a/bin/v-stop-service
+++ b/bin/v-stop-service
@@ -29,14 +29,10 @@ check_args '1' "$#" 'SERVICE'
if [ "$service" != 'iptables' ]; then
service $service stop >/dev/null 2>&1
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "$service stop failed" $E_RESTART
else
$BIN/v-stop-firewall
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "$service stop failed" $E_RESTART
fi
diff --git a/bin/v-suspend-cron-job b/bin/v-suspend-cron-job
index 977b77ab..19124b80 100755
--- a/bin/v-suspend-cron-job
+++ b/bin/v-suspend-cron-job
@@ -46,12 +46,10 @@ sync_cron_jobs
# Vesta #
#----------------------------------------------------------#
-# Restart crond
+# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Cron restart failed" >/dev/null
fi
# Logging
diff --git a/bin/v-suspend-cron-jobs b/bin/v-suspend-cron-jobs
index 993989a5..7de5a1aa 100755
--- a/bin/v-suspend-cron-jobs
+++ b/bin/v-suspend-cron-jobs
@@ -41,12 +41,10 @@ done
# Vesta #
#----------------------------------------------------------#
-# Restart crond
+# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Cron restart failed" >/dev/null
fi
# Logging
diff --git a/bin/v-suspend-dns-domain b/bin/v-suspend-dns-domain
index 9d6c0906..38eb76d3 100755
--- a/bin/v-suspend-dns-domain
+++ b/bin/v-suspend-dns-domain
@@ -46,14 +46,6 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$SUSPENDED' 'yes'
sed -i "s/SUSPENDED='no'/SUSPENDED='yes'/g" $USER_DATA/dns/$domain.conf
increase_user_value "$user" '$SUSPENDED_DNS'
-# Restart named
-#if [ "$restart" != 'no' ]; then
-# $BIN/v-restart-dns
-# if [ $? -ne 0 ]; then
-# exit $E_RESTART
-# fi
-#fi
-
# Logging
log_event "$OK" "$EVENT"
diff --git a/bin/v-suspend-dns-domains b/bin/v-suspend-dns-domains
index f46cc39e..34d41dcb 100755
--- a/bin/v-suspend-dns-domains
+++ b/bin/v-suspend-dns-domains
@@ -42,14 +42,6 @@ done
# Vesta #
#----------------------------------------------------------#
-# Restart dns server
-#if [ "$restart" != 'no' ]; then
-# $BIN/v-restart-dns
-# if [ $? -ne 0 ]; then
-# exit $E_RESTART
-# fi
-#fi
-
# Logging
log_event "$OK" "$EVENT"
diff --git a/bin/v-suspend-dns-record b/bin/v-suspend-dns-record
index 5cc8f310..f98025f9 100755
--- a/bin/v-suspend-dns-record
+++ b/bin/v-suspend-dns-record
@@ -54,6 +54,7 @@ sort_dns_records
# Updating zone
if [[ "$DNS_SYSTEM" =~ named|bind ]]; then
+ update_domain_serial
update_domain_zone
fi
@@ -62,14 +63,6 @@ fi
# Vesta #
#----------------------------------------------------------#
-# Restart named
-#if [ "$restart" != 'no' ]; then
-# $BIN/v-restart-dns
-# if [ $? -ne 0 ]; then
-# exit $E_RESTART
-# fi
-#fi
-
# Logging
log_event "$OK" "$EVENT"
diff --git a/bin/v-suspend-domain b/bin/v-suspend-domain
new file mode 100755
index 00000000..35dd8966
--- /dev/null
+++ b/bin/v-suspend-domain
@@ -0,0 +1,90 @@
+#!/bin/bash
+# info: suspend web/dns/mail domain
+# options: USER DOMAIN
+#
+# The function suspends web/dns/mail domain.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument defenition
+user=$1
+domain=$2
+restart="${3-yes}"
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'USER DOMAIN'
+validate_format 'user' 'domain'
+is_object_valid 'user' 'USER' "$user"
+is_object_unsuspended 'user' 'USER' "$user"
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Working on Web domain
+if [ ! -z "$WEB_SYSTEM" ]; then
+ str=$(grep "DOMAIN='$domain'" $USER_DATA/web.conf |grep "SUSPENDED='no")
+ if [ ! -z "$str" ]; then
+ domain_found='yes'
+ $BIN/v-suspend-web-domain $user $domain 'no'
+ check_result $? "can't suspend web" > /dev/null
+ fi
+fi
+
+# Working on DNS domain
+if [ ! -z "$DNS_SYSTEM" ]; then
+ str=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf |grep "SUSPENDED='no")
+ if [ ! -z "$str" ]; then
+ domain_found='yes'
+ $BIN/v-suspend-dns-domain $user $domain 'no'
+ check_result $? "can't suspend dns" > /dev/null
+ fi
+fi
+
+# Working on Mail domain
+if [ ! -z "$MAIL_SYSTEM" ]; then
+ str=$(grep "DOMAIN='$domain'" $USER_DATA/mail.conf |grep "SUSPENDED='no")
+ if [ ! -z "$str" ]; then
+ domain_found='yes'
+ $BIN/v-suspend-mail-domain $user $domain
+ check_result $? "can't suspend mail" > /dev/null
+ fi
+fi
+
+# Checking domain search result
+if [ -z "$domain_found" ]; then
+ echo "Error: domain $domain doesn't exist"
+ log_event "$E_NOTEXIST" "$EVENT"
+ exit $E_NOTEXIST
+fi
+
+# Restarting services
+if [ "$restart" != 'no' ]; then
+ $BIN/v-restart-web
+ check_result $? "can't restart web" > /dev/null
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "can't restart proxy" > /dev/null
+ fi
+ $BIN/v-restart-dns
+ check_result $? "can't restart dns" > /dev/null
+fi
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-suspend-user b/bin/v-suspend-user
index adbff01a..99e73227 100755
--- a/bin/v-suspend-user
+++ b/bin/v-suspend-user
@@ -38,6 +38,11 @@ fi
# Adding '!' in front of the password
/usr/sbin/usermod --lock $user
+# Suspending ftp accounts
+for ftp in $(grep "^${user}_" /etc/passwd |cut -f 1 -d : ); do
+ /usr/sbin/usermod --lock $ftp 2>/dev/null
+done
+
# Suspending web domains
if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
$BIN/v-suspend-web-domains $user $restart
@@ -68,22 +73,16 @@ fi
# Vesta #
#----------------------------------------------------------#
-# Restart web server
+# Restarting system services
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-dns
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "DNS restart failed" >/dev/null
$BIN/v-restart-cron
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Cron restart failed" >/dev/null
fi
# Changing suspend value
diff --git a/bin/v-suspend-web-domain b/bin/v-suspend-web-domain
index 4661cf01..d98ed633 100755
--- a/bin/v-suspend-web-domain
+++ b/bin/v-suspend-web-domain
@@ -42,7 +42,7 @@ is_object_unsuspended 'web' 'DOMAIN' "$domain"
# Parsing domain values
get_domain_values 'web'
-tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
+tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
SUSPENDED='yes'
ip=$(get_real_ip $IP)
@@ -56,48 +56,46 @@ add_web_config
# Check SSL
if [ "$SSL" = 'yes' ]; then
- tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
+ tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
del_web_config
add_web_config
fi
# Checking proxy
-if [ ! -z "$PROXY" ]; then
+if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
add_web_config
+ # Checking proxy SSL
+ if [ "$SSL" = 'yes' ]; then
+ tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
+ conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
+ del_web_config
+ add_web_config
+ fi
fi
-# Checking proxy SSL
-if [ ! -z "$PROXY" ] && [ "$SSL" = 'yes' ]; then
- tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
- conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
- del_web_config
- add_web_config
-fi
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
-# Update config
+# Updating config
update_object_value 'web' 'DOMAIN' "$domain" '$SUSPENDED' 'yes'
increase_user_value "$user" '$SUSPENDED_WEB'
-# Restart web server
+# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Web restart failed" >/dev/null
- $BIN/v-restart-proxy
- if [ $? -ne 0 ]; then
- exit $E_RESTART
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "Proxy restart failed" >/dev/null
fi
fi
diff --git a/bin/v-suspend-web-domains b/bin/v-suspend-web-domains
index fc4bf125..5ff752bf 100755
--- a/bin/v-suspend-web-domains
+++ b/bin/v-suspend-web-domains
@@ -42,16 +42,14 @@ done
# Vesta #
#----------------------------------------------------------#
-# Restart web server
+# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Web restart failed" >/dev/null
- $BIN/v-restart-proxy
- if [ $? -ne 0 ]; then
- exit $E_RESTART
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "Proxy restart failed" >/dev/null
fi
fi
diff --git a/bin/v-sync-dns-cluster b/bin/v-sync-dns-cluster
index ac004518..d4a1e00d 100755
--- a/bin/v-sync-dns-cluster
+++ b/bin/v-sync-dns-cluster
@@ -10,7 +10,6 @@
# Argument defenition
host=$1
-verbose=$2
# Includes
source $VESTA/func/main.sh
@@ -23,146 +22,60 @@ source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
-
if [ ! -e "$VESTA/conf/dns-cluster.conf" ]; then
- echo "Error: dns-cluster.conf doesn't exist"
- log_event "$E_NOTEXIST $EVENT"
- exit $E_NOTEXIST
+ check_result $E_NOTEXIST "dns-cluster.conf doesn't exist"
fi
-
-number_of_proc=$(ps auxf | grep -v grep | grep $VESTA/bin/$SCRIPT | wc -l)
-if [ "$number_of_proc" -gt 2 ]; then
- echo "Error: another sync process already exists"
- log_event "$E_EXISTS $EVENT"
- exit $E_EXISTS
+if [ "$(ps auxf |grep -v grep |grep $BIN/$SCRIPT |wc -l)" -gt 2 ]; then
+ check_result $E_EXISTS "another sync process already running"
fi
+remote_dns_health_check 'no_email'
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
-old_ifs="$IFS"
+# Selecting remote hosts
IFS=$'\n'
-
if [ -z $host ]; then
- hosts=$(cat $VESTA/conf/dns-cluster.conf | grep "SUSPENDED='no'")
- rm -f $VESTA/data/queue/dns-cluster.pipe
- touch $VESTA/data/queue/dns-cluster.pipe
- chmod 660 $VESTA/data/queue/dns-cluster.pipe
+ hosts=$(cat $VESTA/conf/dns-cluster.conf |grep "SUSPENDED='no'")
else
hosts=$(grep "HOST='$host'" $VESTA/conf/dns-cluster.conf)
fi
# Starting cluster loop
-for cluster_str in $hosts; do
+for cluster in $hosts; do
- # Get host values
- eval $cluster_str
+ # Parsing host values
+ eval $cluster
- # Check connection type
- if [ -z "TYPE" ]; then
- TYPE='api'
- fi
+ # Wiping remote domains
+ cluster_cmd v-delete-dns-domains-src $DNS_USER $HOSTNAME no
+ check_result $? "$HOST connection failed" $E_CONNECT
- # Print hostname
- if [ ! -z "$verbose" ]; then
- echo "HOSTNAME: $HOSTNAME"
- echo "TYPE: $TYPE"
- fi
-
- # Switch on connection type
- case $TYPE in
- ssh) send_cmd="send_ssh_cmd" ;;
- *) send_cmd="send_api_cmd" ;;
- esac
-
- # Check host connection
- $send_cmd v-list-sys-config
- if [ $? -ne 0 ]; then
- echo "Error: $TYPE connection to $HOST failed"
- log_event "$E_CONNECT $EVENT"
- exit $E_CONNECT
- fi
-
- # Check recipient dns user
- if [ -z "$DNS_USER" ]; then
- DNS_USER='dns-cluster'
- fi
- if [ ! -z "$verbose" ]; then
- echo "DNS_USER: $DNS_USER"
- fi
- $send_cmd v-list-user $DNS_USER
- if [ $? -ne 0 ]; then
- echo "Error: dns user $DNS_USER doesn't exist"
- log_event "$E_NOTEXIST $EVENT"
- exit $E_NOTEXIST
- fi
-
- # Check dns exceptions
- if [ -z "$DNS_CLUSTER_IGNORE" ]; then
- DNS_CLUSTER_IGNORE='dns-cluster'
- fi
-
- # Create userlist
- user_list=$(ls $VESTA/data/users)
- for exception in $(echo -e "${DNS_CLUSTER_IGNORE//,/\n}"); do
- user_list=$(echo "$user_list" | grep -v "^$exception$")
- done
-
- # Clean source records
- if [ ! -z "$verbose" ]; then
- echo "STATUS: Wiping dns domains"
- fi
- $send_cmd v-delete-dns-domains-src $DNS_USER $HOSTNAME no
- if [ $? -ne 0 ]; then
- echo "Error: $TYPE connection to $HOST failed (cleanup)"
- log_event "$E_CONNECT $EVENT"
- exit $E_CONNECT
- fi
-
- # Start user loop
+ # Syncing user domains
+ user_list=$(ls $VESTA/data/users |grep -v "dns-cluster")
for user in $user_list; do
-
- # Sync domain
for str in $(cat $VESTA/data/users/$user/dns.conf); do
- eval $str
- if [ ! -z "$verbose" ]; then
- echo "DOMAIN: $DOMAIN index"
- fi
- $send_cmd v-insert-dns-domain $DNS_USER "$str" $HOSTNAME
- if [ $? -eq 0 ]; then
- if [ ! -z "$verbose" ]; then
- echo "DOMAIN: $DOMAIN records"
- fi
- # Sync record
- if [ "$TYPE" = 'ssh' ]; then
- tmp=$(mktemp -u)
- scp_cmd $USER_DATA/$user/dns/$DOMAIN.conf $tmp
- $send_cmd v-insert-dns-records $DNS_USER $DOMAIN $tmp
- else
- for str in $(cat $USER_DATA/$user/dns/$DOMAIN.conf); do
- str=$(echo "$str" | sed 's/"/\\"/g')
- $send_cmd v-insert-dns-record \
- $DNS_USER $DOMAIN "$str"
- done
- fi
- else
- if [ ! -z "$verbose" ]; then
- echo "DOMAIN: $DOMAIN skiping records (not uniq)"
- fi
- fi
+ # Syncing domain index
+ eval $str
+ cluster_cmd v-insert-dns-domain $DNS_USER "$str" $HOSTNAME ' ' no
+ check_result $? "$HOST connection failed" $E_CONNECT
+
+ # Syncing domain records
+ tmp_file="/tmp/vst-sync.$DOMAIN"
+ cluster_file $USER_DATA/$user/dns/$DOMAIN.conf $tmp_file
+ check_result $? "$HOST connection failed" $E_CONNECT
+
+ cluster_cmd v-insert-dns-records $DNS_USER $DOMAIN $tmp_file 'no'
+ check_result $? "$HOST connection failed" $E_CONNECT
done
done
- # Rebuild dns zones
- $send_cmd v-rebuild-dns-domains $DNS_USER
- if [ $? -ne 0 ]; then
- echo "Error: $TYPE connection to $HOST failed (rebuild)"
- log_event "$E_CONNECT $EVENT"
- exit $E_CONNECT
- fi
+ # Rebuilding dns zones
+ cluster_cmd v-rebuild-dns-domains $DNS_USER
+ check_result $? "$TYPE connection to $HOST failed" $E_CONNECT
done
@@ -171,4 +84,9 @@ done
# Vesta #
#----------------------------------------------------------#
+# Flushing dns-cluster queue
+rm -f $VESTA/data/queue/dns-cluster.pipe
+touch $VESTA/data/queue/dns-cluster.pipe
+chmod 660 $VESTA/data/queue/dns-cluster.pipe
+
exit
diff --git a/bin/v-unsuspend-cron-job b/bin/v-unsuspend-cron-job
index 39af81b1..c152d011 100755
--- a/bin/v-unsuspend-cron-job
+++ b/bin/v-unsuspend-cron-job
@@ -46,12 +46,10 @@ sync_cron_jobs
# Vesta #
#----------------------------------------------------------#
-# Restart crond
+# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Cron restart failed" >/dev/null
fi
# Logging
diff --git a/bin/v-unsuspend-cron-jobs b/bin/v-unsuspend-cron-jobs
index e1d3e686..f767ce61 100755
--- a/bin/v-unsuspend-cron-jobs
+++ b/bin/v-unsuspend-cron-jobs
@@ -41,12 +41,10 @@ done
# Vesta #
#----------------------------------------------------------#
-# Restart crond
+# Restarting crond
if [ "$restart" != 'no' ]; then
$BIN/v-restart-cron
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Cron restart failed" >/dev/null
fi
# Logging
diff --git a/bin/v-unsuspend-dns-domain b/bin/v-unsuspend-dns-domain
index 25253590..1e5dcfac 100755
--- a/bin/v-unsuspend-dns-domain
+++ b/bin/v-unsuspend-dns-domain
@@ -47,15 +47,6 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
decrease_user_value "$user" '$SUSPENDED_DNS'
sed -i "s/SUSPENDED='yes'/SUSPENDED='no'/g" $USER_DATA/dns/$domain.conf
-
-# Restart named
-#if [ "$restart" != 'no' ]; then
-# $BIN/v-restart-dns
-# if [ $? -ne 0 ]; then
-# exit $E_RESTART
-# fi
-#fi
-
# Logging
log_event "$OK" "$EVENT"
diff --git a/bin/v-unsuspend-dns-domains b/bin/v-unsuspend-dns-domains
index 177770e0..7d184b4a 100755
--- a/bin/v-unsuspend-dns-domains
+++ b/bin/v-unsuspend-dns-domains
@@ -42,14 +42,6 @@ done
# Vesta #
#----------------------------------------------------------#
-# Restart dns server
-#if [ "$restart" != 'no' ]; then
-# $BIN/v-restart-dns
-# if [ $? -ne 0 ]; then
-# exit $E_RESTART
-# fi
-#fi
-
# Logging
log_event "$OK" "$EVENT"
diff --git a/bin/v-unsuspend-dns-record b/bin/v-unsuspend-dns-record
index 761581ef..38c9e58e 100755
--- a/bin/v-unsuspend-dns-record
+++ b/bin/v-unsuspend-dns-record
@@ -53,6 +53,7 @@ sort_dns_records
# Updating zone
if [[ "$DNS_SYSTEM" =~ named|bind ]]; then
+ update_domain_serial
update_domain_zone
fi
@@ -61,14 +62,6 @@ fi
# Vesta #
#----------------------------------------------------------#
-# Restart named
-#if [ "$restart" != 'no' ]; then
-# $BIN/v-restart-dns
-# if [ $? -ne 0 ]; then
-# exit $E_RESTART
-# fi
-#fi
-
# Logging
log_event "$OK" "$EVENT"
diff --git a/bin/v-unsuspend-domain b/bin/v-unsuspend-domain
new file mode 100755
index 00000000..c53a0600
--- /dev/null
+++ b/bin/v-unsuspend-domain
@@ -0,0 +1,89 @@
+#!/bin/bash
+# info: unsuspend web/dns/mail domain
+# options: USER DOMAIN
+#
+# The function unsuspends web/dns/mail domain.
+
+
+#----------------------------------------------------------#
+# Variable&Function #
+#----------------------------------------------------------#
+
+# Argument defenition
+user=$1
+domain=$2
+restart="${3-yes}"
+
+# Includes
+source $VESTA/func/main.sh
+source $VESTA/conf/vesta.conf
+
+
+#----------------------------------------------------------#
+# Verifications #
+#----------------------------------------------------------#
+
+check_args '2' "$#" 'USER DOMAIN'
+validate_format 'user' 'domain'
+is_object_valid 'user' 'USER' "$user"
+
+
+#----------------------------------------------------------#
+# Action #
+#----------------------------------------------------------#
+
+# Working on Web domain
+if [ ! -z "$WEB_SYSTEM" ]; then
+ str=$(grep "DOMAIN='$domain'" $USER_DATA/web.conf |grep "SUSPENDED='yes")
+ if [ ! -z "$str" ]; then
+ domain_found='yes'
+ $BIN/v-unsuspend-web-domain $user $domain 'no'
+ check_result $? "can't suspend web" > /dev/null
+ fi
+fi
+
+# Working on DNS domain
+if [ ! -z "$DNS_SYSTEM" ]; then
+ str=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf |grep "SUSPENDED='yes")
+ if [ ! -z "$str" ]; then
+ domain_found='yes'
+ $BIN/v-unsuspend-dns-domain $user $domain 'no'
+ check_result $? "can't suspend dns" > /dev/null
+ fi
+fi
+
+# Working on Mail domain
+if [ ! -z "$MAIL_SYSTEM" ]; then
+ str=$(grep "DOMAIN='$domain'" $USER_DATA/mail.conf |grep "SUSPENDED='yes")
+ if [ ! -z "$str" ]; then
+ domain_found='yes'
+ $BIN/v-unsuspend-mail-domain $user $domain
+ check_result $? "can't suspend mail" > /dev/null
+ fi
+fi
+
+# Checking domain search result
+if [ -z "$domain_found" ]; then
+ echo "Error: domain $domain doesn't exist"
+ log_event "$E_NOTEXIST" "$EVENT"
+ exit $E_NOTEXIST
+fi
+
+# Restarting services
+if [ "$restart" != 'no' ]; then
+ $BIN/v-restart-web
+ check_result $? "can't restart web" > /dev/null
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "can't restart proxy" > /dev/null
+ fi
+ $BIN/v-restart-dns
+ check_result $? "can't restart dns" > /dev/null
+fi
+
+
+#----------------------------------------------------------#
+# Vesta #
+#----------------------------------------------------------#
+
+exit
diff --git a/bin/v-unsuspend-user b/bin/v-unsuspend-user
index 4222d298..f2a44f5e 100755
--- a/bin/v-unsuspend-user
+++ b/bin/v-unsuspend-user
@@ -37,6 +37,11 @@ fi
# Deleting '!' in front of the password
/usr/sbin/usermod --unlock $user
+# Unsuspending ftp accounts
+for ftp in $(grep "^${user}_" /etc/passwd |cut -f 1 -d : ); do
+ /usr/sbin/usermod --unlock $ftp 2>/dev/null
+done
+
# Unsuspending web domains
if [ ! -z "$WEB_SYSTEM" ] && [ "$WEB_SYSTEM" != 'no' ]; then
$BIN/v-unsuspend-web-domains $user $restart
@@ -71,21 +76,16 @@ fi
update_user_value "$user" '$SUSPENDED' 'no'
decrease_user_value 'admin' '$SUSPENDED_USERS'
+# Restarting system services
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Web restart failed" >/dev/null
$BIN/v-restart-dns
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "DNS restart failed" >/dev/null
$BIN/v-restart-cron
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Cron restart failed" >/dev/null
fi
# Logging
diff --git a/bin/v-unsuspend-web-domain b/bin/v-unsuspend-web-domain
index b963833b..f0baea17 100755
--- a/bin/v-unsuspend-web-domain
+++ b/bin/v-unsuspend-web-domain
@@ -40,7 +40,7 @@ is_object_suspended 'web' 'DOMAIN' "$domain"
# Parsing domain values
get_domain_values 'web'
-tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
+tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.conf"
SUSPENDED='no'
ip=$(get_real_ip $IP)
@@ -52,28 +52,28 @@ upd_web_domain_values
del_web_config
add_web_config
-# Check SSL
+# Checking SSL
if [ "$SSL" = 'yes' ]; then
- tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
+ tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.stpl"
conf="$HOMEDIR/$user/conf/web/s$WEB_SYSTEM.conf"
del_web_config
add_web_config
fi
# Checking proxy
-if [ ! -z "$PROXY" ]; then
+if [ ! -z "$PROXY_SYSTEM" ] && [ ! -z "$PROXY" ]; then
tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.tpl"
conf="$HOMEDIR/$user/conf/web/$PROXY_SYSTEM.conf"
del_web_config
add_web_config
-fi
-# Checking SSL proxy
-if [ ! -z "$PROXY" ] && [ "$SSL" = 'yes' ]; then
- tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
- conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
- del_web_config
- add_web_config
+ # Checking proxy SSL
+ if [ "$SSL" = 'yes' ]; then
+ tpl_file="$WEBTPL/$PROXY_SYSTEM/$PROXY.stpl"
+ conf="$HOMEDIR/$user/conf/web/s$PROXY_SYSTEM.conf"
+ del_web_config
+ add_web_config
+ fi
fi
@@ -81,20 +81,18 @@ fi
# Vesta #
#----------------------------------------------------------#
-# Update config
+# Updating config
update_object_value 'web' 'DOMAIN' "$domain" '$SUSPENDED' 'no'
decrease_user_value "$user" '$SUSPENDED_WEB'
-# Restart web erver
+# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Web restart failed" >/dev/null
- $BIN/v-restart-proxy
- if [ $? -ne 0 ]; then
- exit $E_RESTART
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "Proxy restart failed" >/dev/null
fi
fi
diff --git a/bin/v-unsuspend-web-domains b/bin/v-unsuspend-web-domains
index 15c86026..c5ae0c03 100755
--- a/bin/v-unsuspend-web-domains
+++ b/bin/v-unsuspend-web-domains
@@ -43,16 +43,14 @@ done
# Vesta #
#----------------------------------------------------------#
-# Restart web server
+# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "Web restart failed" >/dev/null
- $BIN/v-restart-proxy
- if [ $? -ne 0 ]; then
- exit $E_RESTART
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "Proxy restart failed" >/dev/null
fi
fi
diff --git a/bin/v-update-firewall b/bin/v-update-firewall
index a28a8a7e..04a15a5f 100755
--- a/bin/v-update-firewall
+++ b/bin/v-update-firewall
@@ -12,6 +12,7 @@
# Defining absolute path for iptables and modprobe
iptables="/sbin/iptables"
modprobe="/sbin/modprobe"
+sysctl="/sbin/sysctl"
# Includes
source /etc/profile.d/vesta.sh
@@ -38,11 +39,22 @@ if [ ! -e "$rules" ]; then
exit
fi
+$sysctl net.netfilter.nf_conntrack_max >/dev/null 2>&1
+if [ $? -ne 0 ]; then
+ conntrack='no'
+fi
+
# Checking conntrack module avaiabilty
$modprobe nf_conntrack >/dev/null 2>&1
$modprobe nf_conntrack_ftp >/dev/null 2>&1
if [ $? -ne 0 ]; then
- stateful='no'
+ conntrack_ftp='no'
+fi
+
+# Checking custom OpenSSH port
+sshport=$(grep '^Port ' /etc/ssh/sshd_config | head -1 | cut -d ' ' -f 2)
+if [[ "$sshport" =~ ^[0-9]+$ ]] && [ "$sshport" -ne "22" ]; then
+ sed -i "s/PORT='22'/PORT=\'$sshport\'/" $rules
fi
# Creating temporary file
@@ -75,7 +87,7 @@ for line in $(sort -r -n -k 2 -t \' $rules); do
# Checking FTP for contrack module
if [ "$TYPE" = "FTP" ] || [ "$PORT" = '21' ]; then
- if [ "$stateful" != 'no' ]; then
+ if [ "$conntrack_ftp" != 'no' ]; then
state="-m conntrack --ctstate NEW"
else
port="-m multiport --dports 20,21,12000:12100"
@@ -101,7 +113,7 @@ for p_rule in $(cat $ports); do
done
# Enabling stateful support
-if [ "$stateful" != 'no' ]; then
+if [ "$conntrack" != 'no' ]; then
str="$iptables -A INPUT -p tcp -m state"
str="$str --state ESTABLISHED,RELATED -j ACCEPT"
echo "$str" >> $tmp
@@ -126,19 +138,29 @@ fi
# Checking fail2ban support
if [ ! -z "$FIREWALL_EXTENSION" ]; then
- chains=$(cat $VESTA/data/firewall/chains.conf 2>/dev/null)
-fi
-for chain in $chains; do
- eval $chain
- if [[ "$PORT" =~ ,|-|: ]] ; then
- port="-m multiport --dports $PORT"
- else
- port="--dport $PORT"
- fi
- echo "$iptables -I INPUT -p $PROTOCOL $port -j fail2ban-$CHAIN" > $tmp
- bash $tmp
+ for chain in $(cat $VESTA/data/firewall/chains.conf 2>/dev/null); do
+ eval $chain
+ if [[ "$PORT" =~ ,|-|: ]] ; then
+ port="-m multiport --dports $PORT"
+ else
+ port="--dport $PORT"
+ fi
+ echo "$iptables -N fail2ban-$CHAIN" >> $tmp
+ echo "$iptables -F fail2ban-$CHAIN" >> $tmp
+ echo "$iptables -I fail2ban-$CHAIN -s 0.0.0.0/0 -j RETURN" >> $tmp
+ echo "$iptables -I INPUT -p $PROTOCOL $port -j fail2ban-$CHAIN" >>$tmp
+ done
+ bash $tmp 2>/dev/null
rm -f $tmp
-done
+
+ for ban in $(cat $VESTA/data/firewall/banlist.conf 2>/dev/null); do
+ eval $ban
+ echo -n "$iptables -I fail2ban-$CHAIN 1 -s $IP" >> $tmp
+ echo " -j REJECT --reject-with icmp-port-unreachable" >> $tmp
+ done
+ bash $tmp 2>/dev/null
+ rm -f $tmp
+fi
# Saving rules to the master iptables file
if [ -e "/etc/redhat-release" ]; then
diff --git a/bin/v-update-sys-ip b/bin/v-update-sys-ip
index 0d064370..0c152e60 100755
--- a/bin/v-update-sys-ip
+++ b/bin/v-update-sys-ip
@@ -65,8 +65,19 @@ if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then
$BIN/v-rebuild-web-domains $user no
done
fi
+
+ # Restarting web server
$BIN/v-restart-web
- $BIN/v-restart-proxy
+
+ # Restarting proxy server
+ if [ ! -z "$PROXY_SYSTEM" ]; then
+ $BIN/v-restart-proxy
+ fi
+
+ # Restarting firewall
+ if [ ! -z "$FIREWALL_SYSTEM" ]; then
+ $BIN/v-update-firewall
+ fi
if [ ! -z "$DNS_SYSTEM" ]; then
# Rebuild dns domains
@@ -76,9 +87,7 @@ if [ ! -z "$vst_ip_list" ] && [ "$vst_ip_num" -eq '1' ]; then
$BIN/v-rebuild-dns-domains $user no
done
$BIN/v-restart-dns
- if [ $? -ne 0 ]; then
- exit $E_RESTART
- fi
+ check_result $? "dns restart failed" >/dev/null
fi
# No further comparation is needed
@@ -91,14 +100,13 @@ for ip in $ip_list; do
if [ ! -e "$VESTA/data/ips/$ip" ]; then
interface=$(/sbin/ip addr |grep $ip |awk '{print $NF}')
interface=$(echo $interface |cut -f 1 -d :)
- netmask=$(/sbin/ip addr |grep $ip |awk '{print $2}' |cut -f 2 -d /)
+ netmask=$(/sbin/ip addr |grep $ip |cut -f 2 -d / |cut -f 1 -d \ )
netmask=$(convert_cidr $netmask)
$BIN/v-add-sys-ip $ip $netmask $interface
fi
done
-
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
diff --git a/bin/v-update-sys-ip-counters b/bin/v-update-sys-ip-counters
index dd51f9e9..bafeed13 100755
--- a/bin/v-update-sys-ip-counters
+++ b/bin/v-update-sys-ip-counters
@@ -45,7 +45,7 @@ for ip in $ip_list; do
# Calculate usage
ip_usage=$(grep -H $ip $VESTA/data/users/*/web.conf)
- web_domains=$(echo "$ip_usage"| wc -l)
+ web_domains=$(echo "$ip_usage" | sed '/^$/d' | wc -l)
sys_users=$(echo "$ip_usage" | cut -f7 -d/ | sort -u |\
tr '\n' ',' | sed "s/,$//g")
diff --git a/bin/v-update-sys-rrd-apache2 b/bin/v-update-sys-rrd-apache2
index 885882be..bdd0e226 100755
--- a/bin/v-update-sys-rrd-apache2
+++ b/bin/v-update-sys-rrd-apache2
@@ -69,16 +69,16 @@ fi
# Updating rrd graph
rrdtool graph $RRD/web/$period-apache2.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Connections" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-ftp b/bin/v-update-sys-rrd-ftp
index 8f926a4e..6f9e502e 100755
--- a/bin/v-update-sys-rrd-ftp
+++ b/bin/v-update-sys-rrd-ftp
@@ -63,16 +63,16 @@ fi
# Updating rrd graph
rrdtool graph $RRD/ftp/$period-ftp.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Connections" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-httpd b/bin/v-update-sys-rrd-httpd
index fefcb005..0a56b992 100755
--- a/bin/v-update-sys-rrd-httpd
+++ b/bin/v-update-sys-rrd-httpd
@@ -69,16 +69,16 @@ fi
# Updating rrd graph
rrdtool graph $RRD/web/$period-httpd.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Connections" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-la b/bin/v-update-sys-rrd-la
index d0093777..9d8b312b 100755
--- a/bin/v-update-sys-rrd-la
+++ b/bin/v-update-sys-rrd-la
@@ -64,21 +64,21 @@ fi
# Updating graph
rrdtool graph $RRD/la/$period-la.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Points" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
- -c "FRAME#484243" \
- -c "ARROW#FFFFFF" \
+ -c "FRAME#777777" \
+ -c "ARROW#555555" \
DEF:la=$RRD/la/la.rrd:LA:AVERAGE \
DEF:pr=$RRD/la/la.rrd:PR:AVERAGE \
COMMENT:'\r' \
diff --git a/bin/v-update-sys-rrd-mail b/bin/v-update-sys-rrd-mail
index 1f01b52d..15d70f71 100755
--- a/bin/v-update-sys-rrd-mail
+++ b/bin/v-update-sys-rrd-mail
@@ -62,16 +62,16 @@ fi
# Updating daily graph
rrdtool graph $RRD/mail/$period-mail.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Queue Size" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-mem b/bin/v-update-sys-rrd-mem
index 515ec280..2e767dbf 100755
--- a/bin/v-update-sys-rrd-mem
+++ b/bin/v-update-sys-rrd-mem
@@ -72,16 +72,16 @@ fi
# Updating rrd graph
rrdtool graph $RRD/mem/$period-mem.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Mbytes" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-mysql b/bin/v-update-sys-rrd-mysql
index d2f24824..8b9056aa 100755
--- a/bin/v-update-sys-rrd-mysql
+++ b/bin/v-update-sys-rrd-mysql
@@ -99,16 +99,16 @@ for host in $hosts; do
# Updating daily graph
rrdtool graph $RRD/db/$period-mysql_$host.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Queries" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-net b/bin/v-update-sys-rrd-net
index d8daaa17..979bff53 100755
--- a/bin/v-update-sys-rrd-net
+++ b/bin/v-update-sys-rrd-net
@@ -74,16 +74,16 @@ for iface in $ifaces; do
# Updating rrd graph
rrdtool graph $RRD/net/$period-$iface.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "KBytes" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-nginx b/bin/v-update-sys-rrd-nginx
index 7b75f7a7..b1b0b3e8 100755
--- a/bin/v-update-sys-rrd-nginx
+++ b/bin/v-update-sys-rrd-nginx
@@ -61,16 +61,16 @@ fi
# Updating rrd graph
rrdtool graph $RRD/web/$period-nginx.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Connections" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-pgsql b/bin/v-update-sys-rrd-pgsql
index 18eaa2ef..aeeb9582 100755
--- a/bin/v-update-sys-rrd-pgsql
+++ b/bin/v-update-sys-rrd-pgsql
@@ -104,16 +104,16 @@ for host in $hosts; do
# Updating rrd graph
rrdtool graph $RRD/db/$period-pgsql_$host.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Queries" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-rrd-ssh b/bin/v-update-sys-rrd-ssh
index aaaa8b97..44c6d167 100755
--- a/bin/v-update-sys-rrd-ssh
+++ b/bin/v-update-sys-rrd-ssh
@@ -62,16 +62,16 @@ fi
# Updating daily graph
rrdtool graph $RRD/ssh/$period-ssh.png \
--imgformat PNG \
- --height="120" \
- --width="440" \
+ --height="150" \
+ --width="670" \
--start "$start" \
--end "$end" \
--vertical-label "Connections" \
--x-grid "$grid" \
- -c "BACK#7a766d" \
- -c "SHADEA#7a766d" \
- -c "SHADEB#7a766d" \
- -c "FONT#FFFFFF" \
+ -c "BACK#ffffff" \
+ -c "SHADEA#ffffff" \
+ -c "SHADEB#ffffff" \
+ -c "FONT#555555" \
-c "CANVAS#302c2d" \
-c "GRID#666666" \
-c "MGRID#AAAAAA" \
diff --git a/bin/v-update-sys-vesta b/bin/v-update-sys-vesta
index d47fb9f0..8fec0ce7 100755
--- a/bin/v-update-sys-vesta
+++ b/bin/v-update-sys-vesta
@@ -42,11 +42,7 @@ if [ -e "/etc/redhat-release" ]; then
# Update vesta package
$yum update $package > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "Error: $package update failed"
- log_event "$E_UPDATE" "$EVENT"
- exit $E_UPDATE
- fi
+ check_result $? "$pacakge update failed" $E_UPDATE
else
# Update repo
apt-get update -o Dir::Etc::sourcelist="sources.list.d/vesta.list" \
@@ -54,11 +50,7 @@ else
# Update vesta package
apt-get install $package -qq > /dev/null 2>&1
- if [ $? -ne 0 ]; then
- echo "Error: $package update failed"
- log_event "$E_UPDATE" "$EVENT"
- exit $E_UPDATE
- fi
+ check_result $? "$pacakge update failed" $E_UPDATE
fi
diff --git a/bin/v-update-user-quota b/bin/v-update-user-quota
index f248662e..754639b7 100755
--- a/bin/v-update-user-quota
+++ b/bin/v-update-user-quota
@@ -31,12 +31,20 @@ is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Updating disk quota
-soft=$(get_user_value '$DISK_QUOTA')
-soft=$((soft * 1000))
-hard=$((soft + 50000))
+# Had quota equals package value. Soft quota equals 90% of package value for warnings.
+quota=$(get_user_value '$DISK_QUOTA')
+soft=$(echo "$quota * 1024 * 0.90"|bc |cut -f 1 -d .)
+hard=$(echo "$quota * 1024"|bc |cut -f 1 -d .)
+# Searching home mount point
mnt=$(df -P /home |awk '{print $6}' |tail -n1)
-setquota $user $soft $hard 0 0 $mnt
+
+# Checking unlinmited quota
+if [ "$quota" = 'unlimited' ]; then
+ setquota $user 0 0 0 0 $mnt 2>/dev/null
+else
+ setquota $user $soft $hard 0 0 $mnt 2>/dev/null
+fi
#----------------------------------------------------------#
diff --git a/bin/v-update-web-templates b/bin/v-update-web-templates
index 617a7e27..7599f7c7 100755
--- a/bin/v-update-web-templates
+++ b/bin/v-update-web-templates
@@ -1,5 +1,5 @@
#!/bin/bash
-# info: updates web templates
+# info: update web templates
# options: [RESTART]
#
# The function for obtaining updated pack of web templates.
@@ -21,37 +21,40 @@ source $VESTA/conf/vesta.conf
# Action #
#----------------------------------------------------------#
-# Find out OS name
-if [ -e "/etc/redhat-release" ]; then
- os="rhel"
-else
- os="ubuntu"
+# Defining config host
+chost='c.vestacp.com'
+
+# Detcing OS
+case $(head -n1 /etc/issue |cut -f 1 -d ' ') in
+ Debian) version="debian" ;;
+ Ubuntu) version="ubuntu" ;;
+ *) version="rhel" ;;
+esac
+
+# Detecting release
+if [ "$version" = 'rhel' ]; then
+ release=$(grep -o "[0-9]" /etc/redhat-release |head -n1)
+fi
+if [ "$version" = 'ubuntu' ]; then
+ release=$(lsb_release -r |awk '{print $2}')
+fi
+if [ "$version" = 'debian' ]; then
+ release=$(cat /etc/issue|grep -o [0-9]|head -n1)
fi
-# Get new archive
-tmpdir=$(mktemp -d --dry-run)
-mkdir $tmpdir
-cd $tmpdir
-wget http://c.vestacp.com/$VERSION/$os/templates.tar.gz -q
-if [ "$?" -ne 0 ]; then
- echo "Error: can't download template.tar.gz"
- log_event "$E_CONNECT" "$EVENT"
- rm -rf $tmpdir
- exit $E_CONNECT
-fi
+# Defining download url
+vestacp="http://$chost/$version/$release"
-# Update templates
+# Downloading template archive
+cd $(mktemp -d)
+wget $vestacp/templates.tar.gz -q
+
+check_result $? "can't download template.tar.gz" $E_CONNECT
+
+# Updating templates
tar -xzpf templates.tar.gz -C $VESTA/data/ templates/web
-# Replace includes for apache2.4
-if [ "$WEB_SYSTEM" = 'httpd' ] || [ "$WEB_SYSTEM" = 'apache2' ]; then
- if [ ! -z "$(/usr/sbin/apachectl -v | grep 'Apache/2.4')" ]; then
- sed -i "s/Include /IncludeOptional /g" \
- $VESTA/data/templates/web/$WEB_SYSTEM/*tpl
- fi
-fi
-
-# Rebuild web domains
+# Rebuilding web domains
for user in $($BIN/v-list-sys-users plain); do
$BIN/v-rebuild-web-domains $user no
done
@@ -61,20 +64,20 @@ done
# Vesta #
#----------------------------------------------------------#
-# Restart web server
+# Restarting web server
if [ "$restart" != 'no' ]; then
$BIN/v-restart-web
- if [ $? -ne 0 ]; then
- exit $E_RESTART
+ check_result $? "restart" >/dev/null 2>&1
+
+ if [ ! -z "$PROXY_SYSTTEM" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "restart" >/dev/null 2>&1
fi
- $BIN/v-restart-proxy
- if [ $? -ne 0 ]; then
- exit $E_RESTART
+ if [ ! -z "$WEB_BACKEND" ]; then
+ $BIN/v-restart-proxy
+ check_result $? "restart" >/dev/null 2>&1
fi
fi
-# Delete tmpdir
-rm -rf $tmpdir
-
exit
diff --git a/func/db.sh b/func/db.sh
index a5b2877c..270313f6 100644
--- a/func/db.sh
+++ b/func/db.sh
@@ -1,3 +1,103 @@
+# MySQL
+mysql_connect() {
+ host_str=$(grep "HOST='$1'" $VESTA/conf/mysql.conf)
+ eval $host_str
+ if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
+ echo "Error: mysql config parsing failed"
+ log_event "$E_PARSING" "$EVENT"
+ exit $E_PARSING
+ fi
+
+ mycnf="$VESTA/conf/.mysql.$HOST"
+ if [ ! -e "$mycnf" ]; then
+ echo "[client]">$mycnf
+ echo "host='$HOST'" >> $mycnf
+ echo "user='$USER'" >> $mycnf
+ echo "password='$PASSWORD'" >> $mycnf
+ chmod 600 $mycnf
+ else
+ mypw=$(grep password $mycnf|cut -f 2 -d \')
+ if [ "$mypw" != "$PASSWORD" ]; then
+ echo "[client]">$mycnf
+ echo "host='$HOST'" >> $mycnf
+ echo "user='$USER'" >> $mycnf
+ echo "password='$PASSWORD'" >> $mycnf
+ chmod 660 $mycnf
+ fi
+ fi
+ err="/tmp/e.mysql"
+ mysql --defaults-file=$mycnf -e 'SELECT VERSION()' >/dev/null 2> $err
+ if [ '0' -ne "$?" ]; then
+ if [ "$notify" != 'no' ]; then
+ echo -e "Can't connect to MySQL $HOST\n$(cat $err)" |\
+ $send_mail -s "$subj" $email
+ fi
+ echo "Error: Connection to $HOST failed"
+ log_event "$E_CONNECT" "$EVENT"
+ exit $E_CONNECT
+ fi
+}
+
+mysql_query() {
+ mysql --defaults-file=$mycnf -e "$1" 2>/dev/null
+}
+
+mysql_dump() {
+ err="/tmp/e.mysql"
+ mysqldump --defaults-file=$mycnf --single-transaction -r $1 $2 2> $err
+ if [ '0' -ne "$?" ]; then
+ rm -rf $tmpdir
+ if [ "$notify" != 'no' ]; then
+ echo -e "Can't dump database $database\n$(cat $err)" |\
+ $send_mail -s "$subj" $email
+ fi
+ echo "Error: dump $database failed"
+ log_event "$E_DB" "$EVENT"
+ exit $E_DB
+ fi
+}
+
+# PostgreSQL
+psql_connect() {
+ host_str=$(grep "HOST='$1'" $VESTA/conf/pgsql.conf)
+ eval $host_str
+ export PGPASSWORD="$PASSWORD"
+ if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
+ echo "Error: postgresql config parsing failed"
+ log_event "$E_PARSING" "$EVENT"
+ exit $E_PARSING
+ fi
+
+ psql -h $HOST -U $USER -c "SELECT VERSION()" > /dev/null 2>/tmp/e.psql
+ if [ '0' -ne "$?" ]; then
+ if [ "$notify" != 'no' ]; then
+ echo -e "Can't connect to PostgreSQL $HOST\n$(cat /tmp/e.psql)" |\
+ $send_mail -s "$subj" $email
+ fi
+ echo "Error: Connection to $HOST failed"
+ log_event "$E_CONNECT" "$EVENT"
+ exit $E_CONNECT
+ fi
+}
+
+psql_query() {
+ psql -h $HOST -U $USER -c "$1" 2>/dev/null
+}
+
+psql_dump() {
+ pg_dump -h $HOST -U $USER -c --inserts -O -x -i -f $1 $2 2>/tmp/e.psql
+ if [ '0' -ne "$?" ]; then
+ rm -rf $tmpdir
+ if [ "$notify" != 'no' ]; then
+ echo -e "Can't dump database $database\n$(cat /tmp/e.psql)" |\
+ $send_mail -s "$subj" $email
+ fi
+ echo "Error: dump $database failed"
+ log_event "$E_DB" "$EVENT"
+ exit $E_DB
+ fi
+}
+
# Get database host
get_next_dbhost() {
if [ -z "$host" ] || [ "$host" == 'default' ]; then
@@ -86,59 +186,30 @@ decrease_dbhost_values() {
# Create MySQL database
add_mysql_database() {
- host_str=$(grep "HOST='$host'" $VESTA/conf/mysql.conf)
- eval $host_str
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
- echo "Error: mysql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
+ mysql_connect $host
query="CREATE DATABASE \`$database\` CHARACTER SET $charset"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@\`%\`
IDENTIFIED BY '$dbpass'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="GRANT ALL ON \`$database\`.* TO \`$dbuser\`@localhost
IDENTIFIED BY '$dbpass'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="SHOW GRANTS FOR \`$dbuser\`"
- md5=$(mysql -h $HOST -u $USER -p$PASSWORD -e "$query")
+ md5=$(mysql_query "$query" 2>/dev/null)
md5=$(echo "$md5" |grep 'PASSWORD' |tr ' ' '\n' |tail -n1 |cut -f 2 -d \')
}
# Create PostgreSQL database
add_pgsql_database() {
- host_str=$(grep "HOST='$host'" $VESTA/conf/pgsql.conf)
- eval $host_str
- export PGPASSWORD="$PASSWORD"
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
- echo "Error: postgresql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
+ psql_connect $host
query="CREATE ROLE $dbuser WITH LOGIN PASSWORD '$dbpass'"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
query="CREATE DATABASE $database OWNER $dbuser"
if [ "$TPL" = 'template0' ]; then
@@ -146,16 +217,16 @@ add_pgsql_database() {
else
query="$query TEMPLATE $TPL"
fi
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
query="GRANT ALL PRIVILEGES ON DATABASE $database TO $dbuser"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
query="GRANT CONNECT ON DATABASE template1 to $dbuser"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
query="SELECT rolpassword FROM pg_authid WHERE rolname='$dbuser';"
- md5=$(psql -h $HOST -U $USER -c "$query"|grep md5|cut -f 2 -d \ )
+ md5=$(psql_query "$query" | grep md5 | cut -f 2 -d \ )
}
# Check if database host do not exist in config
@@ -170,28 +241,6 @@ is_dbhost_new() {
fi
}
-# Check MySQL database host
-is_mysql_host_alive() {
- query='SELECT VERSION()'
- mysql -h $host -u $dbuser -p$dbpass -e "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection to $host failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-}
-
-# Check PostgreSQL database host
-is_pgsql_host_alive() {
- export PGPASSWORD="$dbpass"
- psql -h $host -U $dbuser -c "SELECT VERSION()" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection to $host failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-}
-
# Get database values
get_database_values() {
db_str=$(grep "DB='$database'" $USER_DATA/db.conf)
@@ -200,212 +249,91 @@ get_database_values() {
# Change MySQL database password
change_mysql_password() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/mysql.conf)
- eval $host_str
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
- echo "Error: mysql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
+ mysql_connect $HOST
query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@\`%\`
IDENTIFIED BY '$dbpass'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@localhost
IDENTIFIED BY '$dbpass'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="SHOW GRANTS FOR '$DBUSER'"
- md5=$(mysql -h $HOST -u $USER -p$PASSWORD -e "$query")
+ md5=$(mysql_query "$query" 2>/dev/null)
md5=$(echo "$md5" |grep 'PASSWORD' |tr ' ' '\n' |tail -n1 |cut -f 2 -d \')
}
# Change PostgreSQL database password
change_pgsql_password() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
- eval $host_str
- export PGPASSWORD="$PASSWORD"
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
- echo "Error: postgresql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
+ psql_connect $HOST
query="ALTER ROLE $DBUSER WITH LOGIN PASSWORD '$dbpass'"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
query="SELECT rolpassword FROM pg_authid WHERE rolname='$DBUSER';"
- md5=$(psql -h $HOST -U $USER -c "$query"|grep md5|cut -f 2 -d \ )
+ md5=$(psql_query "$query" | grep md5 |cut -f 2 -d \ )
}
# Delete MySQL database
delete_mysql_database() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/mysql.conf)
- eval $host_str
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
- echo "Error: mysql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
+ mysql_connect $HOST
query="DROP DATABASE \`$database\`"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="REVOKE ALL ON \`$database\`.* FROM \`$DBUSER\`@\`%\`"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="REVOKE ALL ON \`$database\`.* FROM \`$DBUSER\`@localhost"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
if [ "$(grep "DBUSER='$DBUSER'" $USER_DATA/db.conf |wc -l)" -lt 2 ]; then
query="DROP USER '$DBUSER'@'%'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="DROP USER '$DBUSER'@'localhost'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
fi
}
# Delete PostgreSQL database
delete_pgsql_database() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
- eval $host_str
- export PGPASSWORD="$PASSWORD"
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
- echo "Error: postgresql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
+ psql_connect $HOST
query="REVOKE ALL PRIVILEGES ON DATABASE $database FROM $DBUSER"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_qyery "$query" > /dev/null
query="DROP DATABASE $database"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
if [ "$(grep "DBUSER='$DBUSER'" $USER_DATA/db.conf |wc -l)" -lt 2 ]; then
query="REVOKE CONNECT ON DATABASE template1 FROM $db_user"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
query="DROP ROLE $db_user"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
fi
}
# Dump MySQL database
dump_mysql_database() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/mysql.conf)
- eval $host_str
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
- rm -rf $tmpdir
- echo "Can't parse mysql config" | $send_mail -s "$subj" $email
- echo "Error: mysql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
+ mysql_connect $HOST
- query='SELECT VERSION()'
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" >/dev/null 2>/tmp/e.mysql
- if [ '0' -ne "$?" ]; then
- rm -rf $tmpdir
- echo -e "Can't connect to $HOST\n$(cat /tmp/e.mysql)" |\
- $send_mail -s "$subj" $email
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
- mysqldump --single-transaction -h $HOST -u $USER -p$PASSWORD \
- -r $dump $database 2>/tmp/e.mysql
- if [ '0' -ne "$?" ]; then
- rm -rf $tmpdir
- echo -e "Can't dump database $database\n$(cat /tmp/e.mysql)" |\
- $send_mail -s "$subj" $email
- echo "Error: dump $database failed"
- log_event "$E_DB" "$EVENT"
- exit $E_DB
- fi
+ mysql_dump $dump $database
query="SHOW GRANTS FOR '$DBUSER'@'localhost'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" |\
- grep -v "Grants for" > $grants
+ mysql_query "$query" | grep -v "Grants for" > $grants
query="SHOW GRANTS FOR '$DBUSER'@'%'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" |\
- grep -v "Grants for" > $grants
+ mysql_query "$query" | grep -v "Grants for" > $grants
}
# Dump PostgreSQL database
dump_pgsql_database() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
- eval $host_str
- export PGPASSWORD="$PASSWORD"
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
- rm -rf $tmpdir
- echo "Can't parse pgsql config" |\
- $send_mail -s "$subj" $email
- echo "Error: postgresql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
+ psql_connect $HOST
- query='SELECT VERSION()'
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- rm -rf $tmpdir
- echo "Can't connect to pgsql server $HOST" |\
- $send_mail -s "$subj" $email
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
- pg_dump -h $HOST -U $USER -c --inserts -O -x -i -f $dump $database \
- 2> /dev/null
-
- if [ '0' -ne "$?" ]; then
- rm -rf $tmpdir
- echo "Can't dump pgsql database $database" |\
- $send_mail -s "$subj" $email
- echo "Error: dump $database failed"
- log_event "$E_DB" "$EVENT"
- exit $E_DB
- fi
+ psql_dump $dump $database
query="SELECT rolpassword FROM pg_authid WHERE rolname='$DBUSER';"
- md5=$(psql -h $HOST -U $USER -c "$query" | head -n1 | cut -f 2 -d \ )
+ md5=$(psql_query "$query" | head -n1 | cut -f 2 -d \ )
pw_str="UPDATE pg_authid SET rolpassword='$md5' WHERE rolname='$DBUSER';"
gr_str="GRANT ALL PRIVILEGES ON DATABASE $database to '$DBUSER'"
echo -e "$pw_str\n$gr_str" >> $grants
@@ -424,121 +352,42 @@ is_dbhost_free() {
# Suspend MySQL database
suspend_mysql_database() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/mysql.conf)
- eval $host_str
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
- echo "Error: mysql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
+ mysql_connect $HOST
query="REVOKE ALL ON \`$database\`.* FROM \`$DBUSER\`@\`%\`"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
-
+ mysql_query "$query" > /dev/null
query="REVOKE ALL ON \`$database\`.* FROM \`$DBUSER\`@localhost"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
}
# Suspend PostgreSQL database
suspend_pgsql_database() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
- eval $host_str
- export PGPASSWORD="$PASSWORD"
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
- echo "Error: postgresql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
+ psql_connect $HOST
query="REVOKE ALL PRIVILEGES ON $database FROM $DBUSER"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
}
# Unsuspend MySQL database
unsuspend_mysql_database() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/mysql.conf)
- eval $host_str
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
- echo "Error: mysql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
+ mysql_connect $HOST
query="GRANT ALL ON \`$database\`.* FROM \`$DBUSER\`@\`%\`"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
-
+ mysql_query "$query" > /dev/null
query="GRANT ALL ON \`$database\`.* TO \`$DBUSER\`@localhost"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
}
# Unsuspend PostgreSQL database
unsuspend_pgsql_database() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
- eval $host_str
- export PGPASSWORD="$PASSWORD"
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
- echo "Error: postgresql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
+ psql_connect $HOST
query="GRANT ALL PRIVILEGES ON DATABASE $database TO $DBUSER"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
}
# Get MySQL disk usage
get_mysql_disk_usage() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/mysql.conf)
- eval $host_str
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
- echo "Error: mysql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection to $HOST failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
-
+ mysql_connect $HOST
query="SELECT SUM( data_length + index_length ) / 1024 / 1024 \"Size\"
FROM information_schema.TABLES WHERE table_schema='$database'"
- usage=$(mysql -h $HOST -u $USER -p$PASSWORD -e "$query" |tail -n1)
+ usage=$(mysql_query "$query" |tail -n1)
if [ "$usage" == 'NULL' ] || [ "${usage:0:1}" -eq '0' ]; then
usage=1
fi
@@ -548,25 +397,10 @@ get_mysql_disk_usage() {
# Get PostgreSQL disk usage
get_pgsql_disk_usage() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
- eval $host_str
- export PGPASSWORD="$PASSWORD"
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
- echo "Error: postgresql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
+ psql_connect $HOST
query="SELECT pg_database_size('$database');"
- usage=$(psql -h $HOST -U $USER -c "$query")
+ usage=$(psql_query "$query")
usage=$(echo "$usage" | grep -v "-" | grep -v 'row' | sed "/^$/d")
usage=$(echo "$usage" | grep -v "pg_database_size" | awk '{print $1}')
if [ -z "$usage" ]; then
@@ -580,59 +414,31 @@ get_pgsql_disk_usage() {
# Delete MySQL user
delete_mysql_user() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/mysql.conf)
- eval $host_str
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ]; then
- echo "Error: mysql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
+ mysql_connect $HOST
query="REVOKE ALL ON \`$database\`.* FROM \`$old_dbuser\`@\`%\`"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="REVOKE ALL ON \`$database\`.* FROM \`$old_dbuser\`@localhost"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="DROP USER '$old_dbuser'@'%'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
query="DROP USER '$old_dbuser'@'localhost'"
- mysql -h $HOST -u $USER -p$PASSWORD -e "$query" > /dev/null 2>&1
+ mysql_query "$query" > /dev/null
}
# Delete PostgreSQL user
delete_pgsql_user() {
- host_str=$(grep "HOST='$HOST'" $VESTA/conf/pgsql.conf)
- eval $host_str
- export PGPASSWORD="$PASSWORD"
- if [ -z $HOST ] || [ -z $USER ] || [ -z $PASSWORD ] || [ -z $TPL ]; then
- echo "Error: postgresql config parsing failed"
- log_event "$E_PARSING" "$EVENT"
- exit $E_PARSING
- fi
-
- query='SELECT VERSION()'
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
- if [ '0' -ne "$?" ]; then
- echo "Error: Connection failed"
- log_event "$E_CONNECT" "$EVENT"
- exit $E_CONNECT
- fi
+ psql_connect $HOST
query="REVOKE ALL PRIVILEGES ON DATABASE $database FROM $old_dbuser"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
query="REVOKE CONNECT ON DATABASE template1 FROM $old_dbuser"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
+
query="DROP ROLE $old_dbuser"
- psql -h $HOST -U $USER -c "$query" > /dev/null 2>&1
+ psql_query "$query" > /dev/null
}
diff --git a/func/domain.sh b/func/domain.sh
index 58f35eb6..6fdabc08 100644
--- a/func/domain.sh
+++ b/func/domain.sh
@@ -1,7 +1,7 @@
# Web template check
is_web_template_valid() {
- t="$WEBTPL/$WEB_SYSTEM/$template.tpl"
- s="$WEBTPL/$WEB_SYSTEM/$template.stpl"
+ t="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$template.tpl"
+ s="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$template.stpl"
if [ ! -e $t ] || [ ! -e $s ]; then
echo "Error: web template $template not found"
log_event "$E_NOTEXIST" "$EVENT"
@@ -11,15 +11,66 @@ is_web_template_valid() {
# Proxy template check
is_proxy_template_valid() {
- t="$WEBTPL/$PROXY_SYSTEM/$template.tpl"
- s="$WEBTPL/$PROXY_SYSTEM/$template.stpl"
+ proxy=$1
+ t="$WEBTPL/$PROXY_SYSTEM/$proxy.tpl"
+ s="$WEBTPL/$PROXY_SYSTEM/$proxy.stpl"
if [ ! -e $t ] || [ ! -e $s ]; then
- echo "Error: proxy template $template not found"
+ echo "Error: proxy template $proxy not found"
log_event "$E_NOTEXIST" "$EVENT"
exit $E_NOTEXIST
fi
}
+# Backend template check
+is_web_backend_template_valid() {
+ if [ ! -z "$1" ]; then
+ template=$1
+ else
+ template=$(grep BACKEND_TEMPLATE $USER_DATA/user.conf)
+ fi
+ if [ -z "$template" ]; then
+ if [ -e "$WEBTPL/$WEB_BACKEND/default.tpl" ]; then
+ sed -i "s/^WEB_DOMAINS/BACKEND_TEMPLATE='default'\nWEB_DOMAINS/g" \
+ $USER_DATA/user.conf
+ template='default'
+ else
+ echo "Error: backend template default not found"
+ log_event "$E_NOTEXIST" "$EVENT"
+ exit $E_NOTEXIST
+ fi
+ else
+ template=$(echo "$template"|cut -f 2 -d \'|head -n1)
+ if [ ! -e "$WEBTPL/$WEB_BACKEND/$template.tpl" ]; then
+ echo "Error: backend template $template not found"
+ log_event "$E_NOTEXIST" "$EVENT"
+ exit $E_NOTEXIST
+ fi
+ fi
+}
+
+# Backend pool check
+is_web_backend_pool_valid(){
+ if [ -d "/etc/php-fpm.d" ]; then
+ pool="/etc/php-fpm.d"
+ fi
+ if [ -d "/etc/php5/fpm/pool.d" ]; then
+ pool="/etc/php5/fpm/pool.d"
+ fi
+ if [ -d "/etc/php-fpm-5.5.d" ]; then
+ pool="/etc/php-fpm-5.5.d"
+ fi
+ if [ ! -e "$pool" ]; then
+ echo "Error: backend pool directory not found"
+ log_event "$E_NOTEXIST" "$EVENT"
+ exit $E_NOTEXIST
+ fi
+
+ backend="$domain"
+ if [ "$WEB_BACKEND_POOL" = 'user' ]; then
+ backend="$user"
+ fi
+}
+
# DNS template check
is_dns_template_valid() {
t="$DNSTPL/$template.tpl"
@@ -34,65 +85,73 @@ is_dns_template_valid() {
is_domain_new() {
type="$1"
dom=${2-$domain}
-
- web=$(grep -F -H "DOMAIN='$dom'" $VESTA/data/users/*/web.conf)
- dns=$(grep -F -H "DOMAIN='$dom'" $VESTA/data/users/*/dns.conf)
- mail=$(grep -F -H "DOMAIN='$dom'" $VESTA/data/users/*/mail.conf)
+ object=${3-domain}
# Check web domain
+ if [ ! -z "$WEB_SYSTEM" ]; then
+ web=$(grep -F -H "DOMAIN='$dom'" $VESTA/data/users/*/web.conf)
+ fi
if [ ! -z "$web" ] && [ "$type" == 'web' ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
if [ ! -z "$web" ]; then
web_user=$(echo "$web" |cut -f 7 -d /)
if [ "$web_user" != "$user" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
fi
# Check dns domain
+ if [ ! -z "$DNS_SYSTEM" ]; then
+ dns=$(grep -F -H "DOMAIN='$dom'" $VESTA/data/users/*/dns.conf)
+ fi
if [ ! -z "$dns" ] && [ "$type" == 'dns' ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
if [ ! -z "$dns" ]; then
dns_user=$(echo "$dns" |cut -f 7 -d /)
if [ "$dns_user" != "$user" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
fi
# Check mail domain
+ if [ ! -z "$MAIL_SYSTEM" ]; then
+ mail=$(grep -F -H "DOMAIN='$dom'" $VESTA/data/users/*/mail.conf)
+ fi
if [ ! -z "$mail" ] && [ "$type" == 'mail' ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
if [ ! -z "$mail" ]; then
mail_user=$(echo "$mail" |cut -f 7 -d /)
if [ "$mail_user" != "$user" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
fi
# Check web aliases
- web_alias=$(grep -w $dom $VESTA/data/users/*/web.conf)
+ if [ ! -z "$WEB_SYSTEM" ]; then
+ web_alias=$(grep -w $dom $VESTA/data/users/*/web.conf)
+ fi
if [ ! -z "$web_alias" ]; then
- c1=$(grep -H "'$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /)
- c2=$(grep -H "'$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /)
- c3=$(grep -H ",$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /)
- c4=$(grep -H ",$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /)
+ c1=$(grep -HF "'$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /)
+ c2=$(grep -HF "'$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /)
+ c3=$(grep -HF ",$dom," $VESTA/data/users/*/web.conf | cut -f 7 -d /)
+ c4=$(grep -HF ",$dom'" $VESTA/data/users/*/web.conf | cut -f 7 -d /)
if [ ! -z "$c1" ] && [ "$type" == "web" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
@@ -103,34 +162,34 @@ is_domain_new() {
fi
if [ ! -z "$c2" ] && [ "$type" == "web" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
if [ ! -z "$c2" ] && [ "$c2" != "$user" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
if [ ! -z "$c3" ] && [ "$type" == "web" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
if [ ! -z "$c3" ] && [ "$c3" != "$user" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
if [ ! -z "$c4" ] && [ "$type" == "web" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
if [ ! -z "$c4" ] && [ "$c4" != "$user" ]; then
- echo "Error: domain $dom exist"
+ echo "Error: $object $dom exist"
log_event "$E_EXISTS" "$EVENT"
exit $E_EXISTS
fi
@@ -156,11 +215,44 @@ is_mail_new() {
# Update domain zone
update_domain_zone() {
- conf="$HOMEDIR/$user/conf/dns/$domain.db"
- line=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf)
+ domain_param=$(grep "DOMAIN='$domain'" $USER_DATA/dns.conf)
+ eval $domain_param
+ SOA=$(idn --quiet -a -t "$SOA")
+ if [ -z "$SERIAL" ]; then
+ SERIAL=$(date +'%Y%m%d01')
+ fi
+ zn_conf="$HOMEDIR/$user/conf/dns/$domain.db"
+ echo "\$TTL $TTL
+@ IN SOA $SOA. root.$domain_idn. (
+ $SERIAL
+ 7200
+ 3600
+ 1209600
+ 180 )
+" > $zn_conf
fields='$RECORD\t$TTL\tIN\t$TYPE\t$PRIORITY\t$VALUE'
- if [ -e $conf ]; then
- zn_serial=$(head $conf|grep 'SOA' -A1|tail -n 1|sed "s/ //g")
+ while read line ; do
+ IFS=$'\n'
+ for key in $(echo $line|sed "s/' /'\n/g"); do
+ eval ${key%%=*}="${key#*=}"
+ done
+
+ RECORD=$(idn --quiet -a -t "$RECORD")
+ if [ "$TYPE" = 'CNAME' ] || [ "$TYPE" = 'MX' ]; then
+ VALUE=$(idn --quiet -a -t "$VALUE")
+ fi
+
+ if [ "$SUSPENDED" != 'yes' ]; then
+ eval echo -e "\"$fields\""|sed "s/%quote%/'/g" >> $zn_conf
+ fi
+ done < $USER_DATA/dns/$domain.conf
+}
+
+# Update zone serial
+update_domain_serial() {
+ zn_conf="$HOMEDIR/$user/conf/dns/$domain.db"
+ if [ -e $zn_conf ]; then
+ zn_serial=$(head $zn_conf |grep 'SOA' -A1 |tail -n 1 |sed "s/ //g")
s_date=$(echo ${zn_serial:0:8})
c_date=$(date +'%Y%m%d')
if [ "$s_date" == "$c_date" ]; then
@@ -177,32 +269,8 @@ update_domain_zone() {
else
serial="$(date +'%Y%m%d01')"
fi
-
- eval $line
- SOA=$(idn --quiet -a -t "$SOA")
- echo "\$TTL $TTL
-@ IN SOA $SOA. root.$domain_idn. (
- $serial
- 7200
- 3600
- 1209600
- 180 )
-" > $conf
- while read line ; do
- IFS=$'\n'
- for key in $(echo $line|sed "s/' /'\n/g"); do
- eval ${key%%=*}="${key#*=}"
- done
-
- RECORD=$(idn --quiet -a -t "$RECORD")
- if [ "$TYPE" = 'CNAME' ] || [ "$TYPE" = 'MX' ]; then
- VALUE=$(idn --quiet -a -t "$VALUE")
- fi
-
- if [ "$SUSPENDED" != 'yes' ]; then
- eval echo -e "\"$fields\""|sed "s/%quote%/'/g" >> $conf
- fi
- done < $USER_DATA/dns/$domain.conf
+ add_object_key "dns" 'DOMAIN' "$domain" 'SERIAL' 'RECORDS'
+ update_object_value 'dns' 'DOMAIN' "$domain" '$SERIAL' "$serial"
}
# Get next DNS record ID
@@ -228,6 +296,7 @@ add_web_config() {
-e "s|%web_system%|$WEB_SYSTEM|g" \
-e "s|%web_port%|$WEB_PORT|g" \
-e "s|%web_ssl_port%|$WEB_SSL_PORT|g" \
+ -e "s|%backend_lsnr%|$backend_lsnr|g" \
-e "s|%rgroups%|$WEB_RGROUPS|g" \
-e "s|%proxy_system%|$PROXY_SYSTEM|g" \
-e "s|%proxy_port%|$PROXY_PORT|g" \
@@ -254,6 +323,7 @@ add_web_config() {
# Get config top and bottom line numbers
get_web_config_brds() {
+
serv_line=$(egrep -ni "Name %domain_idn%($| )" $tpl_file |cut -f 1 -d :)
if [ -z "$serv_line" ]; then
log_event "$E_PARSING" "$EVENT"
@@ -264,15 +334,14 @@ get_web_config_brds() {
bfr_line=$((serv_line - 1))
aftr_line=$((last_line - serv_line - 1))
- str=$(egrep -ni "Name $domain_idn($| )" $conf | cut -f 1 -d :)
+ str=$(grep -niF "Name $domain_idn" $conf |egrep "$domain_idn$|$domain_idn ")
+ str=$(echo "$str" |cut -f 1 -d :)
top_line=$((str - serv_line + 1))
bottom_line=$((top_line + last_line -1))
-
multi=$(sed -n "$top_line,$bottom_line p" $conf |grep ServerAlias |wc -l)
if [ "$multi" -ge 2 ]; then
bottom_line=$((bottom_line + multi -1))
fi
-
}
# Replace web config
@@ -297,6 +366,15 @@ get_domain_values() {
done
}
+# Get backend values
+get_domain_backend_values() {
+ lsnr=$(grep "listen =" $pool/$backend.conf |cut -f 2 -d = |sed "s/ //")
+ backend_lsnr="$lsnr"
+ if [ ! -z "$(echo $lsnr |grep /)" ]; then
+ backend_lsnr="unix:$backend_lsnr"
+ fi
+}
+
# SSL certificate verification
is_web_domain_cert_valid() {
if [ ! -e "$ssl_dir/$domain.crt" ]; then
@@ -373,7 +451,10 @@ upd_web_domain_values() {
if [ "$SSL_HOME" = 'single' ]; then
sdocroot="$HOMEDIR/$user/web/$domain/public_shtml" ;
fi
-
+ if [ ! -z "$WEB_BACKEND" ]; then
+ is_web_backend_pool_valid
+ get_domain_backend_values
+ fi
i=1
j=1
OLD_IFS="$IFS"
diff --git a/func/ip.sh b/func/ip.sh
index a77c62d5..9fb0a28a 100644
--- a/func/ip.sh
+++ b/func/ip.sh
@@ -178,7 +178,11 @@ get_real_ip() {
echo $1
else
nated_ip=$(grep -H "^NAT='$1'" $VESTA/data/ips/*)
- echo "$nated_ip" | cut -f 1 -d : | cut -f 7 -d /
+ if [ ! -z "$nated_ip" ]; then
+ echo "$nated_ip" | cut -f 1 -d : | cut -f 7 -d /
+ else
+ get_user_ip
+ fi
fi
}
diff --git a/func/main.sh b/func/main.sh
index 8d309f36..2dd448f7 100644
--- a/func/main.sh
+++ b/func/main.sh
@@ -2,16 +2,6 @@
DATE=$(date +%F)
TIME=$(date +%T)
SCRIPT=$(basename $0)
-A1=$1
-A2=$2
-A3=$3
-A4=$4
-A5=$5
-A6=$6
-A7=$7
-A8=$8
-A9=$9
-EVENT="$DATE $TIME $SCRIPT $A1 $A2 $A3 $A4 $A5 $A6 $A7 $A8 $A9"
HOMEDIR='/home'
BACKUP='/backup'
BACKUP_GZIP=5
@@ -26,6 +16,7 @@ USER_DATA=$VESTA/data/users/$user
WEBTPL=$VESTA/data/templates/web
DNSTPL=$VESTA/data/templates/dns
RRD=$VESTA/web/rrd
+send_mail="$VESTA/web/inc/mail-wrapper.php"
# Return codes
OK=0
@@ -50,6 +41,16 @@ E_RRD=18
E_UPDATE=19
E_RESTART=20
+# Event string for logger
+EVENT="$DATE $TIME $SCRIPT"
+for ((I=1; I <= $# ; I++)); do
+ if [[ "$HIDE" != $I ]]; then
+ EVENT="$EVENT '$(eval echo \$${I})'"
+ else
+ EVENT="$EVENT '******'"
+ fi
+done
+
# Log event function
log_event() {
if [ "$1" -eq 0 ]; then
@@ -78,6 +79,20 @@ log_history() {
echo "ID='$id' DATE='$DATE' TIME='$TIME' CMD='$cmd' UNDO='$undo'" >> $log
}
+# Result checker
+check_result() {
+ if [ $1 -ne 0 ]; then
+ echo "Error: $2"
+ if [ ! -z "$3" ]; then
+ log_event $3 $EVENT
+ exit $3
+ else
+ log_event $1 $EVENT
+ exit $1
+ fi
+ fi
+}
+
# Argument list checker
check_args() {
if [ "$1" -gt "$2" ]; then
@@ -113,8 +128,8 @@ is_package_full() {
CRON_JOBS) used=$(wc -l $USER_DATA/cron.conf |cut -f1 -d \ );;
esac
limit=$(grep "^$1=" $USER_DATA/user.conf | cut -f 2 -d \' )
- if [ "$used" -ge "$limit" ]; then
- echo "Error: Limit reached / Upgrade package"
+ if [ "$limit" != 'unlimited' ] && [ "$used" -ge "$limit" ]; then
+ echo "Error: Limit is reached, please upgrade hosting package"
log_event "$E_LIMIT" "$EVENT"
exit $E_LIMIT
fi
@@ -273,6 +288,15 @@ is_object_value_exist() {
fi
}
+# Check if password is transmitted via file
+is_password_valid() {
+ if [[ "$password" =~ ^/tmp/ ]]; then
+ if [ -f "$password" ]; then
+ password=$(head -n1 $password)
+ fi
+ fi
+}
+
# Get object value
get_object_value() {
object=$(grep "$2='$3'" $USER_DATA/$1.conf)
@@ -282,7 +306,7 @@ get_object_value() {
# Update object value
update_object_value() {
- row=$(grep -n "$2='$3'" $USER_DATA/$1.conf)
+ row=$(grep -nF "$2='$3'" $USER_DATA/$1.conf)
lnr=$(echo $row | cut -f 1 -d ':')
object=$(echo $row | sed "s/^$lnr://")
eval "$object"
@@ -457,7 +481,7 @@ recalc_user_disk_usage() {
sed -i "s/U_DISK_DB='$d'/U_DISK_DB='$usage'/g" $USER_DATA/user.conf
u_usage=$((u_usage + usage))
fi
- usage=$(grep 'U_DIR_DISK=' $USER_DATA/user.conf | cut -f 2 -d "'")
+ usage=$(grep 'U_DISK_DIRS=' $USER_DATA/user.conf | cut -f 2 -d "'")
u_usage=$((u_usage + usage))
old=$(grep "U_DISK='" $USER_DATA/user.conf | cut -f 2 -d \')
sed -i "s/U_DISK='$old'/U_DISK='$u_usage'/g" $USER_DATA/user.conf
@@ -603,14 +627,7 @@ validate_format_ip_status() {
# Email address
validate_format_email() {
- local_part=$(echo $1 | cut -s -f1 -d\@)
- remote_host=$(echo $1 | cut -s -f2 -d\@)
- mx_failed=1
- if [ ! -z "$remote_host" ] && [ ! -z "$local_part" ]; then
- /usr/bin/host -t mx "$remote_host" &> /dev/null
- mx_failed="$?"
- fi
- if [ "$mx_failed" -eq 1 ]; then
+ if [[ ! "$1" =~ "@" ]] ; then
echo "Error: email $1 is not valid"
log_event "$E_INVALID" "$EVENT"
exit $E_INVALID
@@ -667,7 +684,7 @@ validate_format_domain() {
validate_format_domain_alias() {
exclude="[!|@|#|$|^|&|(|)|+|=|{|}|:|,|<|>|?|_|/|\|\"|'|;|%|\`| ]"
if [[ "$1" =~ $exclude ]] || [[ "$1" =~ "^[0-9]+$" ]]; then
- echo "Error: domain alias $1 is not valid"
+ echo "Error: $2 $1 is not valid"
log_event "$E_INVALID" "$EVENT"
exit $E_INVALID
fi
@@ -773,11 +790,6 @@ validate_format_common() {
exit $E_INVALID
fi
if [[ $1 =~ \* ]]; then
- if [[ ! $1 =~ \*$ ]]; then
- echo "Error: * can be used only at the end"
- log_event "$E_INVALID" "$EVENT"
- exit $E_INVALID
- fi
if [ "$(echo $1 | grep -o '*'|wc -l)" -gt 1 ]; then
log_event "$E_INVALID" "$EVENT"
echo "Error: * can be used only once"
@@ -918,6 +930,7 @@ validate_format(){
ns2) validate_format_domain "$arg" 'name_server';;
ns3) validate_format_domain "$arg" 'name_server';;
ns4) validate_format_domain "$arg" 'name_server';;
+ object) validate_format_name_s "$arg" 'object';;
package) validate_format_name "$arg" "$arg_name" ;;
password) validate_format_password "$arg" ;;
port) validate_format_int "$arg" 'port' ;;
diff --git a/func/rebuild.sh b/func/rebuild.sh
index cc13523d..86641a74 100644
--- a/func/rebuild.sh
+++ b/func/rebuild.sh
@@ -176,35 +176,36 @@ rebuild_web_domain_conf() {
fi
# Set folder permissions
- chmod 551 $HOMEDIR/$user/web/$domain
- chmod 751 $HOMEDIR/$user/web/$domain/private
- chmod 751 $HOMEDIR/$user/web/$domain/cgi-bin
- chmod 751 $HOMEDIR/$user/web/$domain/public_html
- chmod 751 $HOMEDIR/$user/web/$domain/public_shtml
- chmod 751 $HOMEDIR/$user/web/$domain/document_errors
- chmod 551 $HOMEDIR/$user/web/$domain/stats
- chmod 551 $HOMEDIR/$user/web/$domain/logs
+ chmod 551 $HOMEDIR/$user/web/$domain \
+ $HOMEDIR/$user/web/$domain/stats \
+ $HOMEDIR/$user/web/$domain/logs
+ chmod 751 $HOMEDIR/$user/web/$domain/private \
+ $HOMEDIR/$user/web/$domain/cgi-bin \
+ $HOMEDIR/$user/web/$domain/public_html \
+ $HOMEDIR/$user/web/$domain/public_shtml \
+ $HOMEDIR/$user/web/$domain/document_errors
chmod 640 /var/log/$WEB_SYSTEM/domains/$domain.*
# Set ownership
- chown $user:$user $HOMEDIR/$user/web/$domain
- chown $user:$user $HOMEDIR/$user/web/$domain/private
- chown $user:$user $HOMEDIR/$user/web/$domain/cgi-bin
- chown $user:$user $HOMEDIR/$user/web/$domain/public_html
- chown $user:$user $HOMEDIR/$user/web/$domain/public_shtml
+ chown $user:$user $HOMEDIR/$user/web/$domain \
+ $HOMEDIR/$user/web/$domain/private \
+ $HOMEDIR/$user/web/$domain/cgi-bin \
+ $HOMEDIR/$user/web/$domain/public_html \
+ $HOMEDIR/$user/web/$domain/public_shtml
chown -R $user:$user $HOMEDIR/$user/web/$domain/document_errors
chown root:$user /var/log/$WEB_SYSTEM/domains/$domain.*
# Adding tmp conf
- tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.tpl"
+ tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.tpl"
conf="$HOMEDIR/$user/conf/web/tmp_$WEB_SYSTEM.conf"
add_web_config
chown root:$user $conf
chmod 640 $conf
# Running template trigger
- if [ -x $WEBTPL/$WEB_SYSTEM/$TPL.sh ]; then
- $WEBTPL/$WEB_SYSTEM/$TPL.sh $user $domain $ip $HOMEDIR $docroot
+ if [ -x $WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.sh ]; then
+ $WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.sh \
+ $user $domain $ip $HOMEDIR $docroot
fi
# Checking aliases
@@ -220,6 +221,7 @@ rebuild_web_domain_conf() {
-e "s|%web_system%|$WEB_SYSTEM|g" \
-e "s|%web_port%|$WEB_PORT|g" \
-e "s|%web_ssl_port%|$WEB_SSL_PORT|g" \
+ -e "s|%backend_lsnr%|$backend_lsnr|g" \
-e "s|%proxy_port%|$PROXY_PORT|g" \
-e "s|%proxy_ssl_port%|$PROXY_SSL_PORT|g" \
-e "s|%domain_idn%|$domain_idn|g" \
@@ -262,7 +264,7 @@ rebuild_web_domain_conf() {
# Adding domain to the web conf
conf="$HOMEDIR/$user/conf/web/tmp_s$WEB_SYSTEM.conf"
- tpl_file="$WEBTPL/$WEB_SYSTEM/$TPL.stpl"
+ tpl_file="$WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.stpl"
add_web_config
chown root:$user $conf
chmod 640 $conf
@@ -279,8 +281,9 @@ rebuild_web_domain_conf() {
fi
# Running template trigger
- if [ -x $WEBTPL/$WEB_SYSTEM/$TPL.sh ]; then
- $WEBTPL/$WEB_SYSTEM/$TPL.sh $user $domain $ip $HOMEDIR $sdocroot
+ if [ -x $WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.sh ]; then
+ $WEBTPL/$WEB_SYSTEM/$WEB_BACKEND/$TPL.sh \
+ $user $domain $ip $HOMEDIR $sdocroot
fi
user_ssl=$((user_ssl + 1))
@@ -364,6 +367,39 @@ rebuild_web_domain_conf() {
chmod u-w /etc/shadow
fi
done
+
+ # Adding http auth protection
+ htaccess="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.conf_htaccess"
+ htpasswd="$HOMEDIR/$user/conf/web/$WEB_SYSTEM.$domain.htpasswd"
+ docroot="$HOMEDIR/$user/web/$domain/public_html"
+ for auth_user in ${AUTH_USER//:/ }; do
+ # Parsing auth user variables
+ position=$(echo $AUTH_USER | tr ':' '\n' | grep -n '' |\
+ grep ":$auth_user$" | cut -f 1 -d:)
+ auth_hash=$(echo $AUTH_HASH | tr ':' '\n' | grep -n '' |\
+ grep "^$position:" | cut -f 2 -d :)
+
+ # Adding http auth user
+ touch $htpasswd
+ sed -i "/^$auth_user:/d" $htpasswd
+ echo "$auth_user:$auth_hash" >> $htpasswd
+
+ # Checking web server include
+ if [ ! -e "$htaccess" ]; then
+ if [ "$WEB_SYSTEM" != 'nginx' ]; then
+ echo "403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ SUSPEND
+ This site has been suspended
+ 403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ SUSPEND
+ This site has been suspended
+
+
+
+
diff --git a/install/debian/templates/web/apache2/basedir.stpl b/install/rhel/6/templates/web/httpd/basedir.stpl
similarity index 85%
rename from install/debian/templates/web/apache2/basedir.stpl
rename to install/rhel/6/templates/web/httpd/basedir.stpl
index 269c0971..d568276d 100755
--- a/install/debian/templates/web/apache2/basedir.stpl
+++ b/install/rhel/6/templates/web/httpd/basedir.stpl
@@ -15,9 +15,7 @@
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes +ExecCGI
- php_admin_value open_basedir %docroot%:%home%/%user%/tmp
- php_admin_value upload_tmp_dir %home%/%user%/tmp
- php_admin_value session.save_path %home%/%user%/tmp
+ php_admin_value open_basedir %docroot%
+
+
+
+
+%domain%
+ %domain%
+
+
+
+
diff --git a/install/rhel/7/templates/web/httpd/basedir.stpl b/install/rhel/7/templates/web/httpd/basedir.stpl
new file mode 100755
index 00000000..b90818f1
--- /dev/null
+++ b/install/rhel/7/templates/web/httpd/basedir.stpl
@@ -0,0 +1,41 @@
+
+
+
+
+
+%domain%
+ %domain%
+
+
+
+
diff --git a/install/ubuntu/12.04/templates/web/nginx/caching.sh b/install/ubuntu/12.04/templates/web/nginx/caching.sh
new file mode 100755
index 00000000..6eb9126d
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/caching.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+user=$1
+domain=$2
+ip=$3
+home=$4
+docroot=$5
+
+str="proxy_cache_path /var/cache/nginx/$domain levels=2"
+str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
+echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf
+
diff --git a/install/ubuntu/templates/web/nginx/caching.stpl b/install/ubuntu/12.04/templates/web/nginx/caching.stpl
similarity index 100%
rename from install/ubuntu/templates/web/nginx/caching.stpl
rename to install/ubuntu/12.04/templates/web/nginx/caching.stpl
diff --git a/install/ubuntu/templates/web/nginx/caching.tpl b/install/ubuntu/12.04/templates/web/nginx/caching.tpl
similarity index 95%
rename from install/ubuntu/templates/web/nginx/caching.tpl
rename to install/ubuntu/12.04/templates/web/nginx/caching.tpl
index 1462f9e1..36761b65 100755
--- a/install/ubuntu/templates/web/nginx/caching.tpl
+++ b/install/ubuntu/12.04/templates/web/nginx/caching.tpl
@@ -37,5 +37,5 @@ server {
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
- include %home%/%user%/web/conf/nginx.%domain%.conf*;
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
}
diff --git a/install/ubuntu/12.04/templates/web/nginx/default.stpl b/install/ubuntu/12.04/templates/web/nginx/default.stpl
new file mode 100755
index 00000000..fa538060
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/default.stpl
@@ -0,0 +1,36 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/12.04/templates/web/nginx/default.tpl b/install/ubuntu/12.04/templates/web/nginx/default.tpl
new file mode 100755
index 00000000..4d5c774b
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/default.tpl
@@ -0,0 +1,33 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/12.04/templates/web/nginx/hosting.sh b/install/ubuntu/12.04/templates/web/nginx/hosting.sh
new file mode 100755
index 00000000..eeed37ef
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/hosting.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Changing public_html permission
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+chmod 755 $docroot
+
+exit 0
diff --git a/install/ubuntu/12.04/templates/web/nginx/hosting.stpl b/install/ubuntu/12.04/templates/web/nginx/hosting.stpl
new file mode 100755
index 00000000..d778d633
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/hosting.stpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/12.04/templates/web/nginx/hosting.tpl b/install/ubuntu/12.04/templates/web/nginx/hosting.tpl
new file mode 100755
index 00000000..15961c95
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/hosting.tpl
@@ -0,0 +1,35 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl
new file mode 100644
index 00000000..01d82b60
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl
new file mode 100644
index 00000000..af452d19
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter2.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter2.stpl
new file mode 100644
index 00000000..a592a652
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter2.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter2.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter2.tpl
new file mode 100644
index 00000000..9b955aa6
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter2.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter3.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter3.stpl
new file mode 100644
index 00000000..4d330d34
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter3.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter3.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter3.tpl
new file mode 100644
index 00000000..1f446e5d
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/codeigniter3.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/datalife_engine.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/datalife_engine.stpl
new file mode 100644
index 00000000..d1b5bcd2
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/datalife_engine.stpl
@@ -0,0 +1,122 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/datalife_engine.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/datalife_engine.tpl
new file mode 100644
index 00000000..ff33c232
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/datalife_engine.tpl
@@ -0,0 +1,118 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/default.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/default.stpl
new file mode 100644
index 00000000..a68c9986
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/default.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/default.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/default.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/default.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.stpl
new file mode 100644
index 00000000..27483cd8
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.stpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.tpl
new file mode 100644
index 00000000..31647c9f
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/dokuwiki.tpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/drupal.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/drupal.stpl
new file mode 100644
index 00000000..9a548439
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/drupal.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/drupal.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/drupal.tpl
new file mode 100644
index 00000000..417762c1
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/drupal.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/joomla.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/joomla.stpl
new file mode 100644
index 00000000..235a0121
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/joomla.stpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/joomla.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/joomla.tpl
new file mode 100644
index 00000000..997c268d
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/joomla.tpl
@@ -0,0 +1,54 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/no-php.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/no-php.stpl
new file mode 100644
index 00000000..a0234ae3
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/no-php.stpl
@@ -0,0 +1,42 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/no-php.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..97d04599
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/no-php.tpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/owncloud.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/owncloud.stpl
new file mode 100644
index 00000000..8311ca43
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/owncloud.stpl
@@ -0,0 +1,80 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/owncloud.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/owncloud.tpl
new file mode 100644
index 00000000..57cac2f8
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/owncloud.tpl
@@ -0,0 +1,76 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/piwik.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/piwik.stpl
new file mode 100644
index 00000000..c53af401
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/piwik.stpl
@@ -0,0 +1,68 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/piwik.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/piwik.tpl
new file mode 100644
index 00000000..6b4a94a6
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/piwik.tpl
@@ -0,0 +1,64 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/pyrocms.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/pyrocms.stpl
new file mode 100644
index 00000000..a6fc6755
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/pyrocms.stpl
@@ -0,0 +1,61 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/pyrocms.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/pyrocms.tpl
new file mode 100644
index 00000000..68b378ef
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/pyrocms.tpl
@@ -0,0 +1,57 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress.stpl
new file mode 100644
index 00000000..910c28b6
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress2.stpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress2.stpl
new file mode 100644
index 00000000..2822f875
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress2.stpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress2.tpl b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress2.tpl
new file mode 100644
index 00000000..37b8be30
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/php5-fpm/wordpress2.tpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.04/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/12.04/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 00000000..ae195617
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/nginx/proxy_ip.tpl
@@ -0,0 +1,9 @@
+server {
+ listen %ip%:%proxy_port% default;
+ server_name _;
+ #access_log /var/log/nginx/%ip%.log main;
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ }
+}
+
diff --git a/install/ubuntu/12.04/templates/web/php5-fpm/default.tpl b/install/ubuntu/12.04/templates/web/php5-fpm/default.tpl
new file mode 100644
index 00000000..44ccf7a4
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/php5-fpm/default.tpl
@@ -0,0 +1,18 @@
+[%backend%]
+listen = 127.0.0.1:%backend_port%
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/12.04/templates/web/php5-fpm/no-php.tpl b/install/ubuntu/12.04/templates/web/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..89487d5f
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/php5-fpm/no-php.tpl
@@ -0,0 +1,13 @@
+#[%backend%]
+#user = %user%
+#group = %user%
+#listen = /dev/null
+
+#listen.owner = %user%
+#listen.group = nginx
+
+#pm = dynamic
+#pm.max_children = 50
+#pm.start_servers = 3
+#pm.min_spare_servers = 2
+#pm.max_spare_servers = 10
diff --git a/install/ubuntu/12.04/templates/web/php5-fpm/socket.tpl b/install/ubuntu/12.04/templates/web/php5-fpm/socket.tpl
new file mode 100644
index 00000000..f0513da3
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/php5-fpm/socket.tpl
@@ -0,0 +1,21 @@
+[%backend%]
+listen = /var/run/php5-%backend%.sock
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+listen.owner = %user%
+listen.group = nginx
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/12.04/templates/web/skel/document_errors/403.html b/install/ubuntu/12.04/templates/web/skel/document_errors/403.html
new file mode 100755
index 00000000..9c3f6baa
--- /dev/null
+++ b/install/ubuntu/12.04/templates/web/skel/document_errors/403.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ %domain%
+ %domain%
+ SUSPEND
+ This site has been suspended
+
{locality} {zipcode}
{country} {region}';
+
+// Matching mode for addressbook search (including autocompletion)
+// 0 - partial (*abc*), default
+// 1 - strict (abc)
+// 2 - prefix (abc*)
+// Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode
+$rcmail_config['addressbook_search_mode'] = 0;
+
+// ----------------------------------
+// USER PREFERENCES
+// ----------------------------------
+
+// Use this charset as fallback for message decoding
+//$rcmail_config['default_charset'] = 'ISO-8859-1';
+$rcmail_config['default_charset'] = 'UTF-8';
+
+// skin name: folder from skins/
+$rcmail_config['skin'] = 'larry';
+
+// show up to X items in messages list view
+$rcmail_config['mail_pagesize'] = 50;
+
+// show up to X items in contacts list view
+$rcmail_config['addressbook_pagesize'] = 50;
+
+// sort contacts by this col (preferably either one of name, firstname, surname)
+$rcmail_config['addressbook_sort_col'] = 'surname';
+
+// the way how contact names are displayed in the list
+// 0: display name
+// 1: (prefix) firstname middlename surname (suffix)
+// 2: (prefix) surname firstname middlename (suffix)
+// 3: (prefix) surname, firstname middlename (suffix)
+$rcmail_config['addressbook_name_listing'] = 0;
+
+// use this timezone to display date/time
+// valid timezone identifers are listed here: php.net/manual/en/timezones.php
+// 'auto' will use the browser's timezone settings
+$rcmail_config['timezone'] = 'auto';
+
+// prefer displaying HTML messages
+$rcmail_config['prefer_html'] = true;
+
+// display remote inline images
+// 0 - Never, always ask
+// 1 - Ask if sender is not in address book
+// 2 - Always show inline images
+$rcmail_config['show_images'] = 0;
+
+// compose html formatted messages by default
+// 0 - never, 1 - always, 2 - on reply to HTML message only
+$rcmail_config['htmleditor'] = 0;
+
+// show pretty dates as standard
+$rcmail_config['prettydate'] = true;
+
+// save compose message every 300 seconds (5min)
+$rcmail_config['draft_autosave'] = 300;
+
+// default setting if preview pane is enabled
+$rcmail_config['preview_pane'] = false;
+
+// Mark as read when viewed in preview pane (delay in seconds)
+// Set to -1 if messages in preview pane should not be marked as read
+$rcmail_config['preview_pane_mark_read'] = 0;
+
+// Clear Trash on logout
+$rcmail_config['logout_purge'] = false;
+
+// Compact INBOX on logout
+$rcmail_config['logout_expunge'] = false;
+
+// Display attached images below the message body
+$rcmail_config['inline_images'] = true;
+
+// Encoding of long/non-ascii attachment names:
+// 0 - Full RFC 2231 compatible
+// 1 - RFC 2047 for 'name' and RFC 2231 for 'filename' parameter (Thunderbird's default)
+// 2 - Full 2047 compatible
+$rcmail_config['mime_param_folding'] = 1;
+
+// Set true if deleted messages should not be displayed
+// This will make the application run slower
+$rcmail_config['skip_deleted'] = false;
+
+// Set true to Mark deleted messages as read as well as deleted
+// False means that a message's read status is not affected by marking it as deleted
+$rcmail_config['read_when_deleted'] = true;
+
+// Set to true to never delete messages immediately
+// Use 'Purge' to remove messages marked as deleted
+$rcmail_config['flag_for_deletion'] = false;
+
+// Default interval for keep-alive/check-recent requests (in seconds)
+// Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime'
+$rcmail_config['keep_alive'] = 60;
+
+// If true all folders will be checked for recent messages
+$rcmail_config['check_all_folders'] = false;
+
+// If true, after message delete/move, the next message will be displayed
+$rcmail_config['display_next'] = false;
+
+// 0 - Do not expand threads
+// 1 - Expand all threads automatically
+// 2 - Expand only threads with unread messages
+$rcmail_config['autoexpand_threads'] = 0;
+
+// When replying place cursor above original message (top posting)
+$rcmail_config['top_posting'] = false;
+
+// When replying strip original signature from message
+$rcmail_config['strip_existing_sig'] = true;
+
+// Show signature:
+// 0 - Never
+// 1 - Always
+// 2 - New messages only
+// 3 - Forwards and Replies only
+$rcmail_config['show_sig'] = 1;
+
+// When replying or forwarding place sender's signature above existing message
+$rcmail_config['sig_above'] = false;
+
+// Use MIME encoding (quoted-printable) for 8bit characters in message body
+$rcmail_config['force_7bit'] = false;
+
+// Defaults of the search field configuration.
+// The array can contain a per-folder list of header fields which should be considered when searching
+// The entry with key '*' stands for all folders which do not have a specific list set.
+// Please note that folder names should to be in sync with $rcmail_config['default_folders']
+$rcmail_config['search_mods'] = null; // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1));
+
+// Defaults of the addressbook search field configuration.
+$rcmail_config['addressbook_search_mods'] = null; // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1);
+
+// 'Delete always'
+// This setting reflects if mail should be always deleted
+// when moving to Trash fails. This is necessary in some setups
+// when user is over quota and Trash is included in the quota.
+$rcmail_config['delete_always'] = false;
+
+// Directly delete messages in Junk instead of moving to Trash
+$rcmail_config['delete_junk'] = true;
+
+// Behavior if a received message requests a message delivery notification (read receipt)
+// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
+// 3 = send automatically if sender is in addressbook, otherwise ask the user
+// 4 = send automatically if sender is in addressbook, otherwise ignore
+$rcmail_config['mdn_requests'] = 0;
+
+// Return receipt checkbox default state
+$rcmail_config['mdn_default'] = 0;
+
+// Delivery Status Notification checkbox default state
+$rcmail_config['dsn_default'] = 0;
+
+// Place replies in the folder of the message being replied to
+$rcmail_config['reply_same_folder'] = false;
+
+// Sets default mode of Forward feature to "forward as attachment"
+$rcmail_config['forward_attachment'] = false;
+
+// Defines address book (internal index) to which new contacts will be added
+// By default it is the first writeable addressbook.
+// Note: Use '0' for built-in address book.
+$rcmail_config['default_addressbook'] = null;
+
+// Enables spell checking before sending a message.
+$rcmail_config['spellcheck_before_send'] = false;
+
+// Skip alternative email addresses in autocompletion (show one address per contact)
+$rcmail_config['autocomplete_single'] = false;
+
+// Default font for composed HTML message.
+// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
+// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
+$rcmail_config['default_font'] = '';
+
+// end of config file
diff --git a/install/ubuntu/12.10/roundcube/vesta.php b/install/ubuntu/12.10/roundcube/vesta.php
new file mode 100644
index 00000000..8fb202a4
--- /dev/null
+++ b/install/ubuntu/12.10/roundcube/vesta.php
@@ -0,0 +1,62 @@
+
+ */
+
+ function password_save($curpass, $passwd)
+ {
+ $rcmail = rcmail::get_instance();
+ $vesta_host = $rcmail->config->get('password_vesta_host');
+
+ if (empty($vesta_host))
+ {
+ $vesta_host = 'localhost';
+ }
+
+ $vesta_port = $rcmail->config->get('password_vesta_port');
+ if (empty($vesta_port))
+ {
+ $vesta_port = '8083';
+ }
+
+ $postvars = array(
+ 'email' => $_SESSION['username'],
+ 'password' => $curpass,
+ 'new' => $passwd
+ );
+
+ $postdata = http_build_query($postvars);
+
+ $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
+ $send .= 'Host: ' . $vesta_host . PHP_EOL;
+ $send .= 'User-Agent: PHP Script' . PHP_EOL;
+ $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
+ $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
+ $send .= 'Connection: close' . PHP_EOL;
+ $send .= PHP_EOL;
+ $send .= $postdata . PHP_EOL . PHP_EOL;
+
+ $fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
+ fputs($fp, $send);
+ $result = fread($fp, 2048);
+ fclose($fp);
+
+ $fp = fopen("/tmp/roundcube.log", 'w');
+ fwrite($fp, "test ok");
+ fwrite($fp, "\n");
+ fclose($fp);
+
+
+ if(strpos($result, 'ok') && !strpos($result, 'error'))
+ {
+ return PASSWORD_SUCCESS;
+ }
+ else {
+ return PASSWORD_ERROR;
+ }
+
+ }
diff --git a/install/ubuntu/12.10/sudo/admin b/install/ubuntu/12.10/sudo/admin
new file mode 100644
index 00000000..47e16098
--- /dev/null
+++ b/install/ubuntu/12.10/sudo/admin
@@ -0,0 +1,7 @@
+# Created by vesta installer
+Defaults env_keep="VESTA"
+Defaults:admin !syslog
+Defaults:admin !requiretty
+
+admin ALL=(ALL) ALL
+admin ALL=NOPASSWD:/usr/local/vesta/bin/*
diff --git a/install/ubuntu/12.10/templates.tar.gz b/install/ubuntu/12.10/templates.tar.gz
new file mode 100644
index 00000000..ce385d26
Binary files /dev/null and b/install/ubuntu/12.10/templates.tar.gz differ
diff --git a/install/ubuntu/12.10/templates/dns/child-ns.tpl b/install/ubuntu/12.10/templates/dns/child-ns.tpl
new file mode 100755
index 00000000..27f9b825
--- /dev/null
+++ b/install/ubuntu/12.10/templates/dns/child-ns.tpl
@@ -0,0 +1,11 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns1.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns2.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ns1' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='ns2' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/12.10/templates/dns/default.tpl b/install/ubuntu/12.10/templates/dns/default.tpl
new file mode 100755
index 00000000..38f96300
--- /dev/null
+++ b/install/ubuntu/12.10/templates/dns/default.tpl
@@ -0,0 +1,9 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/12.10/templates/dns/gmail.tpl b/install/ubuntu/12.10/templates/dns/gmail.tpl
new file mode 100755
index 00000000..950cfa45
--- /dev/null
+++ b/install/ubuntu/12.10/templates/dns/gmail.tpl
@@ -0,0 +1,14 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='ghs.google.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX2.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX3.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/12.10/templates/web/apache2/basedir.stpl b/install/ubuntu/12.10/templates/web/apache2/basedir.stpl
new file mode 100755
index 00000000..3f71e699
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/apache2/basedir.stpl
@@ -0,0 +1,41 @@
+
+
+
+
diff --git a/install/ubuntu/12.10/templates/web/nginx/caching.sh b/install/ubuntu/12.10/templates/web/nginx/caching.sh
new file mode 100755
index 00000000..6eb9126d
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/caching.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+user=$1
+domain=$2
+ip=$3
+home=$4
+docroot=$5
+
+str="proxy_cache_path /var/cache/nginx/$domain levels=2"
+str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
+echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf
+
diff --git a/install/ubuntu/12.10/templates/web/nginx/caching.stpl b/install/ubuntu/12.10/templates/web/nginx/caching.stpl
new file mode 100755
index 00000000..ca6cffe3
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/caching.stpl
@@ -0,0 +1,44 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/caching.tpl b/install/ubuntu/12.10/templates/web/nginx/caching.tpl
new file mode 100755
index 00000000..36761b65
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/caching.tpl
@@ -0,0 +1,41 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/default.stpl b/install/ubuntu/12.10/templates/web/nginx/default.stpl
new file mode 100755
index 00000000..fa538060
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/default.stpl
@@ -0,0 +1,36 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/12.10/templates/web/nginx/default.tpl b/install/ubuntu/12.10/templates/web/nginx/default.tpl
new file mode 100755
index 00000000..4d5c774b
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/default.tpl
@@ -0,0 +1,33 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/12.10/templates/web/nginx/hosting.sh b/install/ubuntu/12.10/templates/web/nginx/hosting.sh
new file mode 100755
index 00000000..eeed37ef
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/hosting.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Changing public_html permission
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+chmod 755 $docroot
+
+exit 0
diff --git a/install/ubuntu/12.10/templates/web/nginx/hosting.stpl b/install/ubuntu/12.10/templates/web/nginx/hosting.stpl
new file mode 100755
index 00000000..d778d633
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/hosting.stpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/12.10/templates/web/nginx/hosting.tpl b/install/ubuntu/12.10/templates/web/nginx/hosting.tpl
new file mode 100755
index 00000000..15961c95
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/hosting.tpl
@@ -0,0 +1,35 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl
new file mode 100644
index 00000000..01d82b60
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl
new file mode 100644
index 00000000..af452d19
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter2.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter2.stpl
new file mode 100644
index 00000000..a592a652
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter2.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter2.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter2.tpl
new file mode 100644
index 00000000..9b955aa6
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter2.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter3.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter3.stpl
new file mode 100644
index 00000000..4d330d34
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter3.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter3.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter3.tpl
new file mode 100644
index 00000000..1f446e5d
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/codeigniter3.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/datalife_engine.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/datalife_engine.stpl
new file mode 100644
index 00000000..d1b5bcd2
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/datalife_engine.stpl
@@ -0,0 +1,122 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/datalife_engine.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/datalife_engine.tpl
new file mode 100644
index 00000000..ff33c232
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/datalife_engine.tpl
@@ -0,0 +1,118 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/default.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/default.stpl
new file mode 100644
index 00000000..a68c9986
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/default.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/default.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/default.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/default.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.stpl
new file mode 100644
index 00000000..27483cd8
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.stpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.tpl
new file mode 100644
index 00000000..31647c9f
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/dokuwiki.tpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/drupal.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/drupal.stpl
new file mode 100644
index 00000000..9a548439
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/drupal.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/drupal.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/drupal.tpl
new file mode 100644
index 00000000..417762c1
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/drupal.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/joomla.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/joomla.stpl
new file mode 100644
index 00000000..235a0121
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/joomla.stpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/joomla.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/joomla.tpl
new file mode 100644
index 00000000..997c268d
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/joomla.tpl
@@ -0,0 +1,54 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/no-php.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/no-php.stpl
new file mode 100644
index 00000000..a0234ae3
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/no-php.stpl
@@ -0,0 +1,42 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/no-php.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..97d04599
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/no-php.tpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/owncloud.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/owncloud.stpl
new file mode 100644
index 00000000..8311ca43
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/owncloud.stpl
@@ -0,0 +1,80 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/owncloud.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/owncloud.tpl
new file mode 100644
index 00000000..57cac2f8
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/owncloud.tpl
@@ -0,0 +1,76 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/piwik.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/piwik.stpl
new file mode 100644
index 00000000..c53af401
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/piwik.stpl
@@ -0,0 +1,68 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/piwik.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/piwik.tpl
new file mode 100644
index 00000000..6b4a94a6
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/piwik.tpl
@@ -0,0 +1,64 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/pyrocms.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/pyrocms.stpl
new file mode 100644
index 00000000..a6fc6755
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/pyrocms.stpl
@@ -0,0 +1,61 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/pyrocms.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/pyrocms.tpl
new file mode 100644
index 00000000..68b378ef
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/pyrocms.tpl
@@ -0,0 +1,57 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress.stpl
new file mode 100644
index 00000000..910c28b6
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress2.stpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress2.stpl
new file mode 100644
index 00000000..2822f875
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress2.stpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress2.tpl b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress2.tpl
new file mode 100644
index 00000000..37b8be30
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/php5-fpm/wordpress2.tpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/12.10/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/12.10/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 00000000..ae195617
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/nginx/proxy_ip.tpl
@@ -0,0 +1,9 @@
+server {
+ listen %ip%:%proxy_port% default;
+ server_name _;
+ #access_log /var/log/nginx/%ip%.log main;
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ }
+}
+
diff --git a/install/ubuntu/12.10/templates/web/php5-fpm/default.tpl b/install/ubuntu/12.10/templates/web/php5-fpm/default.tpl
new file mode 100644
index 00000000..44ccf7a4
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/php5-fpm/default.tpl
@@ -0,0 +1,18 @@
+[%backend%]
+listen = 127.0.0.1:%backend_port%
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/12.10/templates/web/php5-fpm/no-php.tpl b/install/ubuntu/12.10/templates/web/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..89487d5f
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/php5-fpm/no-php.tpl
@@ -0,0 +1,13 @@
+#[%backend%]
+#user = %user%
+#group = %user%
+#listen = /dev/null
+
+#listen.owner = %user%
+#listen.group = nginx
+
+#pm = dynamic
+#pm.max_children = 50
+#pm.start_servers = 3
+#pm.min_spare_servers = 2
+#pm.max_spare_servers = 10
diff --git a/install/ubuntu/12.10/templates/web/php5-fpm/socket.tpl b/install/ubuntu/12.10/templates/web/php5-fpm/socket.tpl
new file mode 100644
index 00000000..f0513da3
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/php5-fpm/socket.tpl
@@ -0,0 +1,21 @@
+[%backend%]
+listen = /var/run/php5-%backend%.sock
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+listen.owner = %user%
+listen.group = nginx
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/12.10/templates/web/skel/document_errors/403.html b/install/ubuntu/12.10/templates/web/skel/document_errors/403.html
new file mode 100755
index 00000000..9c3f6baa
--- /dev/null
+++ b/install/ubuntu/12.10/templates/web/skel/document_errors/403.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ %domain%
+ %domain%
+ SUSPEND
+ This site has been suspended
+
{locality} {zipcode}
{country} {region}';
+
+// Matching mode for addressbook search (including autocompletion)
+// 0 - partial (*abc*), default
+// 1 - strict (abc)
+// 2 - prefix (abc*)
+// Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode
+$rcmail_config['addressbook_search_mode'] = 0;
+
+// ----------------------------------
+// USER PREFERENCES
+// ----------------------------------
+
+// Use this charset as fallback for message decoding
+//$rcmail_config['default_charset'] = 'ISO-8859-1';
+$rcmail_config['default_charset'] = 'UTF-8';
+
+// skin name: folder from skins/
+$rcmail_config['skin'] = 'larry';
+
+// show up to X items in messages list view
+$rcmail_config['mail_pagesize'] = 50;
+
+// show up to X items in contacts list view
+$rcmail_config['addressbook_pagesize'] = 50;
+
+// sort contacts by this col (preferably either one of name, firstname, surname)
+$rcmail_config['addressbook_sort_col'] = 'surname';
+
+// the way how contact names are displayed in the list
+// 0: display name
+// 1: (prefix) firstname middlename surname (suffix)
+// 2: (prefix) surname firstname middlename (suffix)
+// 3: (prefix) surname, firstname middlename (suffix)
+$rcmail_config['addressbook_name_listing'] = 0;
+
+// use this timezone to display date/time
+// valid timezone identifers are listed here: php.net/manual/en/timezones.php
+// 'auto' will use the browser's timezone settings
+$rcmail_config['timezone'] = 'auto';
+
+// prefer displaying HTML messages
+$rcmail_config['prefer_html'] = true;
+
+// display remote inline images
+// 0 - Never, always ask
+// 1 - Ask if sender is not in address book
+// 2 - Always show inline images
+$rcmail_config['show_images'] = 0;
+
+// compose html formatted messages by default
+// 0 - never, 1 - always, 2 - on reply to HTML message only
+$rcmail_config['htmleditor'] = 0;
+
+// show pretty dates as standard
+$rcmail_config['prettydate'] = true;
+
+// save compose message every 300 seconds (5min)
+$rcmail_config['draft_autosave'] = 300;
+
+// default setting if preview pane is enabled
+$rcmail_config['preview_pane'] = false;
+
+// Mark as read when viewed in preview pane (delay in seconds)
+// Set to -1 if messages in preview pane should not be marked as read
+$rcmail_config['preview_pane_mark_read'] = 0;
+
+// Clear Trash on logout
+$rcmail_config['logout_purge'] = false;
+
+// Compact INBOX on logout
+$rcmail_config['logout_expunge'] = false;
+
+// Display attached images below the message body
+$rcmail_config['inline_images'] = true;
+
+// Encoding of long/non-ascii attachment names:
+// 0 - Full RFC 2231 compatible
+// 1 - RFC 2047 for 'name' and RFC 2231 for 'filename' parameter (Thunderbird's default)
+// 2 - Full 2047 compatible
+$rcmail_config['mime_param_folding'] = 1;
+
+// Set true if deleted messages should not be displayed
+// This will make the application run slower
+$rcmail_config['skip_deleted'] = false;
+
+// Set true to Mark deleted messages as read as well as deleted
+// False means that a message's read status is not affected by marking it as deleted
+$rcmail_config['read_when_deleted'] = true;
+
+// Set to true to never delete messages immediately
+// Use 'Purge' to remove messages marked as deleted
+$rcmail_config['flag_for_deletion'] = false;
+
+// Default interval for keep-alive/check-recent requests (in seconds)
+// Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime'
+$rcmail_config['keep_alive'] = 60;
+
+// If true all folders will be checked for recent messages
+$rcmail_config['check_all_folders'] = false;
+
+// If true, after message delete/move, the next message will be displayed
+$rcmail_config['display_next'] = false;
+
+// 0 - Do not expand threads
+// 1 - Expand all threads automatically
+// 2 - Expand only threads with unread messages
+$rcmail_config['autoexpand_threads'] = 0;
+
+// When replying place cursor above original message (top posting)
+$rcmail_config['top_posting'] = false;
+
+// When replying strip original signature from message
+$rcmail_config['strip_existing_sig'] = true;
+
+// Show signature:
+// 0 - Never
+// 1 - Always
+// 2 - New messages only
+// 3 - Forwards and Replies only
+$rcmail_config['show_sig'] = 1;
+
+// When replying or forwarding place sender's signature above existing message
+$rcmail_config['sig_above'] = false;
+
+// Use MIME encoding (quoted-printable) for 8bit characters in message body
+$rcmail_config['force_7bit'] = false;
+
+// Defaults of the search field configuration.
+// The array can contain a per-folder list of header fields which should be considered when searching
+// The entry with key '*' stands for all folders which do not have a specific list set.
+// Please note that folder names should to be in sync with $rcmail_config['default_folders']
+$rcmail_config['search_mods'] = null; // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1));
+
+// Defaults of the addressbook search field configuration.
+$rcmail_config['addressbook_search_mods'] = null; // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1);
+
+// 'Delete always'
+// This setting reflects if mail should be always deleted
+// when moving to Trash fails. This is necessary in some setups
+// when user is over quota and Trash is included in the quota.
+$rcmail_config['delete_always'] = false;
+
+// Directly delete messages in Junk instead of moving to Trash
+$rcmail_config['delete_junk'] = true;
+
+// Behavior if a received message requests a message delivery notification (read receipt)
+// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
+// 3 = send automatically if sender is in addressbook, otherwise ask the user
+// 4 = send automatically if sender is in addressbook, otherwise ignore
+$rcmail_config['mdn_requests'] = 0;
+
+// Return receipt checkbox default state
+$rcmail_config['mdn_default'] = 0;
+
+// Delivery Status Notification checkbox default state
+$rcmail_config['dsn_default'] = 0;
+
+// Place replies in the folder of the message being replied to
+$rcmail_config['reply_same_folder'] = false;
+
+// Sets default mode of Forward feature to "forward as attachment"
+$rcmail_config['forward_attachment'] = false;
+
+// Defines address book (internal index) to which new contacts will be added
+// By default it is the first writeable addressbook.
+// Note: Use '0' for built-in address book.
+$rcmail_config['default_addressbook'] = null;
+
+// Enables spell checking before sending a message.
+$rcmail_config['spellcheck_before_send'] = false;
+
+// Skip alternative email addresses in autocompletion (show one address per contact)
+$rcmail_config['autocomplete_single'] = false;
+
+// Default font for composed HTML message.
+// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
+// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
+$rcmail_config['default_font'] = '';
+
+// end of config file
diff --git a/install/ubuntu/13.04/roundcube/vesta.php b/install/ubuntu/13.04/roundcube/vesta.php
new file mode 100644
index 00000000..8fb202a4
--- /dev/null
+++ b/install/ubuntu/13.04/roundcube/vesta.php
@@ -0,0 +1,62 @@
+
+ */
+
+ function password_save($curpass, $passwd)
+ {
+ $rcmail = rcmail::get_instance();
+ $vesta_host = $rcmail->config->get('password_vesta_host');
+
+ if (empty($vesta_host))
+ {
+ $vesta_host = 'localhost';
+ }
+
+ $vesta_port = $rcmail->config->get('password_vesta_port');
+ if (empty($vesta_port))
+ {
+ $vesta_port = '8083';
+ }
+
+ $postvars = array(
+ 'email' => $_SESSION['username'],
+ 'password' => $curpass,
+ 'new' => $passwd
+ );
+
+ $postdata = http_build_query($postvars);
+
+ $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
+ $send .= 'Host: ' . $vesta_host . PHP_EOL;
+ $send .= 'User-Agent: PHP Script' . PHP_EOL;
+ $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
+ $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
+ $send .= 'Connection: close' . PHP_EOL;
+ $send .= PHP_EOL;
+ $send .= $postdata . PHP_EOL . PHP_EOL;
+
+ $fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
+ fputs($fp, $send);
+ $result = fread($fp, 2048);
+ fclose($fp);
+
+ $fp = fopen("/tmp/roundcube.log", 'w');
+ fwrite($fp, "test ok");
+ fwrite($fp, "\n");
+ fclose($fp);
+
+
+ if(strpos($result, 'ok') && !strpos($result, 'error'))
+ {
+ return PASSWORD_SUCCESS;
+ }
+ else {
+ return PASSWORD_ERROR;
+ }
+
+ }
diff --git a/install/ubuntu/13.04/sudo/admin b/install/ubuntu/13.04/sudo/admin
new file mode 100644
index 00000000..47e16098
--- /dev/null
+++ b/install/ubuntu/13.04/sudo/admin
@@ -0,0 +1,7 @@
+# Created by vesta installer
+Defaults env_keep="VESTA"
+Defaults:admin !syslog
+Defaults:admin !requiretty
+
+admin ALL=(ALL) ALL
+admin ALL=NOPASSWD:/usr/local/vesta/bin/*
diff --git a/install/ubuntu/13.04/templates.tar.gz b/install/ubuntu/13.04/templates.tar.gz
new file mode 100644
index 00000000..ce385d26
Binary files /dev/null and b/install/ubuntu/13.04/templates.tar.gz differ
diff --git a/install/ubuntu/13.04/templates/dns/child-ns.tpl b/install/ubuntu/13.04/templates/dns/child-ns.tpl
new file mode 100755
index 00000000..27f9b825
--- /dev/null
+++ b/install/ubuntu/13.04/templates/dns/child-ns.tpl
@@ -0,0 +1,11 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns1.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns2.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ns1' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='ns2' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/13.04/templates/dns/default.tpl b/install/ubuntu/13.04/templates/dns/default.tpl
new file mode 100755
index 00000000..38f96300
--- /dev/null
+++ b/install/ubuntu/13.04/templates/dns/default.tpl
@@ -0,0 +1,9 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/13.04/templates/dns/gmail.tpl b/install/ubuntu/13.04/templates/dns/gmail.tpl
new file mode 100755
index 00000000..950cfa45
--- /dev/null
+++ b/install/ubuntu/13.04/templates/dns/gmail.tpl
@@ -0,0 +1,14 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='ghs.google.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX2.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX3.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/13.04/templates/web/apache2/basedir.stpl b/install/ubuntu/13.04/templates/web/apache2/basedir.stpl
new file mode 100755
index 00000000..3f71e699
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/apache2/basedir.stpl
@@ -0,0 +1,41 @@
+
+
+
+
diff --git a/install/ubuntu/13.04/templates/web/nginx/caching.sh b/install/ubuntu/13.04/templates/web/nginx/caching.sh
new file mode 100755
index 00000000..6eb9126d
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/caching.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+user=$1
+domain=$2
+ip=$3
+home=$4
+docroot=$5
+
+str="proxy_cache_path /var/cache/nginx/$domain levels=2"
+str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
+echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf
+
diff --git a/install/ubuntu/13.04/templates/web/nginx/caching.stpl b/install/ubuntu/13.04/templates/web/nginx/caching.stpl
new file mode 100755
index 00000000..ca6cffe3
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/caching.stpl
@@ -0,0 +1,44 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/caching.tpl b/install/ubuntu/13.04/templates/web/nginx/caching.tpl
new file mode 100755
index 00000000..36761b65
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/caching.tpl
@@ -0,0 +1,41 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/default.stpl b/install/ubuntu/13.04/templates/web/nginx/default.stpl
new file mode 100755
index 00000000..fa538060
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/default.stpl
@@ -0,0 +1,36 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/13.04/templates/web/nginx/default.tpl b/install/ubuntu/13.04/templates/web/nginx/default.tpl
new file mode 100755
index 00000000..4d5c774b
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/default.tpl
@@ -0,0 +1,33 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/13.04/templates/web/nginx/hosting.sh b/install/ubuntu/13.04/templates/web/nginx/hosting.sh
new file mode 100755
index 00000000..eeed37ef
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/hosting.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Changing public_html permission
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+chmod 755 $docroot
+
+exit 0
diff --git a/install/ubuntu/13.04/templates/web/nginx/hosting.stpl b/install/ubuntu/13.04/templates/web/nginx/hosting.stpl
new file mode 100755
index 00000000..d778d633
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/hosting.stpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/13.04/templates/web/nginx/hosting.tpl b/install/ubuntu/13.04/templates/web/nginx/hosting.tpl
new file mode 100755
index 00000000..15961c95
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/hosting.tpl
@@ -0,0 +1,35 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl
new file mode 100644
index 00000000..01d82b60
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl
new file mode 100644
index 00000000..af452d19
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter2.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter2.stpl
new file mode 100644
index 00000000..a592a652
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter2.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter2.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter2.tpl
new file mode 100644
index 00000000..9b955aa6
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter2.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter3.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter3.stpl
new file mode 100644
index 00000000..4d330d34
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter3.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter3.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter3.tpl
new file mode 100644
index 00000000..1f446e5d
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/codeigniter3.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/datalife_engine.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/datalife_engine.stpl
new file mode 100644
index 00000000..d1b5bcd2
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/datalife_engine.stpl
@@ -0,0 +1,122 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/datalife_engine.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/datalife_engine.tpl
new file mode 100644
index 00000000..ff33c232
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/datalife_engine.tpl
@@ -0,0 +1,118 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/default.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/default.stpl
new file mode 100644
index 00000000..a68c9986
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/default.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/default.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/default.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/default.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.stpl
new file mode 100644
index 00000000..27483cd8
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.stpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.tpl
new file mode 100644
index 00000000..31647c9f
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/dokuwiki.tpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/drupal.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/drupal.stpl
new file mode 100644
index 00000000..9a548439
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/drupal.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/drupal.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/drupal.tpl
new file mode 100644
index 00000000..417762c1
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/drupal.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/joomla.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/joomla.stpl
new file mode 100644
index 00000000..235a0121
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/joomla.stpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/joomla.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/joomla.tpl
new file mode 100644
index 00000000..997c268d
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/joomla.tpl
@@ -0,0 +1,54 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/no-php.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/no-php.stpl
new file mode 100644
index 00000000..a0234ae3
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/no-php.stpl
@@ -0,0 +1,42 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/no-php.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..97d04599
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/no-php.tpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/owncloud.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/owncloud.stpl
new file mode 100644
index 00000000..8311ca43
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/owncloud.stpl
@@ -0,0 +1,80 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/owncloud.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/owncloud.tpl
new file mode 100644
index 00000000..57cac2f8
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/owncloud.tpl
@@ -0,0 +1,76 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/piwik.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/piwik.stpl
new file mode 100644
index 00000000..c53af401
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/piwik.stpl
@@ -0,0 +1,68 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/piwik.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/piwik.tpl
new file mode 100644
index 00000000..6b4a94a6
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/piwik.tpl
@@ -0,0 +1,64 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/pyrocms.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/pyrocms.stpl
new file mode 100644
index 00000000..a6fc6755
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/pyrocms.stpl
@@ -0,0 +1,61 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/pyrocms.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/pyrocms.tpl
new file mode 100644
index 00000000..68b378ef
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/pyrocms.tpl
@@ -0,0 +1,57 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress.stpl
new file mode 100644
index 00000000..910c28b6
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress2.stpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress2.stpl
new file mode 100644
index 00000000..2822f875
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress2.stpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress2.tpl b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress2.tpl
new file mode 100644
index 00000000..37b8be30
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/php5-fpm/wordpress2.tpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.04/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/13.04/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 00000000..ae195617
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/nginx/proxy_ip.tpl
@@ -0,0 +1,9 @@
+server {
+ listen %ip%:%proxy_port% default;
+ server_name _;
+ #access_log /var/log/nginx/%ip%.log main;
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ }
+}
+
diff --git a/install/ubuntu/13.04/templates/web/php5-fpm/default.tpl b/install/ubuntu/13.04/templates/web/php5-fpm/default.tpl
new file mode 100644
index 00000000..44ccf7a4
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/php5-fpm/default.tpl
@@ -0,0 +1,18 @@
+[%backend%]
+listen = 127.0.0.1:%backend_port%
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/13.04/templates/web/php5-fpm/no-php.tpl b/install/ubuntu/13.04/templates/web/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..89487d5f
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/php5-fpm/no-php.tpl
@@ -0,0 +1,13 @@
+#[%backend%]
+#user = %user%
+#group = %user%
+#listen = /dev/null
+
+#listen.owner = %user%
+#listen.group = nginx
+
+#pm = dynamic
+#pm.max_children = 50
+#pm.start_servers = 3
+#pm.min_spare_servers = 2
+#pm.max_spare_servers = 10
diff --git a/install/ubuntu/13.04/templates/web/php5-fpm/socket.tpl b/install/ubuntu/13.04/templates/web/php5-fpm/socket.tpl
new file mode 100644
index 00000000..f0513da3
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/php5-fpm/socket.tpl
@@ -0,0 +1,21 @@
+[%backend%]
+listen = /var/run/php5-%backend%.sock
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+listen.owner = %user%
+listen.group = nginx
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/13.04/templates/web/skel/document_errors/403.html b/install/ubuntu/13.04/templates/web/skel/document_errors/403.html
new file mode 100755
index 00000000..9c3f6baa
--- /dev/null
+++ b/install/ubuntu/13.04/templates/web/skel/document_errors/403.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ %domain%
+ %domain%
+ SUSPEND
+ This site has been suspended
+
{locality} {zipcode}
{country} {region}';
+
+// Matching mode for addressbook search (including autocompletion)
+// 0 - partial (*abc*), default
+// 1 - strict (abc)
+// 2 - prefix (abc*)
+// Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode
+$rcmail_config['addressbook_search_mode'] = 0;
+
+// ----------------------------------
+// USER PREFERENCES
+// ----------------------------------
+
+// Use this charset as fallback for message decoding
+//$rcmail_config['default_charset'] = 'ISO-8859-1';
+$rcmail_config['default_charset'] = 'UTF-8';
+
+// skin name: folder from skins/
+$rcmail_config['skin'] = 'larry';
+
+// show up to X items in messages list view
+$rcmail_config['mail_pagesize'] = 50;
+
+// show up to X items in contacts list view
+$rcmail_config['addressbook_pagesize'] = 50;
+
+// sort contacts by this col (preferably either one of name, firstname, surname)
+$rcmail_config['addressbook_sort_col'] = 'surname';
+
+// the way how contact names are displayed in the list
+// 0: display name
+// 1: (prefix) firstname middlename surname (suffix)
+// 2: (prefix) surname firstname middlename (suffix)
+// 3: (prefix) surname, firstname middlename (suffix)
+$rcmail_config['addressbook_name_listing'] = 0;
+
+// use this timezone to display date/time
+// valid timezone identifers are listed here: php.net/manual/en/timezones.php
+// 'auto' will use the browser's timezone settings
+$rcmail_config['timezone'] = 'auto';
+
+// prefer displaying HTML messages
+$rcmail_config['prefer_html'] = true;
+
+// display remote inline images
+// 0 - Never, always ask
+// 1 - Ask if sender is not in address book
+// 2 - Always show inline images
+$rcmail_config['show_images'] = 0;
+
+// compose html formatted messages by default
+// 0 - never, 1 - always, 2 - on reply to HTML message only
+$rcmail_config['htmleditor'] = 0;
+
+// show pretty dates as standard
+$rcmail_config['prettydate'] = true;
+
+// save compose message every 300 seconds (5min)
+$rcmail_config['draft_autosave'] = 300;
+
+// default setting if preview pane is enabled
+$rcmail_config['preview_pane'] = false;
+
+// Mark as read when viewed in preview pane (delay in seconds)
+// Set to -1 if messages in preview pane should not be marked as read
+$rcmail_config['preview_pane_mark_read'] = 0;
+
+// Clear Trash on logout
+$rcmail_config['logout_purge'] = false;
+
+// Compact INBOX on logout
+$rcmail_config['logout_expunge'] = false;
+
+// Display attached images below the message body
+$rcmail_config['inline_images'] = true;
+
+// Encoding of long/non-ascii attachment names:
+// 0 - Full RFC 2231 compatible
+// 1 - RFC 2047 for 'name' and RFC 2231 for 'filename' parameter (Thunderbird's default)
+// 2 - Full 2047 compatible
+$rcmail_config['mime_param_folding'] = 1;
+
+// Set true if deleted messages should not be displayed
+// This will make the application run slower
+$rcmail_config['skip_deleted'] = false;
+
+// Set true to Mark deleted messages as read as well as deleted
+// False means that a message's read status is not affected by marking it as deleted
+$rcmail_config['read_when_deleted'] = true;
+
+// Set to true to never delete messages immediately
+// Use 'Purge' to remove messages marked as deleted
+$rcmail_config['flag_for_deletion'] = false;
+
+// Default interval for keep-alive/check-recent requests (in seconds)
+// Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime'
+$rcmail_config['keep_alive'] = 60;
+
+// If true all folders will be checked for recent messages
+$rcmail_config['check_all_folders'] = false;
+
+// If true, after message delete/move, the next message will be displayed
+$rcmail_config['display_next'] = false;
+
+// 0 - Do not expand threads
+// 1 - Expand all threads automatically
+// 2 - Expand only threads with unread messages
+$rcmail_config['autoexpand_threads'] = 0;
+
+// When replying place cursor above original message (top posting)
+$rcmail_config['top_posting'] = false;
+
+// When replying strip original signature from message
+$rcmail_config['strip_existing_sig'] = true;
+
+// Show signature:
+// 0 - Never
+// 1 - Always
+// 2 - New messages only
+// 3 - Forwards and Replies only
+$rcmail_config['show_sig'] = 1;
+
+// When replying or forwarding place sender's signature above existing message
+$rcmail_config['sig_above'] = false;
+
+// Use MIME encoding (quoted-printable) for 8bit characters in message body
+$rcmail_config['force_7bit'] = false;
+
+// Defaults of the search field configuration.
+// The array can contain a per-folder list of header fields which should be considered when searching
+// The entry with key '*' stands for all folders which do not have a specific list set.
+// Please note that folder names should to be in sync with $rcmail_config['default_folders']
+$rcmail_config['search_mods'] = null; // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1));
+
+// Defaults of the addressbook search field configuration.
+$rcmail_config['addressbook_search_mods'] = null; // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1);
+
+// 'Delete always'
+// This setting reflects if mail should be always deleted
+// when moving to Trash fails. This is necessary in some setups
+// when user is over quota and Trash is included in the quota.
+$rcmail_config['delete_always'] = false;
+
+// Directly delete messages in Junk instead of moving to Trash
+$rcmail_config['delete_junk'] = true;
+
+// Behavior if a received message requests a message delivery notification (read receipt)
+// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
+// 3 = send automatically if sender is in addressbook, otherwise ask the user
+// 4 = send automatically if sender is in addressbook, otherwise ignore
+$rcmail_config['mdn_requests'] = 0;
+
+// Return receipt checkbox default state
+$rcmail_config['mdn_default'] = 0;
+
+// Delivery Status Notification checkbox default state
+$rcmail_config['dsn_default'] = 0;
+
+// Place replies in the folder of the message being replied to
+$rcmail_config['reply_same_folder'] = false;
+
+// Sets default mode of Forward feature to "forward as attachment"
+$rcmail_config['forward_attachment'] = false;
+
+// Defines address book (internal index) to which new contacts will be added
+// By default it is the first writeable addressbook.
+// Note: Use '0' for built-in address book.
+$rcmail_config['default_addressbook'] = null;
+
+// Enables spell checking before sending a message.
+$rcmail_config['spellcheck_before_send'] = false;
+
+// Skip alternative email addresses in autocompletion (show one address per contact)
+$rcmail_config['autocomplete_single'] = false;
+
+// Default font for composed HTML message.
+// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
+// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
+$rcmail_config['default_font'] = '';
+
+// end of config file
diff --git a/install/ubuntu/13.10/roundcube/vesta.php b/install/ubuntu/13.10/roundcube/vesta.php
new file mode 100644
index 00000000..8fb202a4
--- /dev/null
+++ b/install/ubuntu/13.10/roundcube/vesta.php
@@ -0,0 +1,62 @@
+
+ */
+
+ function password_save($curpass, $passwd)
+ {
+ $rcmail = rcmail::get_instance();
+ $vesta_host = $rcmail->config->get('password_vesta_host');
+
+ if (empty($vesta_host))
+ {
+ $vesta_host = 'localhost';
+ }
+
+ $vesta_port = $rcmail->config->get('password_vesta_port');
+ if (empty($vesta_port))
+ {
+ $vesta_port = '8083';
+ }
+
+ $postvars = array(
+ 'email' => $_SESSION['username'],
+ 'password' => $curpass,
+ 'new' => $passwd
+ );
+
+ $postdata = http_build_query($postvars);
+
+ $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
+ $send .= 'Host: ' . $vesta_host . PHP_EOL;
+ $send .= 'User-Agent: PHP Script' . PHP_EOL;
+ $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
+ $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
+ $send .= 'Connection: close' . PHP_EOL;
+ $send .= PHP_EOL;
+ $send .= $postdata . PHP_EOL . PHP_EOL;
+
+ $fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
+ fputs($fp, $send);
+ $result = fread($fp, 2048);
+ fclose($fp);
+
+ $fp = fopen("/tmp/roundcube.log", 'w');
+ fwrite($fp, "test ok");
+ fwrite($fp, "\n");
+ fclose($fp);
+
+
+ if(strpos($result, 'ok') && !strpos($result, 'error'))
+ {
+ return PASSWORD_SUCCESS;
+ }
+ else {
+ return PASSWORD_ERROR;
+ }
+
+ }
diff --git a/install/ubuntu/13.10/sudo/admin b/install/ubuntu/13.10/sudo/admin
new file mode 100644
index 00000000..47e16098
--- /dev/null
+++ b/install/ubuntu/13.10/sudo/admin
@@ -0,0 +1,7 @@
+# Created by vesta installer
+Defaults env_keep="VESTA"
+Defaults:admin !syslog
+Defaults:admin !requiretty
+
+admin ALL=(ALL) ALL
+admin ALL=NOPASSWD:/usr/local/vesta/bin/*
diff --git a/install/ubuntu/13.10/templates.tar.gz b/install/ubuntu/13.10/templates.tar.gz
new file mode 100644
index 00000000..ce385d26
Binary files /dev/null and b/install/ubuntu/13.10/templates.tar.gz differ
diff --git a/install/ubuntu/13.10/templates/dns/child-ns.tpl b/install/ubuntu/13.10/templates/dns/child-ns.tpl
new file mode 100755
index 00000000..27f9b825
--- /dev/null
+++ b/install/ubuntu/13.10/templates/dns/child-ns.tpl
@@ -0,0 +1,11 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns1.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns2.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ns1' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='ns2' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/13.10/templates/dns/default.tpl b/install/ubuntu/13.10/templates/dns/default.tpl
new file mode 100755
index 00000000..38f96300
--- /dev/null
+++ b/install/ubuntu/13.10/templates/dns/default.tpl
@@ -0,0 +1,9 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/13.10/templates/dns/gmail.tpl b/install/ubuntu/13.10/templates/dns/gmail.tpl
new file mode 100755
index 00000000..950cfa45
--- /dev/null
+++ b/install/ubuntu/13.10/templates/dns/gmail.tpl
@@ -0,0 +1,14 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='ghs.google.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX2.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX3.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/13.10/templates/web/apache2/basedir.stpl b/install/ubuntu/13.10/templates/web/apache2/basedir.stpl
new file mode 100755
index 00000000..3f71e699
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/apache2/basedir.stpl
@@ -0,0 +1,41 @@
+
+
+
+
diff --git a/install/ubuntu/13.10/templates/web/nginx/caching.sh b/install/ubuntu/13.10/templates/web/nginx/caching.sh
new file mode 100755
index 00000000..6eb9126d
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/caching.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+user=$1
+domain=$2
+ip=$3
+home=$4
+docroot=$5
+
+str="proxy_cache_path /var/cache/nginx/$domain levels=2"
+str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
+echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf
+
diff --git a/install/ubuntu/13.10/templates/web/nginx/caching.stpl b/install/ubuntu/13.10/templates/web/nginx/caching.stpl
new file mode 100755
index 00000000..ca6cffe3
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/caching.stpl
@@ -0,0 +1,44 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/caching.tpl b/install/ubuntu/13.10/templates/web/nginx/caching.tpl
new file mode 100755
index 00000000..36761b65
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/caching.tpl
@@ -0,0 +1,41 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/default.stpl b/install/ubuntu/13.10/templates/web/nginx/default.stpl
new file mode 100755
index 00000000..fa538060
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/default.stpl
@@ -0,0 +1,36 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/13.10/templates/web/nginx/default.tpl b/install/ubuntu/13.10/templates/web/nginx/default.tpl
new file mode 100755
index 00000000..4d5c774b
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/default.tpl
@@ -0,0 +1,33 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/13.10/templates/web/nginx/hosting.sh b/install/ubuntu/13.10/templates/web/nginx/hosting.sh
new file mode 100755
index 00000000..eeed37ef
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/hosting.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Changing public_html permission
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+chmod 755 $docroot
+
+exit 0
diff --git a/install/ubuntu/13.10/templates/web/nginx/hosting.stpl b/install/ubuntu/13.10/templates/web/nginx/hosting.stpl
new file mode 100755
index 00000000..d778d633
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/hosting.stpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/13.10/templates/web/nginx/hosting.tpl b/install/ubuntu/13.10/templates/web/nginx/hosting.tpl
new file mode 100755
index 00000000..15961c95
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/hosting.tpl
@@ -0,0 +1,35 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl
new file mode 100644
index 00000000..01d82b60
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl
new file mode 100644
index 00000000..af452d19
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter2.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter2.stpl
new file mode 100644
index 00000000..a592a652
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter2.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter2.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter2.tpl
new file mode 100644
index 00000000..9b955aa6
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter2.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter3.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter3.stpl
new file mode 100644
index 00000000..4d330d34
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter3.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter3.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter3.tpl
new file mode 100644
index 00000000..1f446e5d
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/codeigniter3.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/datalife_engine.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/datalife_engine.stpl
new file mode 100644
index 00000000..d1b5bcd2
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/datalife_engine.stpl
@@ -0,0 +1,122 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/datalife_engine.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/datalife_engine.tpl
new file mode 100644
index 00000000..ff33c232
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/datalife_engine.tpl
@@ -0,0 +1,118 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/default.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/default.stpl
new file mode 100644
index 00000000..a68c9986
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/default.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/default.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/default.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/default.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.stpl
new file mode 100644
index 00000000..27483cd8
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.stpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.tpl
new file mode 100644
index 00000000..31647c9f
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/dokuwiki.tpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/drupal.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/drupal.stpl
new file mode 100644
index 00000000..9a548439
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/drupal.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/drupal.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/drupal.tpl
new file mode 100644
index 00000000..417762c1
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/drupal.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/joomla.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/joomla.stpl
new file mode 100644
index 00000000..235a0121
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/joomla.stpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/joomla.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/joomla.tpl
new file mode 100644
index 00000000..997c268d
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/joomla.tpl
@@ -0,0 +1,54 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/no-php.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/no-php.stpl
new file mode 100644
index 00000000..a0234ae3
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/no-php.stpl
@@ -0,0 +1,42 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/no-php.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..97d04599
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/no-php.tpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/owncloud.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/owncloud.stpl
new file mode 100644
index 00000000..8311ca43
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/owncloud.stpl
@@ -0,0 +1,80 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/owncloud.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/owncloud.tpl
new file mode 100644
index 00000000..57cac2f8
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/owncloud.tpl
@@ -0,0 +1,76 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/piwik.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/piwik.stpl
new file mode 100644
index 00000000..c53af401
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/piwik.stpl
@@ -0,0 +1,68 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/piwik.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/piwik.tpl
new file mode 100644
index 00000000..6b4a94a6
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/piwik.tpl
@@ -0,0 +1,64 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/pyrocms.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/pyrocms.stpl
new file mode 100644
index 00000000..a6fc6755
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/pyrocms.stpl
@@ -0,0 +1,61 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/pyrocms.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/pyrocms.tpl
new file mode 100644
index 00000000..68b378ef
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/pyrocms.tpl
@@ -0,0 +1,57 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress.stpl
new file mode 100644
index 00000000..910c28b6
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress2.stpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress2.stpl
new file mode 100644
index 00000000..2822f875
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress2.stpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress2.tpl b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress2.tpl
new file mode 100644
index 00000000..37b8be30
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/php5-fpm/wordpress2.tpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/13.10/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/13.10/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 00000000..ae195617
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/nginx/proxy_ip.tpl
@@ -0,0 +1,9 @@
+server {
+ listen %ip%:%proxy_port% default;
+ server_name _;
+ #access_log /var/log/nginx/%ip%.log main;
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ }
+}
+
diff --git a/install/ubuntu/13.10/templates/web/php5-fpm/default.tpl b/install/ubuntu/13.10/templates/web/php5-fpm/default.tpl
new file mode 100644
index 00000000..44ccf7a4
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/php5-fpm/default.tpl
@@ -0,0 +1,18 @@
+[%backend%]
+listen = 127.0.0.1:%backend_port%
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/13.10/templates/web/php5-fpm/no-php.tpl b/install/ubuntu/13.10/templates/web/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..89487d5f
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/php5-fpm/no-php.tpl
@@ -0,0 +1,13 @@
+#[%backend%]
+#user = %user%
+#group = %user%
+#listen = /dev/null
+
+#listen.owner = %user%
+#listen.group = nginx
+
+#pm = dynamic
+#pm.max_children = 50
+#pm.start_servers = 3
+#pm.min_spare_servers = 2
+#pm.max_spare_servers = 10
diff --git a/install/ubuntu/13.10/templates/web/php5-fpm/socket.tpl b/install/ubuntu/13.10/templates/web/php5-fpm/socket.tpl
new file mode 100644
index 00000000..f0513da3
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/php5-fpm/socket.tpl
@@ -0,0 +1,21 @@
+[%backend%]
+listen = /var/run/php5-%backend%.sock
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+listen.owner = %user%
+listen.group = nginx
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/13.10/templates/web/skel/document_errors/403.html b/install/ubuntu/13.10/templates/web/skel/document_errors/403.html
new file mode 100755
index 00000000..9c3f6baa
--- /dev/null
+++ b/install/ubuntu/13.10/templates/web/skel/document_errors/403.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ %domain%
+ %domain%
+ SUSPEND
+ This site has been suspended
+
{locality} {zipcode}
{country} {region}';
+
+// Matching mode for addressbook search (including autocompletion)
+// 0 - partial (*abc*), default
+// 1 - strict (abc)
+// 2 - prefix (abc*)
+// Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode
+$rcmail_config['addressbook_search_mode'] = 0;
+
+// ----------------------------------
+// USER PREFERENCES
+// ----------------------------------
+
+// Use this charset as fallback for message decoding
+//$rcmail_config['default_charset'] = 'ISO-8859-1';
+$rcmail_config['default_charset'] = 'UTF-8';
+
+// skin name: folder from skins/
+$rcmail_config['skin'] = 'larry';
+
+// show up to X items in messages list view
+$rcmail_config['mail_pagesize'] = 50;
+
+// show up to X items in contacts list view
+$rcmail_config['addressbook_pagesize'] = 50;
+
+// sort contacts by this col (preferably either one of name, firstname, surname)
+$rcmail_config['addressbook_sort_col'] = 'surname';
+
+// the way how contact names are displayed in the list
+// 0: display name
+// 1: (prefix) firstname middlename surname (suffix)
+// 2: (prefix) surname firstname middlename (suffix)
+// 3: (prefix) surname, firstname middlename (suffix)
+$rcmail_config['addressbook_name_listing'] = 0;
+
+// use this timezone to display date/time
+// valid timezone identifers are listed here: php.net/manual/en/timezones.php
+// 'auto' will use the browser's timezone settings
+$rcmail_config['timezone'] = 'auto';
+
+// prefer displaying HTML messages
+$rcmail_config['prefer_html'] = true;
+
+// display remote inline images
+// 0 - Never, always ask
+// 1 - Ask if sender is not in address book
+// 2 - Always show inline images
+$rcmail_config['show_images'] = 0;
+
+// compose html formatted messages by default
+// 0 - never, 1 - always, 2 - on reply to HTML message only
+$rcmail_config['htmleditor'] = 0;
+
+// show pretty dates as standard
+$rcmail_config['prettydate'] = true;
+
+// save compose message every 300 seconds (5min)
+$rcmail_config['draft_autosave'] = 300;
+
+// default setting if preview pane is enabled
+$rcmail_config['preview_pane'] = false;
+
+// Mark as read when viewed in preview pane (delay in seconds)
+// Set to -1 if messages in preview pane should not be marked as read
+$rcmail_config['preview_pane_mark_read'] = 0;
+
+// Clear Trash on logout
+$rcmail_config['logout_purge'] = false;
+
+// Compact INBOX on logout
+$rcmail_config['logout_expunge'] = false;
+
+// Display attached images below the message body
+$rcmail_config['inline_images'] = true;
+
+// Encoding of long/non-ascii attachment names:
+// 0 - Full RFC 2231 compatible
+// 1 - RFC 2047 for 'name' and RFC 2231 for 'filename' parameter (Thunderbird's default)
+// 2 - Full 2047 compatible
+$rcmail_config['mime_param_folding'] = 1;
+
+// Set true if deleted messages should not be displayed
+// This will make the application run slower
+$rcmail_config['skip_deleted'] = false;
+
+// Set true to Mark deleted messages as read as well as deleted
+// False means that a message's read status is not affected by marking it as deleted
+$rcmail_config['read_when_deleted'] = true;
+
+// Set to true to never delete messages immediately
+// Use 'Purge' to remove messages marked as deleted
+$rcmail_config['flag_for_deletion'] = false;
+
+// Default interval for keep-alive/check-recent requests (in seconds)
+// Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime'
+$rcmail_config['keep_alive'] = 60;
+
+// If true all folders will be checked for recent messages
+$rcmail_config['check_all_folders'] = false;
+
+// If true, after message delete/move, the next message will be displayed
+$rcmail_config['display_next'] = false;
+
+// 0 - Do not expand threads
+// 1 - Expand all threads automatically
+// 2 - Expand only threads with unread messages
+$rcmail_config['autoexpand_threads'] = 0;
+
+// When replying place cursor above original message (top posting)
+$rcmail_config['top_posting'] = false;
+
+// When replying strip original signature from message
+$rcmail_config['strip_existing_sig'] = true;
+
+// Show signature:
+// 0 - Never
+// 1 - Always
+// 2 - New messages only
+// 3 - Forwards and Replies only
+$rcmail_config['show_sig'] = 1;
+
+// When replying or forwarding place sender's signature above existing message
+$rcmail_config['sig_above'] = false;
+
+// Use MIME encoding (quoted-printable) for 8bit characters in message body
+$rcmail_config['force_7bit'] = false;
+
+// Defaults of the search field configuration.
+// The array can contain a per-folder list of header fields which should be considered when searching
+// The entry with key '*' stands for all folders which do not have a specific list set.
+// Please note that folder names should to be in sync with $rcmail_config['default_folders']
+$rcmail_config['search_mods'] = null; // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1));
+
+// Defaults of the addressbook search field configuration.
+$rcmail_config['addressbook_search_mods'] = null; // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1);
+
+// 'Delete always'
+// This setting reflects if mail should be always deleted
+// when moving to Trash fails. This is necessary in some setups
+// when user is over quota and Trash is included in the quota.
+$rcmail_config['delete_always'] = false;
+
+// Directly delete messages in Junk instead of moving to Trash
+$rcmail_config['delete_junk'] = true;
+
+// Behavior if a received message requests a message delivery notification (read receipt)
+// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
+// 3 = send automatically if sender is in addressbook, otherwise ask the user
+// 4 = send automatically if sender is in addressbook, otherwise ignore
+$rcmail_config['mdn_requests'] = 0;
+
+// Return receipt checkbox default state
+$rcmail_config['mdn_default'] = 0;
+
+// Delivery Status Notification checkbox default state
+$rcmail_config['dsn_default'] = 0;
+
+// Place replies in the folder of the message being replied to
+$rcmail_config['reply_same_folder'] = false;
+
+// Sets default mode of Forward feature to "forward as attachment"
+$rcmail_config['forward_attachment'] = false;
+
+// Defines address book (internal index) to which new contacts will be added
+// By default it is the first writeable addressbook.
+// Note: Use '0' for built-in address book.
+$rcmail_config['default_addressbook'] = null;
+
+// Enables spell checking before sending a message.
+$rcmail_config['spellcheck_before_send'] = false;
+
+// Skip alternative email addresses in autocompletion (show one address per contact)
+$rcmail_config['autocomplete_single'] = false;
+
+// Default font for composed HTML message.
+// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
+// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
+$rcmail_config['default_font'] = '';
+
+// end of config file
diff --git a/install/ubuntu/14.04/roundcube/vesta.php b/install/ubuntu/14.04/roundcube/vesta.php
new file mode 100644
index 00000000..8fb202a4
--- /dev/null
+++ b/install/ubuntu/14.04/roundcube/vesta.php
@@ -0,0 +1,62 @@
+
+ */
+
+ function password_save($curpass, $passwd)
+ {
+ $rcmail = rcmail::get_instance();
+ $vesta_host = $rcmail->config->get('password_vesta_host');
+
+ if (empty($vesta_host))
+ {
+ $vesta_host = 'localhost';
+ }
+
+ $vesta_port = $rcmail->config->get('password_vesta_port');
+ if (empty($vesta_port))
+ {
+ $vesta_port = '8083';
+ }
+
+ $postvars = array(
+ 'email' => $_SESSION['username'],
+ 'password' => $curpass,
+ 'new' => $passwd
+ );
+
+ $postdata = http_build_query($postvars);
+
+ $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
+ $send .= 'Host: ' . $vesta_host . PHP_EOL;
+ $send .= 'User-Agent: PHP Script' . PHP_EOL;
+ $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
+ $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
+ $send .= 'Connection: close' . PHP_EOL;
+ $send .= PHP_EOL;
+ $send .= $postdata . PHP_EOL . PHP_EOL;
+
+ $fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
+ fputs($fp, $send);
+ $result = fread($fp, 2048);
+ fclose($fp);
+
+ $fp = fopen("/tmp/roundcube.log", 'w');
+ fwrite($fp, "test ok");
+ fwrite($fp, "\n");
+ fclose($fp);
+
+
+ if(strpos($result, 'ok') && !strpos($result, 'error'))
+ {
+ return PASSWORD_SUCCESS;
+ }
+ else {
+ return PASSWORD_ERROR;
+ }
+
+ }
diff --git a/install/ubuntu/14.04/sudo/admin b/install/ubuntu/14.04/sudo/admin
new file mode 100644
index 00000000..47e16098
--- /dev/null
+++ b/install/ubuntu/14.04/sudo/admin
@@ -0,0 +1,7 @@
+# Created by vesta installer
+Defaults env_keep="VESTA"
+Defaults:admin !syslog
+Defaults:admin !requiretty
+
+admin ALL=(ALL) ALL
+admin ALL=NOPASSWD:/usr/local/vesta/bin/*
diff --git a/install/ubuntu/14.04/templates.tar.gz b/install/ubuntu/14.04/templates.tar.gz
new file mode 100644
index 00000000..ce385d26
Binary files /dev/null and b/install/ubuntu/14.04/templates.tar.gz differ
diff --git a/install/ubuntu/14.04/templates/dns/child-ns.tpl b/install/ubuntu/14.04/templates/dns/child-ns.tpl
new file mode 100755
index 00000000..27f9b825
--- /dev/null
+++ b/install/ubuntu/14.04/templates/dns/child-ns.tpl
@@ -0,0 +1,11 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns1.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns2.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ns1' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='ns2' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/14.04/templates/dns/default.tpl b/install/ubuntu/14.04/templates/dns/default.tpl
new file mode 100755
index 00000000..38f96300
--- /dev/null
+++ b/install/ubuntu/14.04/templates/dns/default.tpl
@@ -0,0 +1,9 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/14.04/templates/dns/gmail.tpl b/install/ubuntu/14.04/templates/dns/gmail.tpl
new file mode 100755
index 00000000..950cfa45
--- /dev/null
+++ b/install/ubuntu/14.04/templates/dns/gmail.tpl
@@ -0,0 +1,14 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='ghs.google.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX2.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX3.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/14.04/templates/web/apache2/basedir.stpl b/install/ubuntu/14.04/templates/web/apache2/basedir.stpl
new file mode 100755
index 00000000..3f71e699
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/apache2/basedir.stpl
@@ -0,0 +1,41 @@
+
+
+
+
diff --git a/install/ubuntu/14.04/templates/web/nginx/caching.sh b/install/ubuntu/14.04/templates/web/nginx/caching.sh
new file mode 100755
index 00000000..6eb9126d
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/caching.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+user=$1
+domain=$2
+ip=$3
+home=$4
+docroot=$5
+
+str="proxy_cache_path /var/cache/nginx/$domain levels=2"
+str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
+echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf
+
diff --git a/install/ubuntu/14.04/templates/web/nginx/caching.stpl b/install/ubuntu/14.04/templates/web/nginx/caching.stpl
new file mode 100755
index 00000000..ca6cffe3
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/caching.stpl
@@ -0,0 +1,44 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/caching.tpl b/install/ubuntu/14.04/templates/web/nginx/caching.tpl
new file mode 100755
index 00000000..36761b65
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/caching.tpl
@@ -0,0 +1,41 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/default.stpl b/install/ubuntu/14.04/templates/web/nginx/default.stpl
new file mode 100755
index 00000000..fa538060
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/default.stpl
@@ -0,0 +1,36 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/14.04/templates/web/nginx/default.tpl b/install/ubuntu/14.04/templates/web/nginx/default.tpl
new file mode 100755
index 00000000..4d5c774b
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/default.tpl
@@ -0,0 +1,33 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/14.04/templates/web/nginx/hosting.sh b/install/ubuntu/14.04/templates/web/nginx/hosting.sh
new file mode 100755
index 00000000..eeed37ef
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/hosting.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Changing public_html permission
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+chmod 755 $docroot
+
+exit 0
diff --git a/install/ubuntu/14.04/templates/web/nginx/hosting.stpl b/install/ubuntu/14.04/templates/web/nginx/hosting.stpl
new file mode 100755
index 00000000..d778d633
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/hosting.stpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/14.04/templates/web/nginx/hosting.tpl b/install/ubuntu/14.04/templates/web/nginx/hosting.tpl
new file mode 100755
index 00000000..15961c95
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/hosting.tpl
@@ -0,0 +1,35 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl
new file mode 100644
index 00000000..01d82b60
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl
new file mode 100644
index 00000000..af452d19
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter2.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter2.stpl
new file mode 100644
index 00000000..a592a652
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter2.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter2.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter2.tpl
new file mode 100644
index 00000000..9b955aa6
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter2.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter3.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter3.stpl
new file mode 100644
index 00000000..4d330d34
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter3.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter3.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter3.tpl
new file mode 100644
index 00000000..1f446e5d
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/codeigniter3.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/datalife_engine.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/datalife_engine.stpl
new file mode 100644
index 00000000..d1b5bcd2
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/datalife_engine.stpl
@@ -0,0 +1,122 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/datalife_engine.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/datalife_engine.tpl
new file mode 100644
index 00000000..ff33c232
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/datalife_engine.tpl
@@ -0,0 +1,118 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/default.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/default.stpl
new file mode 100644
index 00000000..a68c9986
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/default.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/default.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/default.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/default.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.stpl
new file mode 100644
index 00000000..27483cd8
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.stpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.tpl
new file mode 100644
index 00000000..31647c9f
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/dokuwiki.tpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/drupal.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/drupal.stpl
new file mode 100644
index 00000000..9a548439
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/drupal.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/drupal.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/drupal.tpl
new file mode 100644
index 00000000..417762c1
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/drupal.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/joomla.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/joomla.stpl
new file mode 100644
index 00000000..235a0121
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/joomla.stpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/joomla.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/joomla.tpl
new file mode 100644
index 00000000..997c268d
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/joomla.tpl
@@ -0,0 +1,54 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/no-php.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/no-php.stpl
new file mode 100644
index 00000000..a0234ae3
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/no-php.stpl
@@ -0,0 +1,42 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/no-php.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..97d04599
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/no-php.tpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/owncloud.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/owncloud.stpl
new file mode 100644
index 00000000..8311ca43
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/owncloud.stpl
@@ -0,0 +1,80 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/owncloud.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/owncloud.tpl
new file mode 100644
index 00000000..57cac2f8
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/owncloud.tpl
@@ -0,0 +1,76 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/piwik.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/piwik.stpl
new file mode 100644
index 00000000..c53af401
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/piwik.stpl
@@ -0,0 +1,68 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/piwik.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/piwik.tpl
new file mode 100644
index 00000000..6b4a94a6
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/piwik.tpl
@@ -0,0 +1,64 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/pyrocms.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/pyrocms.stpl
new file mode 100644
index 00000000..a6fc6755
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/pyrocms.stpl
@@ -0,0 +1,61 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/pyrocms.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/pyrocms.tpl
new file mode 100644
index 00000000..68b378ef
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/pyrocms.tpl
@@ -0,0 +1,57 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress.stpl
new file mode 100644
index 00000000..910c28b6
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress2.stpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress2.stpl
new file mode 100644
index 00000000..2822f875
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress2.stpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress2.tpl b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress2.tpl
new file mode 100644
index 00000000..37b8be30
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/php5-fpm/wordpress2.tpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.04/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/14.04/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 00000000..ae195617
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/nginx/proxy_ip.tpl
@@ -0,0 +1,9 @@
+server {
+ listen %ip%:%proxy_port% default;
+ server_name _;
+ #access_log /var/log/nginx/%ip%.log main;
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ }
+}
+
diff --git a/install/ubuntu/14.04/templates/web/php5-fpm/default.tpl b/install/ubuntu/14.04/templates/web/php5-fpm/default.tpl
new file mode 100644
index 00000000..44ccf7a4
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/php5-fpm/default.tpl
@@ -0,0 +1,18 @@
+[%backend%]
+listen = 127.0.0.1:%backend_port%
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/14.04/templates/web/php5-fpm/no-php.tpl b/install/ubuntu/14.04/templates/web/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..89487d5f
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/php5-fpm/no-php.tpl
@@ -0,0 +1,13 @@
+#[%backend%]
+#user = %user%
+#group = %user%
+#listen = /dev/null
+
+#listen.owner = %user%
+#listen.group = nginx
+
+#pm = dynamic
+#pm.max_children = 50
+#pm.start_servers = 3
+#pm.min_spare_servers = 2
+#pm.max_spare_servers = 10
diff --git a/install/ubuntu/14.04/templates/web/php5-fpm/socket.tpl b/install/ubuntu/14.04/templates/web/php5-fpm/socket.tpl
new file mode 100644
index 00000000..f0513da3
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/php5-fpm/socket.tpl
@@ -0,0 +1,21 @@
+[%backend%]
+listen = /var/run/php5-%backend%.sock
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+listen.owner = %user%
+listen.group = nginx
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/14.04/templates/web/skel/document_errors/403.html b/install/ubuntu/14.04/templates/web/skel/document_errors/403.html
new file mode 100755
index 00000000..9c3f6baa
--- /dev/null
+++ b/install/ubuntu/14.04/templates/web/skel/document_errors/403.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ %domain%
+ %domain%
+ SUSPEND
+ This site has been suspended
+
{locality} {zipcode}
{country} {region}';
+
+// Matching mode for addressbook search (including autocompletion)
+// 0 - partial (*abc*), default
+// 1 - strict (abc)
+// 2 - prefix (abc*)
+// Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode
+$rcmail_config['addressbook_search_mode'] = 0;
+
+// ----------------------------------
+// USER PREFERENCES
+// ----------------------------------
+
+// Use this charset as fallback for message decoding
+//$rcmail_config['default_charset'] = 'ISO-8859-1';
+$rcmail_config['default_charset'] = 'UTF-8';
+
+// skin name: folder from skins/
+$rcmail_config['skin'] = 'larry';
+
+// show up to X items in messages list view
+$rcmail_config['mail_pagesize'] = 50;
+
+// show up to X items in contacts list view
+$rcmail_config['addressbook_pagesize'] = 50;
+
+// sort contacts by this col (preferably either one of name, firstname, surname)
+$rcmail_config['addressbook_sort_col'] = 'surname';
+
+// the way how contact names are displayed in the list
+// 0: display name
+// 1: (prefix) firstname middlename surname (suffix)
+// 2: (prefix) surname firstname middlename (suffix)
+// 3: (prefix) surname, firstname middlename (suffix)
+$rcmail_config['addressbook_name_listing'] = 0;
+
+// use this timezone to display date/time
+// valid timezone identifers are listed here: php.net/manual/en/timezones.php
+// 'auto' will use the browser's timezone settings
+$rcmail_config['timezone'] = 'auto';
+
+// prefer displaying HTML messages
+$rcmail_config['prefer_html'] = true;
+
+// display remote inline images
+// 0 - Never, always ask
+// 1 - Ask if sender is not in address book
+// 2 - Always show inline images
+$rcmail_config['show_images'] = 0;
+
+// compose html formatted messages by default
+// 0 - never, 1 - always, 2 - on reply to HTML message only
+$rcmail_config['htmleditor'] = 0;
+
+// show pretty dates as standard
+$rcmail_config['prettydate'] = true;
+
+// save compose message every 300 seconds (5min)
+$rcmail_config['draft_autosave'] = 300;
+
+// default setting if preview pane is enabled
+$rcmail_config['preview_pane'] = false;
+
+// Mark as read when viewed in preview pane (delay in seconds)
+// Set to -1 if messages in preview pane should not be marked as read
+$rcmail_config['preview_pane_mark_read'] = 0;
+
+// Clear Trash on logout
+$rcmail_config['logout_purge'] = false;
+
+// Compact INBOX on logout
+$rcmail_config['logout_expunge'] = false;
+
+// Display attached images below the message body
+$rcmail_config['inline_images'] = true;
+
+// Encoding of long/non-ascii attachment names:
+// 0 - Full RFC 2231 compatible
+// 1 - RFC 2047 for 'name' and RFC 2231 for 'filename' parameter (Thunderbird's default)
+// 2 - Full 2047 compatible
+$rcmail_config['mime_param_folding'] = 1;
+
+// Set true if deleted messages should not be displayed
+// This will make the application run slower
+$rcmail_config['skip_deleted'] = false;
+
+// Set true to Mark deleted messages as read as well as deleted
+// False means that a message's read status is not affected by marking it as deleted
+$rcmail_config['read_when_deleted'] = true;
+
+// Set to true to never delete messages immediately
+// Use 'Purge' to remove messages marked as deleted
+$rcmail_config['flag_for_deletion'] = false;
+
+// Default interval for keep-alive/check-recent requests (in seconds)
+// Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime'
+$rcmail_config['keep_alive'] = 60;
+
+// If true all folders will be checked for recent messages
+$rcmail_config['check_all_folders'] = false;
+
+// If true, after message delete/move, the next message will be displayed
+$rcmail_config['display_next'] = false;
+
+// 0 - Do not expand threads
+// 1 - Expand all threads automatically
+// 2 - Expand only threads with unread messages
+$rcmail_config['autoexpand_threads'] = 0;
+
+// When replying place cursor above original message (top posting)
+$rcmail_config['top_posting'] = false;
+
+// When replying strip original signature from message
+$rcmail_config['strip_existing_sig'] = true;
+
+// Show signature:
+// 0 - Never
+// 1 - Always
+// 2 - New messages only
+// 3 - Forwards and Replies only
+$rcmail_config['show_sig'] = 1;
+
+// When replying or forwarding place sender's signature above existing message
+$rcmail_config['sig_above'] = false;
+
+// Use MIME encoding (quoted-printable) for 8bit characters in message body
+$rcmail_config['force_7bit'] = false;
+
+// Defaults of the search field configuration.
+// The array can contain a per-folder list of header fields which should be considered when searching
+// The entry with key '*' stands for all folders which do not have a specific list set.
+// Please note that folder names should to be in sync with $rcmail_config['default_folders']
+$rcmail_config['search_mods'] = null; // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1));
+
+// Defaults of the addressbook search field configuration.
+$rcmail_config['addressbook_search_mods'] = null; // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1);
+
+// 'Delete always'
+// This setting reflects if mail should be always deleted
+// when moving to Trash fails. This is necessary in some setups
+// when user is over quota and Trash is included in the quota.
+$rcmail_config['delete_always'] = false;
+
+// Directly delete messages in Junk instead of moving to Trash
+$rcmail_config['delete_junk'] = true;
+
+// Behavior if a received message requests a message delivery notification (read receipt)
+// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
+// 3 = send automatically if sender is in addressbook, otherwise ask the user
+// 4 = send automatically if sender is in addressbook, otherwise ignore
+$rcmail_config['mdn_requests'] = 0;
+
+// Return receipt checkbox default state
+$rcmail_config['mdn_default'] = 0;
+
+// Delivery Status Notification checkbox default state
+$rcmail_config['dsn_default'] = 0;
+
+// Place replies in the folder of the message being replied to
+$rcmail_config['reply_same_folder'] = false;
+
+// Sets default mode of Forward feature to "forward as attachment"
+$rcmail_config['forward_attachment'] = false;
+
+// Defines address book (internal index) to which new contacts will be added
+// By default it is the first writeable addressbook.
+// Note: Use '0' for built-in address book.
+$rcmail_config['default_addressbook'] = null;
+
+// Enables spell checking before sending a message.
+$rcmail_config['spellcheck_before_send'] = false;
+
+// Skip alternative email addresses in autocompletion (show one address per contact)
+$rcmail_config['autocomplete_single'] = false;
+
+// Default font for composed HTML message.
+// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
+// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
+$rcmail_config['default_font'] = '';
+
+// end of config file
diff --git a/install/ubuntu/14.10/roundcube/vesta.php b/install/ubuntu/14.10/roundcube/vesta.php
new file mode 100644
index 00000000..8fb202a4
--- /dev/null
+++ b/install/ubuntu/14.10/roundcube/vesta.php
@@ -0,0 +1,62 @@
+
+ */
+
+ function password_save($curpass, $passwd)
+ {
+ $rcmail = rcmail::get_instance();
+ $vesta_host = $rcmail->config->get('password_vesta_host');
+
+ if (empty($vesta_host))
+ {
+ $vesta_host = 'localhost';
+ }
+
+ $vesta_port = $rcmail->config->get('password_vesta_port');
+ if (empty($vesta_port))
+ {
+ $vesta_port = '8083';
+ }
+
+ $postvars = array(
+ 'email' => $_SESSION['username'],
+ 'password' => $curpass,
+ 'new' => $passwd
+ );
+
+ $postdata = http_build_query($postvars);
+
+ $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
+ $send .= 'Host: ' . $vesta_host . PHP_EOL;
+ $send .= 'User-Agent: PHP Script' . PHP_EOL;
+ $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
+ $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
+ $send .= 'Connection: close' . PHP_EOL;
+ $send .= PHP_EOL;
+ $send .= $postdata . PHP_EOL . PHP_EOL;
+
+ $fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
+ fputs($fp, $send);
+ $result = fread($fp, 2048);
+ fclose($fp);
+
+ $fp = fopen("/tmp/roundcube.log", 'w');
+ fwrite($fp, "test ok");
+ fwrite($fp, "\n");
+ fclose($fp);
+
+
+ if(strpos($result, 'ok') && !strpos($result, 'error'))
+ {
+ return PASSWORD_SUCCESS;
+ }
+ else {
+ return PASSWORD_ERROR;
+ }
+
+ }
diff --git a/install/ubuntu/14.10/sudo/admin b/install/ubuntu/14.10/sudo/admin
new file mode 100644
index 00000000..47e16098
--- /dev/null
+++ b/install/ubuntu/14.10/sudo/admin
@@ -0,0 +1,7 @@
+# Created by vesta installer
+Defaults env_keep="VESTA"
+Defaults:admin !syslog
+Defaults:admin !requiretty
+
+admin ALL=(ALL) ALL
+admin ALL=NOPASSWD:/usr/local/vesta/bin/*
diff --git a/install/ubuntu/14.10/templates.tar.gz b/install/ubuntu/14.10/templates.tar.gz
new file mode 100644
index 00000000..ce385d26
Binary files /dev/null and b/install/ubuntu/14.10/templates.tar.gz differ
diff --git a/install/ubuntu/14.10/templates/dns/child-ns.tpl b/install/ubuntu/14.10/templates/dns/child-ns.tpl
new file mode 100755
index 00000000..27f9b825
--- /dev/null
+++ b/install/ubuntu/14.10/templates/dns/child-ns.tpl
@@ -0,0 +1,11 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns1.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns2.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ns1' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='ns2' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/14.10/templates/dns/default.tpl b/install/ubuntu/14.10/templates/dns/default.tpl
new file mode 100755
index 00000000..38f96300
--- /dev/null
+++ b/install/ubuntu/14.10/templates/dns/default.tpl
@@ -0,0 +1,9 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/14.10/templates/dns/gmail.tpl b/install/ubuntu/14.10/templates/dns/gmail.tpl
new file mode 100755
index 00000000..950cfa45
--- /dev/null
+++ b/install/ubuntu/14.10/templates/dns/gmail.tpl
@@ -0,0 +1,14 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='ghs.google.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX2.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX3.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/14.10/templates/web/apache2/basedir.stpl b/install/ubuntu/14.10/templates/web/apache2/basedir.stpl
new file mode 100755
index 00000000..3f71e699
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/apache2/basedir.stpl
@@ -0,0 +1,41 @@
+
+
+
+
diff --git a/install/ubuntu/14.10/templates/web/nginx/caching.sh b/install/ubuntu/14.10/templates/web/nginx/caching.sh
new file mode 100755
index 00000000..6eb9126d
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/caching.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+user=$1
+domain=$2
+ip=$3
+home=$4
+docroot=$5
+
+str="proxy_cache_path /var/cache/nginx/$domain levels=2"
+str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
+echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf
+
diff --git a/install/ubuntu/14.10/templates/web/nginx/caching.stpl b/install/ubuntu/14.10/templates/web/nginx/caching.stpl
new file mode 100755
index 00000000..ca6cffe3
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/caching.stpl
@@ -0,0 +1,44 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/caching.tpl b/install/ubuntu/14.10/templates/web/nginx/caching.tpl
new file mode 100755
index 00000000..36761b65
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/caching.tpl
@@ -0,0 +1,41 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/default.stpl b/install/ubuntu/14.10/templates/web/nginx/default.stpl
new file mode 100755
index 00000000..fa538060
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/default.stpl
@@ -0,0 +1,36 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/14.10/templates/web/nginx/default.tpl b/install/ubuntu/14.10/templates/web/nginx/default.tpl
new file mode 100755
index 00000000..4d5c774b
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/default.tpl
@@ -0,0 +1,33 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/14.10/templates/web/nginx/hosting.sh b/install/ubuntu/14.10/templates/web/nginx/hosting.sh
new file mode 100755
index 00000000..eeed37ef
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/hosting.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Changing public_html permission
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+chmod 755 $docroot
+
+exit 0
diff --git a/install/ubuntu/14.10/templates/web/nginx/hosting.stpl b/install/ubuntu/14.10/templates/web/nginx/hosting.stpl
new file mode 100755
index 00000000..d778d633
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/hosting.stpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/14.10/templates/web/nginx/hosting.tpl b/install/ubuntu/14.10/templates/web/nginx/hosting.tpl
new file mode 100755
index 00000000..15961c95
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/hosting.tpl
@@ -0,0 +1,35 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl
new file mode 100644
index 00000000..01d82b60
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/cms_made_simple.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl
new file mode 100644
index 00000000..af452d19
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/cms_made_simple.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter2.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter2.stpl
new file mode 100644
index 00000000..a592a652
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter2.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter2.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter2.tpl
new file mode 100644
index 00000000..9b955aa6
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter2.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter3.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter3.stpl
new file mode 100644
index 00000000..4d330d34
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter3.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter3.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter3.tpl
new file mode 100644
index 00000000..1f446e5d
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/codeigniter3.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/datalife_engine.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/datalife_engine.stpl
new file mode 100644
index 00000000..d1b5bcd2
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/datalife_engine.stpl
@@ -0,0 +1,122 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/datalife_engine.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/datalife_engine.tpl
new file mode 100644
index 00000000..ff33c232
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/datalife_engine.tpl
@@ -0,0 +1,118 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/default.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/default.stpl
new file mode 100644
index 00000000..a68c9986
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/default.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/default.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/default.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/default.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.stpl
new file mode 100644
index 00000000..27483cd8
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.stpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.tpl
new file mode 100644
index 00000000..31647c9f
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/dokuwiki.tpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/drupal.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/drupal.stpl
new file mode 100644
index 00000000..9a548439
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/drupal.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/drupal.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/drupal.tpl
new file mode 100644
index 00000000..417762c1
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/drupal.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/joomla.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/joomla.stpl
new file mode 100644
index 00000000..235a0121
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/joomla.stpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/joomla.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/joomla.tpl
new file mode 100644
index 00000000..997c268d
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/joomla.tpl
@@ -0,0 +1,54 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/no-php.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/no-php.stpl
new file mode 100644
index 00000000..a0234ae3
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/no-php.stpl
@@ -0,0 +1,42 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/no-php.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..97d04599
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/no-php.tpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/owncloud.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/owncloud.stpl
new file mode 100644
index 00000000..8311ca43
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/owncloud.stpl
@@ -0,0 +1,80 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/owncloud.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/owncloud.tpl
new file mode 100644
index 00000000..57cac2f8
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/owncloud.tpl
@@ -0,0 +1,76 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/piwik.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/piwik.stpl
new file mode 100644
index 00000000..c53af401
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/piwik.stpl
@@ -0,0 +1,68 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/piwik.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/piwik.tpl
new file mode 100644
index 00000000..6b4a94a6
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/piwik.tpl
@@ -0,0 +1,64 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/pyrocms.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/pyrocms.stpl
new file mode 100644
index 00000000..a6fc6755
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/pyrocms.stpl
@@ -0,0 +1,61 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/pyrocms.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/pyrocms.tpl
new file mode 100644
index 00000000..68b378ef
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/pyrocms.tpl
@@ -0,0 +1,57 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress.stpl
new file mode 100644
index 00000000..910c28b6
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress2.stpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress2.stpl
new file mode 100644
index 00000000..2822f875
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress2.stpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress2.tpl b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress2.tpl
new file mode 100644
index 00000000..37b8be30
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/php5-fpm/wordpress2.tpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/14.10/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/14.10/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 00000000..ae195617
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/nginx/proxy_ip.tpl
@@ -0,0 +1,9 @@
+server {
+ listen %ip%:%proxy_port% default;
+ server_name _;
+ #access_log /var/log/nginx/%ip%.log main;
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ }
+}
+
diff --git a/install/ubuntu/14.10/templates/web/php5-fpm/default.tpl b/install/ubuntu/14.10/templates/web/php5-fpm/default.tpl
new file mode 100644
index 00000000..44ccf7a4
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/php5-fpm/default.tpl
@@ -0,0 +1,18 @@
+[%backend%]
+listen = 127.0.0.1:%backend_port%
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/14.10/templates/web/php5-fpm/no-php.tpl b/install/ubuntu/14.10/templates/web/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..89487d5f
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/php5-fpm/no-php.tpl
@@ -0,0 +1,13 @@
+#[%backend%]
+#user = %user%
+#group = %user%
+#listen = /dev/null
+
+#listen.owner = %user%
+#listen.group = nginx
+
+#pm = dynamic
+#pm.max_children = 50
+#pm.start_servers = 3
+#pm.min_spare_servers = 2
+#pm.max_spare_servers = 10
diff --git a/install/ubuntu/14.10/templates/web/php5-fpm/socket.tpl b/install/ubuntu/14.10/templates/web/php5-fpm/socket.tpl
new file mode 100644
index 00000000..f0513da3
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/php5-fpm/socket.tpl
@@ -0,0 +1,21 @@
+[%backend%]
+listen = /var/run/php5-%backend%.sock
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+listen.owner = %user%
+listen.group = nginx
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/14.10/templates/web/skel/document_errors/403.html b/install/ubuntu/14.10/templates/web/skel/document_errors/403.html
new file mode 100755
index 00000000..9c3f6baa
--- /dev/null
+++ b/install/ubuntu/14.10/templates/web/skel/document_errors/403.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ %domain%
+ %domain%
+ SUSPEND
+ This site has been suspended
+
{locality} {zipcode}
{country} {region}';
+
+// Matching mode for addressbook search (including autocompletion)
+// 0 - partial (*abc*), default
+// 1 - strict (abc)
+// 2 - prefix (abc*)
+// Note: For LDAP sources fuzzy_search must be enabled to use 'partial' or 'prefix' mode
+$rcmail_config['addressbook_search_mode'] = 0;
+
+// ----------------------------------
+// USER PREFERENCES
+// ----------------------------------
+
+// Use this charset as fallback for message decoding
+//$rcmail_config['default_charset'] = 'ISO-8859-1';
+$rcmail_config['default_charset'] = 'UTF-8';
+
+// skin name: folder from skins/
+$rcmail_config['skin'] = 'larry';
+
+// show up to X items in messages list view
+$rcmail_config['mail_pagesize'] = 50;
+
+// show up to X items in contacts list view
+$rcmail_config['addressbook_pagesize'] = 50;
+
+// sort contacts by this col (preferably either one of name, firstname, surname)
+$rcmail_config['addressbook_sort_col'] = 'surname';
+
+// the way how contact names are displayed in the list
+// 0: display name
+// 1: (prefix) firstname middlename surname (suffix)
+// 2: (prefix) surname firstname middlename (suffix)
+// 3: (prefix) surname, firstname middlename (suffix)
+$rcmail_config['addressbook_name_listing'] = 0;
+
+// use this timezone to display date/time
+// valid timezone identifers are listed here: php.net/manual/en/timezones.php
+// 'auto' will use the browser's timezone settings
+$rcmail_config['timezone'] = 'auto';
+
+// prefer displaying HTML messages
+$rcmail_config['prefer_html'] = true;
+
+// display remote inline images
+// 0 - Never, always ask
+// 1 - Ask if sender is not in address book
+// 2 - Always show inline images
+$rcmail_config['show_images'] = 0;
+
+// compose html formatted messages by default
+// 0 - never, 1 - always, 2 - on reply to HTML message only
+$rcmail_config['htmleditor'] = 0;
+
+// show pretty dates as standard
+$rcmail_config['prettydate'] = true;
+
+// save compose message every 300 seconds (5min)
+$rcmail_config['draft_autosave'] = 300;
+
+// default setting if preview pane is enabled
+$rcmail_config['preview_pane'] = false;
+
+// Mark as read when viewed in preview pane (delay in seconds)
+// Set to -1 if messages in preview pane should not be marked as read
+$rcmail_config['preview_pane_mark_read'] = 0;
+
+// Clear Trash on logout
+$rcmail_config['logout_purge'] = false;
+
+// Compact INBOX on logout
+$rcmail_config['logout_expunge'] = false;
+
+// Display attached images below the message body
+$rcmail_config['inline_images'] = true;
+
+// Encoding of long/non-ascii attachment names:
+// 0 - Full RFC 2231 compatible
+// 1 - RFC 2047 for 'name' and RFC 2231 for 'filename' parameter (Thunderbird's default)
+// 2 - Full 2047 compatible
+$rcmail_config['mime_param_folding'] = 1;
+
+// Set true if deleted messages should not be displayed
+// This will make the application run slower
+$rcmail_config['skip_deleted'] = false;
+
+// Set true to Mark deleted messages as read as well as deleted
+// False means that a message's read status is not affected by marking it as deleted
+$rcmail_config['read_when_deleted'] = true;
+
+// Set to true to never delete messages immediately
+// Use 'Purge' to remove messages marked as deleted
+$rcmail_config['flag_for_deletion'] = false;
+
+// Default interval for keep-alive/check-recent requests (in seconds)
+// Must be greater than or equal to 'min_keep_alive' and less than 'session_lifetime'
+$rcmail_config['keep_alive'] = 60;
+
+// If true all folders will be checked for recent messages
+$rcmail_config['check_all_folders'] = false;
+
+// If true, after message delete/move, the next message will be displayed
+$rcmail_config['display_next'] = false;
+
+// 0 - Do not expand threads
+// 1 - Expand all threads automatically
+// 2 - Expand only threads with unread messages
+$rcmail_config['autoexpand_threads'] = 0;
+
+// When replying place cursor above original message (top posting)
+$rcmail_config['top_posting'] = false;
+
+// When replying strip original signature from message
+$rcmail_config['strip_existing_sig'] = true;
+
+// Show signature:
+// 0 - Never
+// 1 - Always
+// 2 - New messages only
+// 3 - Forwards and Replies only
+$rcmail_config['show_sig'] = 1;
+
+// When replying or forwarding place sender's signature above existing message
+$rcmail_config['sig_above'] = false;
+
+// Use MIME encoding (quoted-printable) for 8bit characters in message body
+$rcmail_config['force_7bit'] = false;
+
+// Defaults of the search field configuration.
+// The array can contain a per-folder list of header fields which should be considered when searching
+// The entry with key '*' stands for all folders which do not have a specific list set.
+// Please note that folder names should to be in sync with $rcmail_config['default_folders']
+$rcmail_config['search_mods'] = null; // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1));
+
+// Defaults of the addressbook search field configuration.
+$rcmail_config['addressbook_search_mods'] = null; // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1);
+
+// 'Delete always'
+// This setting reflects if mail should be always deleted
+// when moving to Trash fails. This is necessary in some setups
+// when user is over quota and Trash is included in the quota.
+$rcmail_config['delete_always'] = false;
+
+// Directly delete messages in Junk instead of moving to Trash
+$rcmail_config['delete_junk'] = true;
+
+// Behavior if a received message requests a message delivery notification (read receipt)
+// 0 = ask the user, 1 = send automatically, 2 = ignore (never send or ask)
+// 3 = send automatically if sender is in addressbook, otherwise ask the user
+// 4 = send automatically if sender is in addressbook, otherwise ignore
+$rcmail_config['mdn_requests'] = 0;
+
+// Return receipt checkbox default state
+$rcmail_config['mdn_default'] = 0;
+
+// Delivery Status Notification checkbox default state
+$rcmail_config['dsn_default'] = 0;
+
+// Place replies in the folder of the message being replied to
+$rcmail_config['reply_same_folder'] = false;
+
+// Sets default mode of Forward feature to "forward as attachment"
+$rcmail_config['forward_attachment'] = false;
+
+// Defines address book (internal index) to which new contacts will be added
+// By default it is the first writeable addressbook.
+// Note: Use '0' for built-in address book.
+$rcmail_config['default_addressbook'] = null;
+
+// Enables spell checking before sending a message.
+$rcmail_config['spellcheck_before_send'] = false;
+
+// Skip alternative email addresses in autocompletion (show one address per contact)
+$rcmail_config['autocomplete_single'] = false;
+
+// Default font for composed HTML message.
+// Supported values: Andale Mono, Arial, Arial Black, Book Antiqua, Courier New,
+// Georgia, Helvetica, Impact, Tahoma, Terminal, Times New Roman, Trebuchet MS, Verdana
+$rcmail_config['default_font'] = '';
+
+// end of config file
diff --git a/install/ubuntu/15.04/roundcube/vesta.php b/install/ubuntu/15.04/roundcube/vesta.php
new file mode 100644
index 00000000..8fb202a4
--- /dev/null
+++ b/install/ubuntu/15.04/roundcube/vesta.php
@@ -0,0 +1,62 @@
+
+ */
+
+ function password_save($curpass, $passwd)
+ {
+ $rcmail = rcmail::get_instance();
+ $vesta_host = $rcmail->config->get('password_vesta_host');
+
+ if (empty($vesta_host))
+ {
+ $vesta_host = 'localhost';
+ }
+
+ $vesta_port = $rcmail->config->get('password_vesta_port');
+ if (empty($vesta_port))
+ {
+ $vesta_port = '8083';
+ }
+
+ $postvars = array(
+ 'email' => $_SESSION['username'],
+ 'password' => $curpass,
+ 'new' => $passwd
+ );
+
+ $postdata = http_build_query($postvars);
+
+ $send = 'POST /reset/mail/ HTTP/1.1' . PHP_EOL;
+ $send .= 'Host: ' . $vesta_host . PHP_EOL;
+ $send .= 'User-Agent: PHP Script' . PHP_EOL;
+ $send .= 'Content-length: ' . strlen($postdata) . PHP_EOL;
+ $send .= 'Content-type: application/x-www-form-urlencoded' . PHP_EOL;
+ $send .= 'Connection: close' . PHP_EOL;
+ $send .= PHP_EOL;
+ $send .= $postdata . PHP_EOL . PHP_EOL;
+
+ $fp = fsockopen('ssl://' . $vesta_host, $vesta_port);
+ fputs($fp, $send);
+ $result = fread($fp, 2048);
+ fclose($fp);
+
+ $fp = fopen("/tmp/roundcube.log", 'w');
+ fwrite($fp, "test ok");
+ fwrite($fp, "\n");
+ fclose($fp);
+
+
+ if(strpos($result, 'ok') && !strpos($result, 'error'))
+ {
+ return PASSWORD_SUCCESS;
+ }
+ else {
+ return PASSWORD_ERROR;
+ }
+
+ }
diff --git a/install/ubuntu/15.04/sudo/admin b/install/ubuntu/15.04/sudo/admin
new file mode 100644
index 00000000..47e16098
--- /dev/null
+++ b/install/ubuntu/15.04/sudo/admin
@@ -0,0 +1,7 @@
+# Created by vesta installer
+Defaults env_keep="VESTA"
+Defaults:admin !syslog
+Defaults:admin !requiretty
+
+admin ALL=(ALL) ALL
+admin ALL=NOPASSWD:/usr/local/vesta/bin/*
diff --git a/install/ubuntu/15.04/templates.tar.gz b/install/ubuntu/15.04/templates.tar.gz
new file mode 100644
index 00000000..ce385d26
Binary files /dev/null and b/install/ubuntu/15.04/templates.tar.gz differ
diff --git a/install/ubuntu/15.04/templates/dns/child-ns.tpl b/install/ubuntu/15.04/templates/dns/child-ns.tpl
new file mode 100755
index 00000000..27f9b825
--- /dev/null
+++ b/install/ubuntu/15.04/templates/dns/child-ns.tpl
@@ -0,0 +1,11 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns1.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='ns2.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ns1' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='ns2' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/15.04/templates/dns/default.tpl b/install/ubuntu/15.04/templates/dns/default.tpl
new file mode 100755
index 00000000..942c15bc
--- /dev/null
+++ b/install/ubuntu/15.04/templates/dns/default.tpl
@@ -0,0 +1,15 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns3%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns4%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns5%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns6%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns7%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns8%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='mail' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='mail.%domain%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='15' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/15.04/templates/dns/gmail.tpl b/install/ubuntu/15.04/templates/dns/gmail.tpl
new file mode 100755
index 00000000..950cfa45
--- /dev/null
+++ b/install/ubuntu/15.04/templates/dns/gmail.tpl
@@ -0,0 +1,14 @@
+ID='1' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns1%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='2' RECORD='@' TYPE='NS' PRIORITY='' VALUE='%ns2%.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='3' RECORD='@' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='4' RECORD='ftp' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='5' RECORD='localhost' TYPE='A' PRIORITY='' VALUE='127.0.0.1' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='6' RECORD='mail' TYPE='CNAME' PRIORITY='' VALUE='ghs.google.com.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='7' RECORD='pop' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='8' RECORD='www' TYPE='A' PRIORITY='' VALUE='%ip%' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='9' RECORD='@' TYPE='MX' PRIORITY='1' VALUE='ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='10' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT1.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='11' RECORD='@' TYPE='MX' PRIORITY='5' VALUE='ALT2.ASPMX.L.GOOGLE.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='12' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX2.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='13' RECORD='@' TYPE='MX' PRIORITY='10' VALUE='ASPMX3.GOOGLEMAIL.COM.' SUSPENDED='no' TIME='%time%' DATE='%date%'
+ID='14' RECORD='@' TYPE='TXT' PRIORITY='' VALUE='"v=spf1 a mx ip4:%ip% ?all"' SUSPENDED='no' TIME='%time%' DATE='%date%'
diff --git a/install/ubuntu/15.04/templates/web/apache2/basedir.stpl b/install/ubuntu/15.04/templates/web/apache2/basedir.stpl
new file mode 100755
index 00000000..3f71e699
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/apache2/basedir.stpl
@@ -0,0 +1,41 @@
+
+
+
+
diff --git a/install/ubuntu/15.04/templates/web/nginx/caching.sh b/install/ubuntu/15.04/templates/web/nginx/caching.sh
new file mode 100755
index 00000000..6eb9126d
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/caching.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+user=$1
+domain=$2
+ip=$3
+home=$4
+docroot=$5
+
+str="proxy_cache_path /var/cache/nginx/$domain levels=2"
+str="$str keys_zone=$domain:10m inactive=60m max_size=512m;"
+echo "$str" >> /etc/nginx/conf.d/01_caching_pool.conf
+
diff --git a/install/ubuntu/15.04/templates/web/nginx/caching.stpl b/install/ubuntu/15.04/templates/web/nginx/caching.stpl
new file mode 100755
index 00000000..ca6cffe3
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/caching.stpl
@@ -0,0 +1,44 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/caching.tpl b/install/ubuntu/15.04/templates/web/nginx/caching.tpl
new file mode 100755
index 00000000..36761b65
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/caching.tpl
@@ -0,0 +1,41 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+
+ proxy_cache cache;
+ proxy_cache_valid 15m;
+ proxy_cache_valid 404 1m;
+ proxy_no_cache $no_cache;
+ proxy_cache_bypass $no_cache;
+ proxy_cache_bypass $cookie_session $http_x_update;
+
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ proxy_cache off;
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/default.stpl b/install/ubuntu/15.04/templates/web/nginx/default.stpl
new file mode 100755
index 00000000..fa538060
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/default.stpl
@@ -0,0 +1,36 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/15.04/templates/web/nginx/default.tpl b/install/ubuntu/15.04/templates/web/nginx/default.tpl
new file mode 100755
index 00000000..4d5c774b
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/default.tpl
@@ -0,0 +1,33 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/15.04/templates/web/nginx/hosting.sh b/install/ubuntu/15.04/templates/web/nginx/hosting.sh
new file mode 100755
index 00000000..eeed37ef
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/hosting.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# Changing public_html permission
+user="$1"
+domain="$2"
+ip="$3"
+home_dir="$4"
+docroot="$5"
+
+chmod 755 $docroot
+
+exit 0
diff --git a/install/ubuntu/15.04/templates/web/nginx/hosting.stpl b/install/ubuntu/15.04/templates/web/nginx/hosting.stpl
new file mode 100755
index 00000000..d778d633
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/hosting.stpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%proxy_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %sdocroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass https://%ip%:%web_ssl_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/15.04/templates/web/nginx/hosting.tpl b/install/ubuntu/15.04/templates/web/nginx/hosting.tpl
new file mode 100755
index 00000000..15961c95
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/hosting.tpl
@@ -0,0 +1,35 @@
+server {
+ listen %ip%:%proxy_port%;
+ server_name %domain_idn% %alias_idn%;
+ error_log /var/log/%web_system%/domains/%domain%.error.log error;
+
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ location ~* ^.+\.(%proxy_extentions%)$ {
+ root %docroot%;
+ access_log /var/log/%web_system%/domains/%domain%.log combined;
+ access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
+ expires max;
+ try_files $uri @fallback;
+ }
+ }
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location @fallback {
+ proxy_pass http://%ip%:%web_port%;
+ }
+
+ location ~ /\.ht {return 404;}
+ location ~ /\.svn/ {return 404;}
+ location ~ /\.git/ {return 404;}
+ location ~ /\.hg/ {return 404;}
+ location ~ /\.bzr/ {return 404;}
+
+ disable_symlinks if_not_owner from=%docroot%;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
+
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl
new file mode 100644
index 00000000..01d82b60
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/cms_made_simple.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl
new file mode 100644
index 00000000..af452d19
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/cms_made_simple.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?page=$request_uri;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter2.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter2.stpl
new file mode 100644
index 00000000..a592a652
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter2.stpl
@@ -0,0 +1,56 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter2.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter2.tpl
new file mode 100644
index 00000000..9b955aa6
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter2.tpl
@@ -0,0 +1,52 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location = /index.php {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME /var/www/html/ci$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ~ \.php$ {
+ return 444;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter3.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter3.stpl
new file mode 100644
index 00000000..4d330d34
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter3.stpl
@@ -0,0 +1,51 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter3.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter3.tpl
new file mode 100644
index 00000000..1f446e5d
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/codeigniter3.tpl
@@ -0,0 +1,47 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/datalife_engine.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/datalife_engine.stpl
new file mode 100644
index 00000000..d1b5bcd2
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/datalife_engine.stpl
@@ -0,0 +1,122 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/datalife_engine.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/datalife_engine.tpl
new file mode 100644
index 00000000..ff33c232
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/datalife_engine.tpl
@@ -0,0 +1,118 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ rewrite "^/page/([0-9]+)(/?)$" /index.php?cstart=$1 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6&seourl=$6 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.*).html(/?)+$" /engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5&seourl=$5 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$" /index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4&seourl=$4 last;
+
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$4&news_page=$2&cstart=$3&seourl=$5&seocat=$1 last;
+ rewrite "^/([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$2&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$2&newsid=$3&seourl=$4&seocat=$1 last;
+ rewrite "^/([^.]+)/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&seourl=$3&seocat=$1 last;
+
+ rewrite "^/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$3&news_page=$1&cstart=$2&seourl=$4 last;
+ rewrite "^/page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$2&news_page=$1&seourl=$3 last;
+ rewrite "^/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$" /engine/print.php?news_page=$1&newsid=$2&seourl=$3 last;
+ rewrite "^/([0-9]+)-(.*).html(/?)+$" /index.php?newsid=$1&seourl=$2 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2&day=$3 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&day=$3&cstart=$4 last;
+
+ rewrite "^/([0-9]{4})/([0-9]{2})(/?)+$" /index.php?year=$1&month=$2 last;
+ rewrite "^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$" /index.php?year=$1&month=$2&cstart=$3 last;
+
+ rewrite "^/([0-9]{4})(/?)+$" /index.php?year=$1 last;
+ rewrite "^/([0-9]{4})/page/([0-9]+)(/?)+$" /index.php?year=$1&cstart=$2 last;
+
+ rewrite "^/tags/([^/]*)(/?)+$" /index.php?do=tags&tag=$1 last;
+ rewrite "^/tags/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=tags&tag=$1&cstart=$2 last;
+
+ rewrite "^/xfsearch/([^/]*)(/?)+$" /index.php?do=xfsearch&xf=$1 last;
+ rewrite "^/xfsearch/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=xfsearch&xf=$1&cstart=$2 last;
+
+ rewrite "^/user/([^/]*)/rss.xml$" /engine/rss.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)(/?)+$" /index.php?subaction=userinfo&user=$1 last;
+ rewrite "^/user/([^/]*)/page/([0-9]+)(/?)+$" /index.php?subaction=userinfo&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news(/?)+$" /index.php?subaction=allnews&user=$1 last;
+ rewrite "^/user/([^/]*)/news/page/([0-9]+)(/?)+$" /index.php?subaction=allnews&user=$1&cstart=$2 last;
+ rewrite "^/user/([^/]*)/news/rss.xml(/?)+$" /engine/rss.php?subaction=allnews&user=$1 last;
+
+ rewrite "^/lastnews(/?)+$" /index.php?do=lastnews last;
+ rewrite "^/lastnews/page/([0-9]+)(/?)+$" /index.php?do=lastnews&cstart=$1 last;
+
+ rewrite "^/catalog/([^/]*)/rss.xml$" /engine/rss.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)(/?)+$" /index.php?catalog=$1 last;
+ rewrite "^/catalog/([^/]*)/page/([0-9]+)(/?)+$" /index.php?catalog=$1&cstart=$2 last;
+
+ rewrite "^/newposts(/?)+$" /index.php?subaction=newposts last;
+ rewrite "^/newposts/page/([0-9]+)(/?)+$" /index.php?subaction=newposts&cstart=$1 last;
+
+ rewrite "^/favorites(/?)+$" /index.php?do=favorites last;
+ rewrite "^/favorites/page/([0-9]+)(/?)+$" /index.php?do=favorites&cstart=$1 last;
+
+ rewrite "^/rules.html$" /index.php?do=rules last;
+ rewrite "^/statistics.html$" /index.php?do=stats last;
+ rewrite "^/addnews.html$" /index.php?do=addnews last;
+ rewrite "^/rss.xml$" /engine/rss.php last;
+ rewrite "^/sitemap.xml$" /uploads/sitemap.xml last;
+
+ if (!-d $request_filename) {
+ rewrite "^/([^.]+)/page/([0-9]+)(/?)+$" /index.php?do=cat&category=$1&cstart=$2 last;
+ rewrite "^/([^.]+)/?$" /index.php?do=cat&category=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^.]+)/rss.xml$" /engine/rss.php?do=cat&category=$1 last;
+ rewrite "^/page,([0-9]+),([^/]+).html$" /index.php?do=static&page=$2&news_page=$1 last;
+ rewrite "^/print:([^/]+).html$" /engine/print.php?do=static&page=$1 last;
+ }
+
+ if (!-f $request_filename) {
+ rewrite "^/([^/]+).html$" /index.php?do=static&page=$1 last;
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/default.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/default.stpl
new file mode 100644
index 00000000..a68c9986
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/default.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/default.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/default.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/default.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.stpl
new file mode 100644
index 00000000..27483cd8
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.stpl
@@ -0,0 +1,67 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.tpl
new file mode 100644
index 00000000..31647c9f
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/dokuwiki.tpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ index doku.php;
+ try_files $uri $uri/ @dokuwiki;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location ^~ /lib/ {
+ expires 30d;
+ }
+
+ location ^~ /conf/ { return 403; }
+ location ^~ /data/ { return 403; }
+ location @dokuwiki {
+ rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last;
+ rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last;
+ rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last;
+ rewrite ^/(.*) /doku.php?id=$1 last;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/drupal.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/drupal.stpl
new file mode 100644
index 00000000..9a548439
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/drupal.stpl
@@ -0,0 +1,101 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/drupal.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/drupal.tpl
new file mode 100644
index 00000000..417762c1
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/drupal.tpl
@@ -0,0 +1,98 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ # Very rarely should these ever be accessed outside of your lan
+ location ~* \.(txt|log)$ {
+ allow 192.168.0.0/16;
+ deny all;
+ }
+
+ location ~ \..*/.*\.php$ {
+ return 403;
+ }
+
+ # No no for private
+ location ~ ^/sites/.*/private/ {
+ return 403;
+ }
+
+ # Block access to "hidden" files and directories whose names begin with a
+ # period. This includes directories used by version control systems such
+ # as Subversion or Git to store control files.
+ location ~ (^|/)\. {
+ return 403;
+ }
+
+ location / {
+ try_files $uri @rewrite;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $request_filename;
+ fastcgi_intercept_errors on;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location @rewrite {
+ # You have 2 options here
+ # For D7 and above:
+ # Clean URLs are handled in drupal_environment_initialize().
+ rewrite ^ /index.php;
+
+ # For Drupal 6 and bwlow:
+ # Some modules enforce no slash (/) at the end of the URL
+ # Else this rewrite block wouldn't be needed (GlobalRedirect)
+ #rewrite ^/(.*)$ /index.php?q=$1;
+ }
+
+ location ~ ^/sites/.*/files/styles/ {
+ try_files $uri @rewrite;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/joomla.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/joomla.stpl
new file mode 100644
index 00000000..235a0121
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/joomla.stpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/joomla.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/joomla.tpl
new file mode 100644
index 00000000..997c268d
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/joomla.tpl
@@ -0,0 +1,54 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ # deny running scripts inside writable directories
+ location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
+ return 403;
+ error_page 403 /403_error.html;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/no-php.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/no-php.stpl
new file mode 100644
index 00000000..a0234ae3
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/no-php.stpl
@@ -0,0 +1,42 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %sdocroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/snginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/no-php.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..97d04599
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/no-php.tpl
@@ -0,0 +1,38 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ types {
+ text/html html htm shtml php php5;
+ }
+
+ location / {
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/owncloud.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/owncloud.stpl
new file mode 100644
index 00000000..8311ca43
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/owncloud.stpl
@@ -0,0 +1,80 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/owncloud.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/owncloud.tpl
new file mode 100644
index 00000000..57cac2f8
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/owncloud.tpl
@@ -0,0 +1,76 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ rewrite ^/caldav(.*)$ /remote.php/caldav$1 redirect;
+ rewrite ^/carddav(.*)$ /remote.php/carddav$1 redirect;
+ rewrite ^/webdav(.*)$ /remote.php/webdav$1 redirect;
+
+ error_page 403 = /core/templates/403.php;
+ error_page 404 = /core/templates/404.php;
+
+ location ~ ^/(?:\.htaccess|data|config|db_structure\.xml|README){
+ deny all;
+ }
+
+ location / {
+ # The following 2 rules are only needed with webfinger
+ rewrite ^/.well-known/host-meta /public.php?service=host-meta last;
+ rewrite ^/.well-known/host-meta.json /public.php?service=host-meta-json last;
+ rewrite ^/.well-known/carddav /remote.php/carddav/ redirect;
+ rewrite ^/.well-known/caldav /remote.php/caldav/ redirect;
+ rewrite ^(/core/doc/[^\/]+/)$ $1/index.html;
+ try_files $uri $uri/ /index.php;
+
+ location ~ \.php(?:$|/) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ #fastcgi_param HTTPS on;
+ fastcgi_pass %backend_lsnr%;
+ }
+ }
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ # Some basic cache-control for static files to be sent to the browser
+ add_header Pragma public;
+ add_header Cache-Control "public, must-revalidate, proxy-revalidate";
+ }
+
+ #error_page 403 /error/404.html;
+ #error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/piwik.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/piwik.stpl
new file mode 100644
index 00000000..c53af401
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/piwik.stpl
@@ -0,0 +1,68 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/piwik.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/piwik.tpl
new file mode 100644
index 00000000..6b4a94a6
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/piwik.tpl
@@ -0,0 +1,64 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ try_files /favicon.ico =204;
+ }
+
+ location / {
+ try_files $uri /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ valid_referers none blocked %domain_idn% %alias_idn%;
+ if ($invalid_referer) {
+ return 444;
+ }
+ expires max;
+ }
+
+ location ~* ^/(?:index|piwik)\.php$ {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ # Any other attempt to access PHP files returns a 404.
+ location ~* ^.+\.php$ {
+ return 404;
+ }
+
+ # Return a 404 for all text files.
+ location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
+ return 404;
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/pyrocms.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/pyrocms.stpl
new file mode 100644
index 00000000..a6fc6755
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/pyrocms.stpl
@@ -0,0 +1,61 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/pyrocms.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/pyrocms.tpl
new file mode 100644
index 00000000..68b378ef
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/pyrocms.tpl
@@ -0,0 +1,57 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location /installer {
+ try_files $uri $uri/ /installer/index.php;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ location = /robots.txt { access_log off; log_not_found off; }
+ location = /favicon.ico { access_log off; log_not_found off; }
+ location ~ /\. { access_log off; log_not_found off; deny all; }
+ location ~ ~$ { access_log off; log_not_found off; deny all; }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress.stpl
new file mode 100644
index 00000000..910c28b6
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress.stpl
@@ -0,0 +1,50 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress.tpl
new file mode 100644
index 00000000..b143e53b
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress.tpl
@@ -0,0 +1,46 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location / {
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress2.stpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress2.stpl
new file mode 100644
index 00000000..2822f875
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress2.stpl
@@ -0,0 +1,62 @@
+server {
+ listen %ip%:%web_ssl_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ ssl on;
+ ssl_certificate %ssl_pem%;
+ ssl_certificate_key %ssl_key%;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress2.tpl b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress2.tpl
new file mode 100644
index 00000000..37b8be30
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/php5-fpm/wordpress2.tpl
@@ -0,0 +1,58 @@
+server {
+ listen %ip%:%web_port%;
+ server_name %domain_idn% %alias_idn%;
+ root %docroot%;
+ index index.php index.html index.htm;
+ access_log /var/log/nginx/domains/%domain%.log combined;
+ access_log /var/log/nginx/domains/%domain%.bytes bytes;
+ error_log /var/log/nginx/domains/%domain%.error.log error;
+
+ location = /favicon.ico {
+ log_not_found off;
+ access_log off;
+ }
+
+ location = /robots.txt {
+ allow all;
+ log_not_found off;
+ access_log off;
+ }
+
+ location / {
+ try_files $uri $uri/ /index.php?$args;
+
+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
+ expires max;
+ }
+
+ location ~ [^/]\.php(/|$) {
+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+ if (!-f $document_root$fastcgi_script_name) {
+ return 404;
+ }
+
+ fastcgi_pass %backend_lsnr%;
+ fastcgi_index index.php;
+ include /etc/nginx/fastcgi_params;
+ }
+ }
+
+ error_page 403 /error/404.html;
+ error_page 404 /error/404.html;
+ error_page 500 502 503 504 /error/50x.html;
+
+ location /error/ {
+ alias %home%/%user%/web/%domain%/document_errors/;
+ }
+
+ location ~* "/\.(htaccess|htpasswd)$" {
+ deny all;
+ return 404;
+ }
+
+ include /etc/nginx/conf.d/phpmyadmin.inc*;
+ include /etc/nginx/conf.d/phppgadmin.inc*;
+ include /etc/nginx/conf.d/webmail.inc*;
+
+ include %home%/%user%/conf/web/nginx.%domain%.conf*;
+}
diff --git a/install/ubuntu/15.04/templates/web/nginx/proxy_ip.tpl b/install/ubuntu/15.04/templates/web/nginx/proxy_ip.tpl
new file mode 100755
index 00000000..ae195617
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/nginx/proxy_ip.tpl
@@ -0,0 +1,9 @@
+server {
+ listen %ip%:%proxy_port% default;
+ server_name _;
+ #access_log /var/log/nginx/%ip%.log main;
+ location / {
+ proxy_pass http://%ip%:%web_port%;
+ }
+}
+
diff --git a/install/ubuntu/15.04/templates/web/php5-fpm/default.tpl b/install/ubuntu/15.04/templates/web/php5-fpm/default.tpl
new file mode 100644
index 00000000..44ccf7a4
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/php5-fpm/default.tpl
@@ -0,0 +1,18 @@
+[%backend%]
+listen = 127.0.0.1:%backend_port%
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/15.04/templates/web/php5-fpm/no-php.tpl b/install/ubuntu/15.04/templates/web/php5-fpm/no-php.tpl
new file mode 100644
index 00000000..89487d5f
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/php5-fpm/no-php.tpl
@@ -0,0 +1,13 @@
+#[%backend%]
+#user = %user%
+#group = %user%
+#listen = /dev/null
+
+#listen.owner = %user%
+#listen.group = nginx
+
+#pm = dynamic
+#pm.max_children = 50
+#pm.start_servers = 3
+#pm.min_spare_servers = 2
+#pm.max_spare_servers = 10
diff --git a/install/ubuntu/15.04/templates/web/php5-fpm/socket.tpl b/install/ubuntu/15.04/templates/web/php5-fpm/socket.tpl
new file mode 100644
index 00000000..f0513da3
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/php5-fpm/socket.tpl
@@ -0,0 +1,21 @@
+[%backend%]
+listen = /var/run/php5-%backend%.sock
+listen.allowed_clients = 127.0.0.1
+
+user = %user%
+group = %user%
+
+listen.owner = %user%
+listen.group = nginx
+
+pm = dynamic
+pm.max_children = 50
+pm.start_servers = 3
+pm.min_spare_servers = 2
+pm.max_spare_servers = 10
+
+env[HOSTNAME] = $HOSTNAME
+env[PATH] = /usr/local/bin:/usr/bin:/bin
+env[TMP] = /tmp
+env[TMPDIR] = /tmp
+env[TEMP] = /tmp
diff --git a/install/ubuntu/15.04/templates/web/skel/document_errors/403.html b/install/ubuntu/15.04/templates/web/skel/document_errors/403.html
new file mode 100755
index 00000000..9c3f6baa
--- /dev/null
+++ b/install/ubuntu/15.04/templates/web/skel/document_errors/403.html
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+403
+ Forbidden
+ 404
+ Page Not Found
+ 500
+ Internal Server Error
+ %domain%
+ %domain%
+ SUSPEND
+ This site has been suspended
+