<commit_before>#!/bin/bash
set -e

if [[ $# != 2 ]]
then
		echo "Usage: "
		echo "	$0 userName fullURLToSite"
		exit 1
fi

userName=$1
FQDN=$2
configFile=/etc/nginx/sites-available/$FQDN

scriptDir="$(dirname $0)"
cd $scriptDir
# Read config file with paths to WP-installs and usernames
source ../conf

# Create configfolder+file
mkdir -p /var/log/nginx/$FQDN
touch $configFile

cat > $configFile << EOF
server {
	server_name $FQDN *.$FQDN;

	error_log /var/log/nginx/$FQDN/error.log;
	access_log /var/log/nginx/$FQDN/access.log;

	root $basePath/$userName/wordpress;
	index index.php index.html index.htm;
	client_max_body_size 50m;


	location = /favicon.ico {
		log_not_found off;
		access_log off;
	}

	# Allow robots to scan without flooding server
	location = /robots.txt {
		allow all;
		log_not_found off;
		access_log off;
	}

	# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
	# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
	location ~ /\. {
		deny all;
	}

	# Deny access to any files with a .php extension in the uploads directory
	# Works in sub-directory installs and also in multisite network
	location ~* /(?:uploads|files)/.*\.php$ {
		deny all;
	}
	# End og restrictions -----------------

	location ~ \.php$ {
		try_files \$uri =404;
		fastcgi_pass unix:/srv/$userName/socket/php-fpm.sock;
		fastcgi_index index.php;
		include fastcgi_params;
	}
}

EOF

# Activate site<commit_msg>Added support for Debian Jessie<commit_after>#!/bin/bash
set -e

if [[ $# != 2 ]]
then
		echo "Usage: "
		echo "	$0 userName fullURLToSite"
		exit 1
fi

userName=$1
FQDN=$2
configFile=/etc/nginx/sites-available/$FQDN

scriptDir="$(dirname $0)"
cd $scriptDir
# Read config file with paths to WP-installs and usernames
source ../conf

# Create configfolder+file
mkdir -p /var/log/nginx/$FQDN
touch $configFile

cat > $configFile << EOF
server {
	server_name $FQDN *.$FQDN;

	error_log /var/log/nginx/$FQDN/error.log;
	access_log /var/log/nginx/$FQDN/access.log;

	root $basePath/$userName/wordpress;
	index index.php index.html index.htm;
	client_max_body_size 50m;


	location = /favicon.ico {
		log_not_found off;
		access_log off;
	}

	# Allow robots to scan without flooding server
	location = /robots.txt {
		allow all;
		log_not_found off;
		access_log off;
	}

	# Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
	# Keep logging the requests to parse later (or to pass to firewall utilities such as fail2ban)
	location ~ /\. {
		deny all;
	}

	# Deny access to any files with a .php extension in the uploads directory
	# Works in sub-directory installs and also in multisite network
	location ~* /(?:uploads|files)/.*\.php$ {
		deny all;
	}
	# End og restrictions -----------------

	location ~ \.php$ {
		try_files \$uri =404;
		fastcgi_pass unix:/srv/$userName/socket/php-fpm.sock;
		fastcgi_index index.php;
		fastcgi_param	SCRIPT_FILENAME	$document_root/$fastcgi_script_name;
		include fastcgi_params;
	}
}

EOF

# Activate site
{'fraction_non_alphanumeric': 0.12463295269168026, 'fraction_numerical': 0.007830342577487765, 'mean_word_length': 3.502202643171806, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2925926', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1100, 'n_words': 316}