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
68f8c0cb
Commit
68f8c0cb
authored
May 16, 2017
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update azbyka creating
parent
87bcd2c8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
10 deletions
+44
-10
createbytask.int.sh
vz/azbyka/createbytask.int.sh
+16
-4
createbytask.sh
vz/azbyka/createbytask.sh
+28
-6
No files found.
vz/azbyka/createbytask.int.sh
View file @
68f8c0cb
...
...
@@ -16,7 +16,9 @@ TASK="$1"
[
-s
"
$TASK
"
]
||
fatal
.
$TASK
assure
$NAME
assure
$AUSER
assure
$ACONF
tune_hosts
()
{
...
...
@@ -85,11 +87,11 @@ EOF
ln
-sr
/etc/httpd2/conf/mods-available/remoteip.conf /etc/httpd2/conf/mods-enabled/remoteip.conf
# TODO
cp
/tmp/
$A
USER
.conf /etc/httpd2/conf/sites-enabled/
$AUSER
.conf
||
fatal
cp
/tmp/
$A
CONF
.conf /etc/httpd2/conf/sites-enabled/
$ACONF
.conf
||
fatal
cp
/tmp/prepend.php /etc/httpd2/conf/include/prepend.php
||
fatal
subst
"s|^NameVirtualHost.*||g"
/etc/httpd2/conf/sites-enabled/
$A
USER
.conf
subst
"s|^<VirtualHost.*|<VirtualHost *:80>|g"
/etc/httpd2/conf/sites-enabled/
$A
USER
.conf
subst
"s|^NameVirtualHost.*||g"
/etc/httpd2/conf/sites-enabled/
$A
CONF
.conf
subst
"s|^<VirtualHost.*|<VirtualHost *:80>|g"
/etc/httpd2/conf/sites-enabled/
$A
CONF
.conf
#PORT=$(grep "^<VirtualHost" /etc/httpd2/conf/sites-enabled/$AUSER.conf | sed -e "s|<VirtualHost \*:\([0-9]*\)>.*|\1|")
...
...
@@ -112,8 +114,18 @@ EOF
# Allow from 91.232.225.0/24
\n\
#</IfModule>
\n\
</Location>
\n\
# HACK for a02:
\n\
Alias /
$NAME
/server-status /var/empty
\n\
<Location /
$NAME
/server-status>
\n\
SetHandler server-status
\n\
#<IfModule authz_host_module>
\n\
# Order deny,allow
\n\
# Deny from all
\n\
# Allow from 91.232.225.0/24
\n\
#</IfModule>
\n\
</Location>
\n\
\n\
\1
|"
/etc/httpd2/conf/sites-enabled/
$A
USER
.conf
\1
|"
/etc/httpd2/conf/sites-enabled/
$A
CONF
.conf
# fix remoteip
subst
's|LogFormat "%h|LogFormat "%a|g'
/etc/httpd2/conf/mods-available/log_config.conf
...
...
vz/azbyka/createbytask.sh
View file @
68f8c0cb
...
...
@@ -28,17 +28,38 @@ TASK="$1"
# TODO
VEIP
=
192.168.3.
$VEID
AUSER
=
${
BASENAME
}
_
$NAME
# hack
[
"
$NAME
"
=
"
$BASENAME
"
]
&&
AUSER
=
$BASENAME
#
if
[
-z
"
$AUSER
"
]
;
then
if
[
-n
"
$BASENAME
"
]
;
then
AUSER
=
${
BASENAME
}
_
$NAME
ADOMAIN
=
"
$NAME
.
$DOMAIN
"
ACONF
=
"
$AUSER
"
else
AUSER
=
"
$NAME
"
ADOMAIN
=
"
$NAME
.
$DOMAIN
"
ACONF
=
"
$AUSER
"
fi
fi
if
[
-z
"
$ADOMAIN
"
]
;
then
ADOMAIN
=
"
$NAME
"
fi
if
[
-z
"
$ACONF
"
]
;
then
ACONF
=
"
$NAME
"
fi
assure
$AUSER
assure
$ADOMAIN
assure
$ACONF
assure
$NAME
assure
$VEID
assure
$VEIDORIG
if
!
vzlist
-a
|
grep
"
$VEIP
"
;
then
vzctl create
$VEID
--ostemplate
=
$TEMPLATE
||
fatal
vzctl
set
$VEID
--name
$NAME
--hostname
$
NAME
.
$
DOMAIN
--onboot
yes
--ipadd
$VEIP
--save
||
fatal
vzctl
set
$VEID
--name
$NAME
--hostname
$
A
DOMAIN
--onboot
yes
--ipadd
$VEIP
--save
||
fatal
vzctl
set
$VEID
--shmpages
300M
--physpages
1G
--privvmpages
2G
--tcprcvbuf
unlimited
--kmemsize
40M:45M
--numproc
512
--dcachesize
unlimited
--save
||
fatal
fi
...
...
@@ -70,7 +91,7 @@ st()
}
# TODO
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/sites-enabled/
$A
USER
.conf | st
tee
/tmp/
$AUSER
.conf
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/sites-enabled/
$A
CONF
.conf | st
tee
/tmp/
$ACONF
.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
# etc/httpd2/conf/include/prepend.php || fatal
...
...
@@ -81,8 +102,9 @@ ATASK=/tmp/$(basename $TASK)
# if we detected it before
echo
"NAME=
$NAME
"
| st
tee
-a
$ATASK
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
)
[
-n
"
$auserid
"
]
||
fatal
"can't get user id"
...
...
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