Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
etersoft-admin-essentials
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
etersoft-admin-essentials
Commits
863afa57
Commit
863afa57
authored
May 17, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
68f8c0cb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
11 deletions
+51
-11
base.task
vz/azbyka/base.task
+1
-0
createbylist.sh
vz/azbyka/createbylist.sh
+1
-1
createbytask.int.sh
vz/azbyka/createbytask.int.sh
+23
-0
createbytask.sh
vz/azbyka/createbytask.sh
+26
-10
No files found.
vz/azbyka/base.task
View file @
863afa57
...
...
@@ -7,6 +7,7 @@ PKGPROFILE="apache2-php7"
# PHP
PHP_memory_limit=256M
PHP_max_execution_time=30
PHP_post_max_size=40M
# Site
DOMAIN=site.azbyka.ru
...
...
vz/azbyka/createbylist.sh
View file @
863afa57
...
...
@@ -8,7 +8,7 @@ CONFDIR=/vz/root/900/etc/nginx/sites-enabled.d/azbyka.d
#for task in deti parkhomenko stenyaev molitvoslov ; do
#for task in bogosluzhenie chinaorthodox ; do
#for task in viktorina shorohova orthodoxy ; do
for
task
in
al-masih 03
;
do
for
task
in
days
;
do
veid
=
$(
grep
sites80
$CONFDIR
/
$task
.conf |
sed
-e
"s|.*//sites80
\(
[0-9][0-9]
\)
.*|
\1
|"
|
head
-n1
)
[
-n
"
$veid
"
]
||
{
echo
"skip
$task
"
;
continue
;
}
cat
<<
EOF
>ves/
$task
.task
...
...
vz/azbyka/createbytask.int.sh
View file @
863afa57
...
...
@@ -68,6 +68,12 @@ tune_php7()
#[ -s php7.add ] && cat php7.add | st tee -a $aphp
[
-n
"
$PHP_memory_limit
"
]
&&
subst
"s|^memory_limit =.*|memory_limit =
$PHP_memory_limit
|"
$aphp
[
-n
"
$PHP_max_execution_time
"
]
&&
subst
"s|^max_execution_time = .*|max_execution_time =
$PHP_max_execution_time
|"
$aphp
if
[
-n
"
$PHP_post_max_size
"
]
;
then
subst
"s|^post_max_size = .*|post_max_size =
$PHP_post_max_size
|"
$aphp
subst
"s|^upload_max_filesize = .*|upload_max_filesize =
$PHP_post_max_size
|"
$aphp
fi
PHP_max_file_uploads
=
200
subst
"s|^max_file_uploads = .*|max_file_uploads =
$PHP_max_file_uploads
|"
$aphp
}
tune_apache2
()
...
...
@@ -127,6 +133,19 @@ EOF
\n\
\1
|"
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
if
!
grep
-q
mpm_itk_module /etc/httpd2/conf/extra-available/httpd-mpm.conf
;
then
subst
"s|
\(
# worker MPM.*
\)
|
\
<IfModule mpm_itk_module>
\n\
StartServers 1
\n\
MinSpareServers 2
\n\
MaxSpareServers 5
\n\
MaxClients 7
\n\
MaxRequestsPerChild 0
\n\
</IfModule>
\n\
\n\
\1
|"
/etc/httpd2/conf/extra-available/httpd-mpm.conf
fi
# fix remoteip
subst
's|LogFormat "%h|LogFormat "%a|g'
/etc/httpd2/conf/mods-available/log_config.conf
...
...
@@ -138,6 +157,10 @@ EOF
groupadd
$AUSER
-g
$AGROUPID
useradd
-M
$AUSER
-u
$AUSERID
-g
$AGROUPID
#|| fatal
# locales
echo
"%_install_langs ru_RU en_US"
>
/etc/rpm/macros
epmi
--auto
--skip-installed
glibc-locales
tune_hosts
for
i
in
$PKGPROFILE
;
do
...
...
vz/azbyka/createbytask.sh
View file @
863afa57
...
...
@@ -12,6 +12,15 @@ assure()
[
-n
"
$1
"
]
||
fatal
"empty"
}
hostserver
()
{
if
[
$(
hostname
)
=
"a01.azbyka.ru"
]
;
then
"
$@
"
else
ssh a01
"
$@
"
fi
}
if
[
-s
"base.task"
]
;
then
.
base.task
fi
...
...
@@ -60,7 +69,7 @@ assure $VEIDORIG
if
!
vzlist
-a
|
grep
"
$VEIP
"
;
then
vzctl create
$VEID
--ostemplate
=
$TEMPLATE
||
fatal
vzctl
set
$VEID
--name
$NAME
--hostname
$ADOMAIN
--onboot
yes
--ipadd
$VEIP
--save
||
fatal
vzctl
set
$VEID
--shmpages
300M
--physpages
1G
--privvmpages
2G
--tcprcvbuf
unlimited
--kmemsize
40M:45
M
--numproc
512
--dcachesize
unlimited
--save
||
fatal
vzctl
set
$VEID
--shmpages
300M
--physpages
1G
--privvmpages
3G
--tcprcvbuf
unlimited
--kmemsize
70M:80
M
--numproc
512
--dcachesize
unlimited
--save
||
fatal
fi
if
[
!
-s
/etc/vz/conf/
$VEID
.mount
]
;
then
...
...
@@ -80,20 +89,27 @@ if ! vzlist | grep $VEIP ; then
vzctl start
$VEID
||
fatal
fi
# TODO
vzctl
exec
$VEID
update_chrooted conf
vzctl
exec
$VEID
epmI eepm
vzctl
exec
$VEID
epm
--auto
upgrade
# TODO: first time only or force?
if
true
;
then
vzctl
exec
$VEID
update_chrooted conf
vzctl
exec
$VEID
epmI eepm
vzctl
exec
$VEID
epm
--auto
upgrade
fi
st
()
{
vzctl
exec
$VEID
"
$@
"
}
# TODO
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf | st
tee
/tmp/
$ACONF
.conf
if
[
!
-s
"apache/
$AUSER
.conf"
]
;
then
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf | st
tee
/tmp/
$ACONF
.conf
fi
[
-s
apache/
$AUSER
.conf
]
||
fatal
"Empty /tmp/
$AUSER
.conf"
cat
apache/
$AUSER
.conf | st
tee
/tmp/
$AUSER
.conf
# /etc/httpd2/conf/sites-enabled/$AUSER.conf || fatal
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/include/prepend.php | st
tee
/tmp/prepend.php
hostserver
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/include/prepend.php | st
tee
/tmp/prepend.php
# etc/httpd2/conf/include/prepend.php || fatal
# copy task into
...
...
@@ -106,11 +122,11 @@ echo "AUSER=$AUSER" | st tee -a $ATASK
echo
"ACONF=
$ACONF
"
| st
tee
-a
$ATASK
echo
"ADOMAIN=
$ADOMAIN
"
| st
tee
-a
$ATASK
auserid
=
$(
vzctl
exec
$VEIDORIG
id
-u
$AUSER
)
auserid
=
$(
hostserver
vzctl
exec
$VEIDORIG
id
-u
$AUSER
)
[
-n
"
$auserid
"
]
||
fatal
"can't get user id"
echo
"AUSERID=
$auserid
"
| st
tee
-a
$ATASK
agroupid
=
$(
vzctl
exec
$VEIDORIG
id
-g
$AUSER
)
agroupid
=
$(
hostserver
vzctl
exec
$VEIDORIG
id
-g
$AUSER
)
[
-n
"
$agroupid
"
]
||
fatal
"can't get group id"
echo
"AGROUPID=
$agroupid
"
| st
tee
-a
$ATASK
...
...
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