Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Hj Ahmad Rasyid Hj Ismail
ISPConfig Autoinstaller
Commits
0ddf927d
Commit
0ddf927d
authored
Oct 15, 2020
by
Marius Burkard
Browse files
- updated for ubuntu 20.04
parent
3f497245
Changes
5
Show whitespace changes
Inline
Side-by-side
lib/os/class.ISPConfigBaseOS.inc.php
View file @
0ddf927d
...
@@ -38,7 +38,7 @@ class ISPConfigBaseOS {
...
@@ -38,7 +38,7 @@ class ISPConfigBaseOS {
throw
new
ISPConfigOSException
(
'Version '
.
$os
[
'VERSION_ID'
]
.
' is not supported for '
.
$os
[
'ID'
]);
throw
new
ISPConfigOSException
(
'Version '
.
$os
[
'VERSION_ID'
]
.
' is not supported for '
.
$os
[
'ID'
]);
}
}
}
elseif
(
$os
[
'ID'
]
===
'ubuntu'
)
{
}
elseif
(
$os
[
'ID'
]
===
'ubuntu'
)
{
if
(
!
in_array
(
$os
[
'VERSION_ID'
],
array
(
'18.04'
)))
{
if
(
!
in_array
(
$os
[
'VERSION_ID'
],
array
(
'18.04'
,
'20.04'
)))
{
throw
new
ISPConfigOSException
(
'Version '
.
$os
[
'VERSION_ID'
]
.
' is not supported for '
.
$os
[
'ID'
]);
throw
new
ISPConfigOSException
(
'Version '
.
$os
[
'VERSION_ID'
]
.
' is not supported for '
.
$os
[
'ID'
]);
}
}
}
else
{
}
else
{
...
@@ -66,7 +66,7 @@ class ISPConfigBaseOS {
...
@@ -66,7 +66,7 @@ class ISPConfigBaseOS {
public
static
function
getOSInstance
()
{
public
static
function
getOSInstance
()
{
try
{
try
{
$os
=
self
::
getOSVersion
();
$os
=
self
::
getOSVersion
();
$class_name
=
'ISPConfig'
.
ucfirst
(
$os
[
'ID'
])
.
$os
[
'VERSION'
]
.
'OS'
;
$class_name
=
'ISPConfig'
.
ucfirst
(
$os
[
'ID'
])
.
str_replace
(
'.'
,
''
,
$os
[
'VERSION'
]
)
.
'OS'
;
if
(
!
is_file
(
LIB_DIR
.
'/os/class.'
.
$class_name
.
'.inc.php'
))
{
if
(
!
is_file
(
LIB_DIR
.
'/os/class.'
.
$class_name
.
'.inc.php'
))
{
$class_name
=
'ISPConfig'
.
ucfirst
(
$os
[
'ID'
])
.
'OS'
;
$class_name
=
'ISPConfig'
.
ucfirst
(
$os
[
'ID'
])
.
'OS'
;
}
}
...
...
lib/os/class.ISPConfigDebian10OS.inc.php
View file @
0ddf927d
...
@@ -43,7 +43,7 @@ class ISPConfigDebian10OS extends ISPConfigDebianOS {
...
@@ -43,7 +43,7 @@ class ISPConfigDebian10OS extends ISPConfigDebianOS {
protected
function
setDefaultPHP
()
{
protected
function
setDefaultPHP
()
{
ISPConfigLog
::
info
(
'Settings default system php version.'
,
true
);
ISPConfigLog
::
info
(
'Settings default system php version.'
,
true
);
$cmd
=
'update-alternatives --set php /usr/bin/php7.3 ; update-alternatives --set php-cgi /usr/bin/php-cgi7.3'
;
$cmd
=
'update-alternatives --set php /usr/bin/php7.3 ; update-alternatives --set php-cgi /usr/bin/php-cgi7.3
; update-alternatives --set php-fpm.sock /run/php/php7.3-fpm.sock
'
;
$result
=
$this
->
exec
(
$cmd
);
$result
=
$this
->
exec
(
$cmd
);
if
(
$result
===
false
)
{
if
(
$result
===
false
)
{
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
...
...
lib/os/class.ISPConfigDebianOS.inc.php
View file @
0ddf927d
...
@@ -146,7 +146,7 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
...
@@ -146,7 +146,7 @@ class ISPConfigDebianOS extends ISPConfigBaseOS {
protected
function
setDefaultPHP
()
{
protected
function
setDefaultPHP
()
{
ISPConfigLog
::
info
(
'Settings default system php version.'
,
true
);
ISPConfigLog
::
info
(
'Settings default system php version.'
,
true
);
$cmd
=
'update-alternatives --set php /usr/bin/php7.0 ; update-alternatives --set php-cgi /usr/bin/php-cgi7.0'
;
$cmd
=
'update-alternatives --set php /usr/bin/php7.0 ; update-alternatives --set php-cgi /usr/bin/php-cgi7.0
; update-alternatives --set php-fpm.sock /run/php/php7.0-fpm.sock
'
;
$result
=
$this
->
exec
(
$cmd
);
$result
=
$this
->
exec
(
$cmd
);
if
(
$result
===
false
)
{
if
(
$result
===
false
)
{
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
...
...
lib/os/class.ISPConfigUbuntu2004OS.inc_1.php
0 → 100644
View file @
0ddf927d
<?php
/**
* Description of class
*
* @author croydon
*/
class
ISPConfigUbuntuOS
extends
ISPConfigDebianOS
{
protected
function
configureApt
()
{
// enable contrib and non-free
ISPConfigLog
::
info
(
'Configuring apt repositories.'
,
true
);
$contents
=
'# created by ISPConfig auto installer
deb http://de.archive.ubuntu.com/ubuntu/ focal main restricted
deb http://de.archive.ubuntu.com/ubuntu/ focal-updates main restricted
deb http://de.archive.ubuntu.com/ubuntu/ focal universe
deb http://de.archive.ubuntu.com/ubuntu/ focal-updates universe
deb http://de.archive.ubuntu.com/ubuntu/ focal multiverse
deb http://de.archive.ubuntu.com/ubuntu/ focal-updates multiverse
deb http://de.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu focal-security main restricted
deb http://security.ubuntu.com/ubuntu focal-security universe
deb http://security.ubuntu.com/ubuntu focal-security multiverse
'
;
file_put_contents
(
'/etc/apt/sources.list'
,
$contents
);
}
protected
function
beforePackageInstall
(
$section
=
''
)
{
$this
->
stopService
(
'apparmor'
);
$this
->
stopService
(
'sendmail'
);
$cmd
=
'update-rc.d -f apparmor remove ; update-rc.d -f sendmail remove ; apt-get -y -qq remove apparmor apparmor-utils'
;
$result
=
$this
->
exec
(
$cmd
);
if
(
$result
===
false
)
{
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
}
}
protected
function
afterPackageInstall
(
$section
=
''
)
{
if
(
$section
===
'mail'
)
{
$cmd
=
'freshclam'
;
$result
=
$this
->
exec
(
$cmd
,
array
(
62
));
if
(
$result
===
false
)
{
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
}
$this
->
startService
(
'clamav-daemon'
);
}
}
protected
function
addSuryRepo
()
{
ISPConfigLog
::
info
(
'Activating sury php repository.'
,
true
);
$cmd
=
'add-apt-repository -y ppa:ondrej/php'
;
$result
=
$this
->
exec
(
$cmd
);
if
(
$result
===
false
)
{
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
}
}
protected
function
getFail2BanJail
()
{
$jk_jail
=
'[pure-ftpd]
enabled = true
port = ftp
filter = pure-ftpd
logpath = /var/log/syslog
maxretry = 3
[dovecot]
enabled = true
filter = dovecot
action = iptables-multiport[name=dovecot-pop3imap, port="pop3,pop3s,imap,imaps", protocol=tcp]
logpath = /var/log/mail.log
maxretry = 5
[postfix-sasl]
enabled = true
port = smtp
filter = postfix
logpath = /var/log/mail.log
maxretry = 3'
;
return
$jk_jail
;
}
protected
function
setDefaultPHP
()
{
ISPConfigLog
::
info
(
'Settings default system php version.'
,
true
);
$cmd
=
'update-alternatives --set php /usr/bin/php7.4 ; update-alternatives --set php-cgi /usr/bin/php-cgi7.4 ; update-alternatives --set php-fpm.sock /run/php/php7.4-fpm.sock'
;
$result
=
$this
->
exec
(
$cmd
);
if
(
$result
===
false
)
{
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
}
}
protected
function
getSystemPHPVersion
()
{
return
'7.4'
;
}
}
lib/os/class.ISPConfigUbuntuOS.inc.php
View file @
0ddf927d
...
@@ -83,7 +83,7 @@ maxretry = 3';
...
@@ -83,7 +83,7 @@ maxretry = 3';
protected
function
setDefaultPHP
()
{
protected
function
setDefaultPHP
()
{
ISPConfigLog
::
info
(
'Settings default system php version.'
,
true
);
ISPConfigLog
::
info
(
'Settings default system php version.'
,
true
);
$cmd
=
'update-alternatives --set php /usr/bin/php7.2 ; update-alternatives --set php-cgi /usr/bin/php-cgi7.2'
;
$cmd
=
'update-alternatives --set php /usr/bin/php7.2 ; update-alternatives --set php-cgi /usr/bin/php-cgi7.2
; update-alternatives --set php-fpm.sock /run/php/php7.2-fpm.sock
'
;
$result
=
$this
->
exec
(
$cmd
);
$result
=
$this
->
exec
(
$cmd
);
if
(
$result
===
false
)
{
if
(
$result
===
false
)
{
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
throw
new
ISPConfigOSException
(
'Command '
.
$cmd
.
' failed.'
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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