Atualizações.

This commit is contained in:
Weberson de Sousa Pimentel
2019-02-27 17:50:04 -03:00
parent 21f801f8c3
commit 082b034416
14 changed files with 436 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
[install]
language=en
install_mode=standard
hostname=server1.dwti.com.br
mysql_hostname=localhost
mysql_root_user=root
mysql_root_password=pass
mysql_database=dbispconfig
mysql_port=3306
mysql_charset=utf8
http_server=apache
ispconfig_port=8080
ispconfig_use_ssl=y
ispconfig_admin_password=admin
[ssl_cert]
ssl_cert_country=BR
ssl_cert_state=Goias
ssl_cert_locality=Porangatu
ssl_cert_organisation=DWTI
ssl_cert_organisation_unit=Departamento de TI
ssl_cert_common_name=server1.dwti.com.br
[expert]
mysql_ispconfig_user=admin
mysql_ispconfig_password=admin
join_multiserver_setup=n
mysql_master_hostname=localhost
mysql_master_root_user=root
mysql_master_root_password=pass
mysql_master_database=dbispconfig
configure_mail=y
configure_jailkit=y
configure_ftp=y
configure_dns=y
configure_apache=y
configure_nginx=y
configure_firewall=y
install_ispconfig_web_interface=y
[update]
do_backup=yes
mysql_root_password=ispconfig
mysql_master_hostname=localhost
mysql_master_root_user=root
mysql_master_root_password=pass
mysql_master_database=dbispconfig
reconfigure_permissions_in_master_database=no
reconfigure_services=yes
ispconfig_port=8080
create_new_ispconfig_ssl_cert=no
reconfigure_crontab=yes
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
SERVICE=${2/%.service/}
case "$1" in
restart)
/etc/init.d/$SERVICE restart
;;
stop)
/etc/init.d/$SERVICE stop
;;
status)
/etc/init.d/$SERVICE status
;;
start)
/etc/init.d/$SERVICE start
;;
*)
command systemctloriginal "$@"
exit 1
esac
+48
View File
@@ -0,0 +1,48 @@
# Those aliases do not work properly with several hosts on your apache server
# Uncomment them to use it or adapt them to your configuration
# Alias /roundcube /var/lib/roundcube
Alias /webmail /var/lib/roundcube
<Directory /var/lib/roundcube/>
Options +FollowSymLinks
# This is needed to parse /var/lib/roundcube/.htaccess. See its
# content before setting AllowOverride to None.
AllowOverride All
<IfVersion >= 2.3>
Require all granted
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
# Protecting basic directories:
<Directory /var/lib/roundcube/config>
Options -FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/lib/roundcube/temp>
Options -FollowSymLinks
AllowOverride None
<IfVersion >= 2.3>
Require all denied
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Deny from all
</IfVersion>
</Directory>
<Directory /var/lib/roundcube/logs>
Options -FollowSymLinks
AllowOverride None
<IfVersion >= 2.3>
Require all denied
</IfVersion>
<IfVersion < 2.3>
Order allow,deny
Deny from all
</IfVersion>
</Directory>
@@ -0,0 +1,48 @@
Alias /webmail /usr/share/squirrelmail
<Directory /usr/share/squirrelmail>
Options FollowSymLinks
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc Off
php_flag track_vars On
php_admin_flag allow_url_fopen Off
php_value include_path .
php_admin_value upload_tmp_dir /var/lib/squirrelmail/tmp
php_admin_value open_basedir /usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/etc/hostname:/etc/mailname
php_flag register_globals off
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
# access to configtest is limited by default to prevent information leak
<Files configtest.php>
order deny,allow
deny from all
allow from 127.0.0.1
</Files>
</Directory>
# users will prefer a simple URL like http://webmail.example.com
#<VirtualHost 1.2.3.4>
# DocumentRoot /usr/share/squirrelmail
# ServerName webmail.example.com
#</VirtualHost>
# redirect to https when available (thanks omen@descolada.dartmouth.edu)
#
# Note: There are multiple ways to do this, and which one is suitable for
# your site's configuration depends. Consult the apache documentation if
# you're unsure, as this example might not work everywhere.
#
#<IfModule mod_rewrite.c>
# <IfModule mod_ssl.c>
# <Location /squirrelmail>
# RewriteEngine on
# RewriteCond %{HTTPS} !^on$ [NC]
# RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
# </Location>
# </IfModule>
#</IfModule>
+6
View File
@@ -0,0 +1,6 @@
#MAILTO=root
#*/10 * * * * www-data [ -x /usr/share/awstats/tools/update.sh ] && /usr/share/awstats/tools/update.sh
# Generate static reports:
#10 03 * * * www-data [ -x /usr/share/awstats/tools/buildstatic.sh ] && /usr/share/awstats/tools/buildstatic.sh
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
if [ $SQL_BACKUP = 1 ]
then
MUSER=root
MPASS=pass
BACKUP=/var/backup/sql
NOW="$(date +"%d-%m-%Y_%H%M")"
OLD="$(date +"%d-%m-%Y" -d '-7 day')"
# create directory
mkdir -p "$BACKUP/sql/$NOW/"
# all databases
mysqldump -u $MUSER --password=$MPASS --all-databases --single-transaction > "$BACKUP/sql/$NOW/all_databases.sql"
# backup each base of the database
DBS="$(mysql -u $MUSER -p$MPASS -Bse 'show databases')"
for db in $DBS
do
mysqldump -u $MUSER --password=$MPASS $db --single-transaction > "$BACKUP/sql/$NOW/$db.sql"
done
# delete old sql
rm -r $BACKUP/sql/$OLD*
fi
@@ -0,0 +1,3 @@
[Definition]
failregex = (?: pop3-login|imap-login): .*(?:Authentication failure|Aborted login \(auth failed|Aborted login \(tried to use disabled|Disconnected \(auth failed|Aborted login \(\d+ authentication attempts).*rip=(?P<host>\S*),.*
ignoreregex =
+3
View File
@@ -0,0 +1,3 @@
[Definition]
failregex = .*pure-ftpd: \(.*@<HOST>\) \[WARNING\] Authentication failed for user.*
ignoreregex =
+19
View File
@@ -0,0 +1,19 @@
[pure-ftpd]
enabled = true
port = ftp
filter = pure-ftpd
logpath = /var/log/syslog
maxretry = 3
[dovecot]
enabled = true
filter = dovecot
logpath = /var/log/mail.log
maxretry = 5
[postfix-sasl]
enabled = true
port = smtp
filter = postfix-sasl
logpath = /var/log/mail.log
maxretry = 3
+11
View File
@@ -0,0 +1,11 @@
[client]
host = localhost
user = root
password = pass
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = root
password = pass
socket = /var/run/mysqld/mysqld.sock
basedir = /usr
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
/usr/bin/clamdscan --remove --quiet --no-summary "$1"
+85
View File
@@ -0,0 +1,85 @@
<?php
/*
+-----------------------------------------------------------------------+
| Local configuration for the Roundcube Webmail installation. |
| |
| This is a sample configuration file only containing the minimum |
| setup required for a functional installation. Copy more options |
| from defaults.inc.php to this file to override the defaults. |
| |
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2013, The Roundcube Dev Team |
| |
| Licensed under the GNU General Public License version 3 or |
| any later version with exceptions for skins & plugins. |
| See the README file for a full license statement. |
+-----------------------------------------------------------------------+
*/
$config = array();
/* Do not set db_dsnw here, use dpkg-reconfigure roundcube-core to configure database ! */
include_once("/etc/roundcube/debian-db-roundcube.php");
// The mail host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
$config['default_host'] = 'localhost';
// SMTP server host (for sending mails).
// To use SSL/TLS connection, enter hostname with prefix ssl:// or tls://
// If left blank, the PHP mail() function is used
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['smtp_server'] = 'localhost';
// SMTP port (default is 25; use 587 for STARTTLS or 465 for the
// deprecated SSL over SMTP (aka SMTPS))
$config['smtp_port'] = 25;
// SMTP username (if required) if you use %u as the username Roundcube
// will use the current username for login
$config['smtp_user'] = '';
// SMTP password (if required) if you use %p as the password Roundcube
// will use the current user's password for login
$config['smtp_pass'] = '';
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';
// Name your service. This is displayed on the login screen and in the window title
$config['product_name'] = 'Roundcube Webmail';
// this key is used to encrypt the users imap password which is stored
// in the session record (and the client cookie if remember password is enabled).
// please provide a string of exactly 24 chars.
// YOUR KEY MUST BE DIFFERENT THAN THE SAMPLE VALUE FOR SECURITY REASONS
$config['des_key'] = '9Pisv22vwSXoEICSsaB8xn6E';
// List of active plugins (in plugins/ directory)
// Debian: install roundcube-plugins first to have any
$config['plugins'] = array(
);
// skin name: folder from skins/
$config['skin'] = 'larry';
// Disable spellchecking
// Debian: spellshecking needs additional packages to be installed, or calling external APIs
// see defaults.inc.php for additional informations
$config['enable_spellcheck'] = false;
+40
View File
@@ -0,0 +1,40 @@
#!/bin/bash
# DOCKERPASS=$(openssl rand -base64 32)
# sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
if [ ! -z "$DEFAULT_EMAIL_HOST" ]; then
sed -i "s/^\(DEFAULT_EMAIL_HOST\) = .*$/\1 = '$MAILMAN_EMAIL_HOST'/g" /etc/mailman/mm_cfg.py
newlist -q mailman $(MAILMAN_EMAIL) $(MAILMAN_PASS)
newaliases
fi
if [ ! -z "$LANGUAGE" ]; then
sed -i "s/^language=en$/language=$LANGUAGE/g" /tmp/ispconfig3_install/install/autoinstall.ini
fi
if [ ! -z "$COUNTRY" ]; then
sed -i "s/^ssl_cert_country=AU$/ssl_cert_country=$COUNTRY/g" /tmp/ispconfig3_install/install/autoinstall.ini
fi
if [ ! -z "$HOSTNAME" ]; then
sed -i "s/^hostname=server1.example.com$/hostname=$HOSTNAME/g" /tmp/ispconfig3_install/install/autoinstall.ini
fi
if [ ! -f /usr/local/ispconfig/interface/lib/config.inc.php ]; then
mysql_install_db
service mysql start \
&& echo "UPDATE mysql.user SET Password = PASSWORD('pass') WHERE User = 'root';" | mysql -u root \
&& echo "UPDATE mysql.user SET plugin='mysql_native_password' where user='root';" | mysql -u root \
&& echo "DELETE FROM mysql.user WHERE User='';" | mysql -u root \
&& echo "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1');" | mysql -u root \
&& echo "DROP DATABASE IF EXISTS test;" | mysql -u root \
&& echo "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%';" | mysql -u root \
&& echo "FLUSH PRIVILEGES;" | mysql -u root
sed -i "s/^hostname=server1.example.com$/hostname=$HOSTNAME/g" /root/ispconfig3_install/install/autoinstall.ini
# RUN mysqladmin -u root password pass
service mysql start && php -q /tmp/ispconfig3_install/install/install.php --autoinstall=/tmp/ispconfig3_install/install/autoinstall.ini
mkdir /var/www/html
echo "" > /var/www/html/index.html
rm -r /root/ispconfig3_install
fi
service mysql start && php -q /tmp/ispconfig3_install/install/install.php --autoinstall=/tmp/ispconfig3_install/install/autoinstall.ini
screenfetch
/usr/bin/supervisord -c /etc/supervisor/supervisord.conf
+78
View File
@@ -0,0 +1,78 @@
[supervisorctl]
serverurl = unix:///tmp/supervisor.sock
[supervisord]
logfile=/var/log/supervisor/supervisor.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=true ; (start in foreground if true;default false)
minfds=1024 ; number of startup file descriptors
minprocs=200 ; number of process descriptors
user=root ; default user
childlogdir=/var/log/supervisor/ ; where child log files will live
;umask=022 ; (process file creation umask;default 022)
;identifier=supervisor ; (supervisord identifier, default is 'supervisor')
;directory=/tmp ; (default is not to cd during start)
;nocleanup=true ; (don't clean up tempfiles at start;default false)
;childlogdir=/tmp ; ('AUTO' child log dir, default $TEMP)
;environment=KEY=value ; (key value pairs to add to environment)
;strip_ansi=false ; (strip ansi escape codes in logs; default false)
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
[program:sshd]
command=/usr/sbin/sshd -D
autorestart=true
[program:mysql]
command=/usr/bin/pidproxy /var/run/mysqld/mysqld.pid /usr/sbin/mysqld
autorestart=true
[program:postfix]
process_name = master
directory = /etc/postfix
command = /usr/sbin/postfix -c /etc/postfix start
startsecs = 0
autorestart = false
[program:rsyslogd]
command=/usr/sbin/rsyslogd -n
process_name=%(program_name)s
autostart=true
autorestart=true
user=root
directory=/
priority=912
stdout_logfile=/var/log/%(program_name)s-stdout.log
stderr_logfile=/var/log/%(program_name)s-stderr.log
[program:cron]
command = /usr/sbin/cron -f
stdout_logfile = /var/log/%(program_name)s-stdout.log
stderr_logfile = /var/log/%(program_name)s-stderr.log
autorestart = true
[program:bind9]
command=/usr/sbin/named -c /etc/bind/named.conf -u bind -f
[program:apache2]
command=/bin/bash -c "source /etc/apache2/envvars && rm -f -r /run/apache2/* && exec /usr/sbin/apache2 -DFOREGROUND"
[program:fail2ban]
command = /usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock
[program:dovecot]
command=/usr/sbin/dovecot -c /etc/dovecot/dovecot.conf -F
autorestart=true
[program:mailman]
command=/usr/lib/mailman/bin/mailmanctl start
autorestart=true
[program:pureftpd]
command=/usr/sbin/pure-ftpd-mysql-virtualchroot -p 30000:30009 -l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -D -A -H -b -8 UTF-8 -E -u 1000 -O clf:/var/log/pure-ftpd/transfer.log
stdout_logfile=/var/log/ftpserver.log
stderr_logfile=/var/log/ftpserver.log
autorestart=true