Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wtlinux_server_setup
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
w4t
wtlinux_server_setup
Commits
dee0c34f
Commit
dee0c34f
authored
Mar 15, 2025
by
w4t
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wtserver 0.54
parent
1616e0c7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
78 deletions
+101
-78
TO-DO.md
TO-DO.md
+10
-0
install_antivirus.sh
distros/debian12/install_antivirus.sh
+4
-5
install_mta.sh
distros/debian12/install_mta.sh
+85
-71
install_mysql.sh
distros/debian12/install_mysql.sh
+2
-2
No files found.
TO-DO.md
View file @
dee0c34f
...
...
@@ -13,3 +13,13 @@ My to-do list for the ispconfig3 installer script.
Suggestions? feel free to comment.
sok hozzáférési hiba...
doveadm fts rescan -A >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
# Adds unindexed files to the fts database
#
#
*
`-q`
: Queues the indexing to be run by indexer process. (will background the indexing)
#
*
`-A`
: All users
#
* `'*
'
`
: All folders
doveadm index -A -q
\*
>> $PROGRAMS_INSTALL_LOG_FILES 2>&1
distros/debian12/install_antivirus.sh
View file @
dee0c34f
...
...
@@ -28,10 +28,9 @@ InstallAntiVirus() {
if
[[
"
$(
which named
)
"
==
""
]]
;
then
apt_install unbound
fi
CODENAME
=
`
lsb_release
-c
-s
`
curl https://rspamd.com/apt-stable/gpg.key | apt-key add -
echo
"deb [arch=amd64] http://rspamd.com/apt-stable/
$CODENAME
main"
>
/etc/apt/sources.list.d/rspamd.list
echo
"deb-src [arch=amd64] http://rspamd.com/apt-stable/
$CODENAME
main"
>>
/etc/apt/sources.list.d/rspamd.list
curl https://rspamd.com/apt-stable/gpg.key | gpg
--dearmor
>
/etc/apt/trusted.gpg.d/rspamd.gpg
echo
"deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rspamd.gpg] http://rspamd.com/apt-stable/
$(
lsb_release
-cs
)
main"
>
/etc/apt/sources.list.d/rspamd.list
echo
"deb-src [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rspamd.gpg] http://rspamd.com/apt-stable/
$(
lsb_release
-cs
)
main"
>>
/etc/apt/sources.list.d/rspamd.list
apt_update
apt_install rspamd
echo
'servers = "127.0.0.1";'
>
/etc/rspamd/local.d/redis.conf
...
...
@@ -46,7 +45,7 @@ InstallAntiVirus() {
fi
echo
-n
-e
"
$IDENTATION_LVL_1
Installing AntiVirus utilities (ClamAV) (This take some time. Don't abort it!)..."
apt_install clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full lrzip apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libclam
unrar9
libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl libdbd-mysql-perl unrar-free unp lz4 liblz4-tool rpm2cpio tnef unp
apt_install clamav clamav-daemon unzip bzip2 arj nomarch lzop cabextract p7zip p7zip-full lrzip apt-listchanges libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon libclam
unrar11
libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip libnet-dns-perl libdbd-mysql-perl unrar-free unp lz4 liblz4-tool rpm2cpio tnef unp
echo
-e
" [
${
green
}
DONE
${
NC
}
] "
echo
-n
-e
"
$IDENTATION_LVL_1
Configure AntiVirus ... "
...
...
distros/debian12/install_mta.sh
View file @
dee0c34f
...
...
@@ -375,6 +375,84 @@ EOF
# internally. Solr uses too much memory. Same goes for elasticsearch.
# fts xapian might be a good match. See https://github.com/grosjo/fts-xapian
# Install and configure fts-xapian for better search performance
#Not work
#Installdovecot-fts-xapian
### Additional modifications
# Add additional packages
apt_install pflogsumm rkhunter
# Cleanup old spam and trash email
hide_output
install
-m
755
$APWD
/conf/cron/miab_clean_mail /etc/cron.weekly/
# Reduce logs by not logging mail output in syslog
#sed -i "s/\*\.\*;auth,authpriv.none.*\-\/var\/log\/syslog/\*\.\*;mail,auth,authpriv.none \-\/var\/log\/syslog/g" /etc/rsyslog.d/50-default.conf
# Reduce logs by only logging ufw in ufw.log
sed
-i
"s/#
\&
stop/
\&
stop/g"
/etc/rsyslog.d/20-ufw.conf
restart_service rsyslog
# Create forward for root emails
cat
>
/root/.forward
<<
EOF
;
administrator@
$CFG_HOSTNAME_DOMAIN
EOF
# Adapt rkhunter cron job to reduce log file production
sed
-i
"s/--cronjob --report-warnings-only --appendlog/--cronjob --report-warnings-only --no-verbose-logging --appendlog/g"
/etc/cron.daily/rkhunter
# Install fake mail script
if
[
!
-f
/usr/local/bin/mail
]
;
then
hide_output
install
-m
755
$APWD
/tools/fake_mail /usr/local/bin
mv
-f
/usr/local/bin/fake_mail /usr/local/bin/mail
fi
sed
-i
's/^UPDATE_MIRRORS=0/UPDATE_MIRRORS=1/'
/etc/rkhunter.conf
sed
-i
's/^MIRRORS_MODE=1/MIRRORS_MODE=0/'
/etc/rkhunter.conf
sed
-i
's|^WEB_CMD="/bin/false"|WEB_CMD=""|'
/etc/rkhunter.conf
sed
-i
's/^#APPEND_LOG=0/APPEND_LOG=1/'
/etc/rkhunter.conf
sed
-i
's|^#ALLOWHIDDENDIR=/etc/.java|ALLOWHIDDENDIR=/etc/.java|'
/etc/rkhunter.conf
# Check presence of whitelist
if
!
grep
-Fxq
"SCRIPTWHITELIST=/usr/local/bin/mail"
/etc/rkhunter.conf
>
/dev/null
;
then
echo
"SCRIPTWHITELIST=/usr/local/bin/mail"
>>
/etc/rkhunter.conf
fi
sed
-i
's/^CRON_DAILY_RUN=""/CRON_DAILY_RUN="true"/'
/etc/default/rkhunter
sed
-i
's/^CRON_DB_UPDATE=""/CRON_DB_UPDATE="true"/'
/etc/default/rkhunter
sed
-i
's/^APT_AUTOGEN="false"/APT_AUTOGEN="true"/'
/etc/default/rkhunter
# Should be last, update expected output
rkhunter
--propupd
# ### Install Subnetblocker
# Regularly scan fail2ban log to capture whole subnets to block
#hide_output install -m 755 tools/fail2ban-block-ip-range.py /usr/local/bin
#cp -f conf/cron/miab-fail2ban-subnet-blocker /etc/cron.d/
# Logrotation is done via generic mail in a box logrotate config
# ### Install additional tools
# Install combine_certs.sh tool
#hide_output install -m 755 tools/combine_certs.sh /usr/local/bin
;;
esac
MeasureTimeDuration
$START_TIME
}
Installdovecot-fts-xapian
()
{
# IMAP search with xapian
# --------------------------------
#
# By default dovecot uses its own Squat search index that has awful performance
# on large mailboxes and is obsolete. Dovecot 2.1+ has support for using Lucene
# internally. Solr uses too much memory. Same goes for elasticsearch.
# fts xapian might be a good match. See https://github.com/grosjo/fts-xapian
# Install and configure fts-xapian for better search performance
echo
-n
-e
"
$IDENTATION_LVL_2
Installing fts-xapian... "
apt_install dovecot-fts-xapian
...
...
@@ -444,69 +522,5 @@ EOF
# * `-q`: Queues the indexing to be run by indexer process. (will background the indexing)
# * `-A`: All users
# * `'*'`: All folders
#doveadm index -A -q \* >> $PROGRAMS_INSTALL_LOG_FILES 2>&1
### Additional modifications
# Add additional packages
apt_install pflogsumm rkhunter
# Cleanup old spam and trash email
hide_output
install
-m
755
$APWD
/conf/cron/miab_clean_mail /etc/cron.weekly/
# Reduce logs by not logging mail output in syslog
sed
-i
"s/
\*\.\*
;auth,authpriv.none.*
\-\/
var
\/
log
\/
syslog/
\*\.\*
;mail,auth,authpriv.none
\-\/
var
\/
log
\/
syslog/g"
/etc/rsyslog.d/50-default.conf
# Reduce logs by only logging ufw in ufw.log
sed
-i
"s/#
\&
stop/
\&
stop/g"
/etc/rsyslog.d/20-ufw.conf
restart_service rsyslog
# Create forward for root emails
cat
>
/root/.forward
<<
EOF
;
administrator@
$CFG_HOSTNAME_DOMAIN
EOF
# Adapt rkhunter cron job to reduce log file production
sed
-i
"s/--cronjob --report-warnings-only --appendlog/--cronjob --report-warnings-only --no-verbose-logging --appendlog/g"
/etc/cron.daily/rkhunter
# Install fake mail script
if
[
!
-f
/usr/local/bin/mail
]
;
then
hide_output
install
-m
755
$APWD
/tools/fake_mail /usr/local/bin
mv
-f
/usr/local/bin/fake_mail /usr/local/bin/mail
fi
sed
-i
's/^UPDATE_MIRRORS=0/UPDATE_MIRRORS=1/'
/etc/rkhunter.conf
sed
-i
's/^MIRRORS_MODE=1/MIRRORS_MODE=0/'
/etc/rkhunter.conf
sed
-i
's|^WEB_CMD="/bin/false"|WEB_CMD=""|'
/etc/rkhunter.conf
sed
-i
's/^#APPEND_LOG=0/APPEND_LOG=1/'
/etc/rkhunter.conf
sed
-i
's|^#ALLOWHIDDENDIR=/etc/.java|ALLOWHIDDENDIR=/etc/.java|'
/etc/rkhunter.conf
# Check presence of whitelist
if
!
grep
-Fxq
"SCRIPTWHITELIST=/usr/local/bin/mail"
/etc/rkhunter.conf
>
/dev/null
;
then
echo
"SCRIPTWHITELIST=/usr/local/bin/mail"
>>
/etc/rkhunter.conf
fi
sed
-i
's/^CRON_DAILY_RUN=""/CRON_DAILY_RUN="true"/'
/etc/default/rkhunter
sed
-i
's/^CRON_DB_UPDATE=""/CRON_DB_UPDATE="true"/'
/etc/default/rkhunter
sed
-i
's/^APT_AUTOGEN="false"/APT_AUTOGEN="true"/'
/etc/default/rkhunter
# Should be last, update expected output
rkhunter
--propupd
# ### Install Subnetblocker
# Regularly scan fail2ban log to capture whole subnets to block
#hide_output install -m 755 tools/fail2ban-block-ip-range.py /usr/local/bin
#cp -f conf/cron/miab-fail2ban-subnet-blocker /etc/cron.d/
# Logrotation is done via generic mail in a box logrotate config
# ### Install additional tools
# Install combine_certs.sh tool
#hide_output install -m 755 tools/combine_certs.sh /usr/local/bin
;;
esac
MeasureTimeDuration
$START_TIME
doveadm index
-A
-q
\*
>>
$PROGRAMS_INSTALL_LOG_FILES
2>&1
}
distros/debian12/install_mysql.sh
View file @
dee0c34f
...
...
@@ -155,8 +155,8 @@ default-authentication-plugin=mysql_native_password
echo
-n
-e
"
$IDENTATION_LVL_1
Installing MariaDB Server & Client... "
apt_install software-properties-common dirmngr apt-transport-https
apt-key adv
--fetch-keys
'https://mariadb.org/mariadb_release_signing_key.asc'
>>
$PROGRAMS_INSTALL_LOG_FILES
2>&1
yes
| add-apt-repository
'deb [arch=amd64] http://mariadb.mirrors.ovh.net/MariaDB/repo/11.8.1/debian bookworm main'
>>
$PROGRAMS_INSTALL_LOG_FILES
2>&1
curl https://mariadb.org/mariadb_release_signing_key.asc | gpg
--dearmor
>
/etc/apt/trusted.gpg.d/mariadb.gpg
echo
"deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/mariadb.gpg] http://mariadb.mirrors.ovh.net/MariaDB/repo/11.8.1/debian
$(
lsb_release
-cs
)
main"
>
/etc/apt/sources.list.d/mariadb.list
apt_update
apt_install mariadb-client mariadb-server
echo
-e
"[
${
green
}
DONE
${
NC
}
]"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment