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
02f115b3
Commit
02f115b3
authored
Dec 11, 2018
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add FDOMAIN part, use it in logrotate file
parent
da20f325
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
createbytask.int.sh
vz/azbyka/createbytask.int.sh
+9
-4
createbytask.sh
vz/azbyka/createbytask.sh
+8
-3
No files found.
vz/azbyka/createbytask.int.sh
View file @
02f115b3
...
@@ -19,6 +19,11 @@ TASK="$1"
...
@@ -19,6 +19,11 @@ TASK="$1"
assure
$NAME
assure
$NAME
assure
$AUSER
assure
$AUSER
assure
$ACONF
assure
$ACONF
assure
$ADOMAIN
assure
$VEID
# Выделяем начальное слово в домене
FDOMAINPART
=
"
$(
echo
"
$ADOMAIN
"
|
sed
-e
"s|
\.
.*||"
)
"
# TODO: external config
# TODO: external config
ADMINEMAIL
=
lav@etersoft.ru
ADMINEMAIL
=
lav@etersoft.ru
...
@@ -89,7 +94,7 @@ EOF
...
@@ -89,7 +94,7 @@ EOF
tune_logrotate
()
tune_logrotate
()
{
{
cat
<<
EOF
>/etc/logrotate.d/apache-home-local.tmpCB
cat
<<
EOF
>/etc/logrotate.d/apache-home-local.tmpCB
/home/
*/log/
*.log {
/home/
$AUSER
/log/
$FDOMAINPART
*.log {
missingok
missingok
rotate 3
rotate 3
size 3000k
size 3000k
...
@@ -173,14 +178,13 @@ cat <<EOF > /etc/httpd2/conf/mods-available/remoteip.conf
...
@@ -173,14 +178,13 @@ cat <<EOF > /etc/httpd2/conf/mods-available/remoteip.conf
EOF
EOF
ln
-sr
/etc/httpd2/conf/mods-available/remoteip.conf /etc/httpd2/conf/mods-enabled/remoteip.conf
ln
-sr
/etc/httpd2/conf/mods-available/remoteip.conf /etc/httpd2/conf/mods-enabled/remoteip.conf
cp
/tmp/prepend.php /etc/httpd2/conf/include/prepend.php
||
fatal
# TODO
# TODO
if
[
-s
/tmp/
$ACONF
.conf
]
;
then
cp
/tmp/
$ACONF
.conf /etc/httpd2/conf/sites-enabled/
$ACONF
.conf
||
fatal
cp
/tmp/
$ACONF
.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/
$ACONF
.conf
subst
"s|^NameVirtualHost.*||g"
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
subst
"s|^<VirtualHost.*|<VirtualHost *:80>|g"
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
subst
"s|^<VirtualHost.*|<VirtualHost *:80>|g"
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
#PORT=$(grep "^<VirtualHost" /etc/httpd2/conf/sites-enabled/$AUSER.conf | sed -e "s|<VirtualHost \*:\([0-9]*\)>.*|\1|")
#PORT=$(grep "^<VirtualHost" /etc/httpd2/conf/sites-enabled/$AUSER.conf | sed -e "s|<VirtualHost \*:\([0-9]*\)>.*|\1|")
#"
#"
#[ -n "$PORT" ] || fatal
#[ -n "$PORT" ] || fatal
...
@@ -213,6 +217,7 @@ EOF
...
@@ -213,6 +217,7 @@ EOF
</Location>
\n\
</Location>
\n\
\n\
\n\
\1
|"
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
\1
|"
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
fi
if
!
grep
-q
mpm_itk_module /etc/httpd2/conf/extra-available/httpd-mpm.conf
;
then
if
!
grep
-q
mpm_itk_module /etc/httpd2/conf/extra-available/httpd-mpm.conf
;
then
subst
"s|
\(
# worker MPM.*
\)
|
\
subst
"s|
\(
# worker MPM.*
\)
|
\
...
...
vz/azbyka/createbytask.sh
View file @
02f115b3
...
@@ -48,7 +48,7 @@ TASK="$1"
...
@@ -48,7 +48,7 @@ TASK="$1"
# TODO
# TODO
VEIP
=
$BASEIP
.
$VEID
VEIP
=
$BASEIP
.
$VEID
#
#
Если не указан системный пользователь AUSER
if
[
-z
"
$AUSER
"
]
;
then
if
[
-z
"
$AUSER
"
]
;
then
if
[
-n
"
$BASENAME
"
]
;
then
if
[
-n
"
$BASENAME
"
]
;
then
AUSER
=
${
BASENAME
}
_
$NAME
AUSER
=
${
BASENAME
}
_
$NAME
...
@@ -61,10 +61,12 @@ if [ -z "$AUSER" ] ; then
...
@@ -61,10 +61,12 @@ if [ -z "$AUSER" ] ; then
fi
fi
fi
fi
# Если домен не был явно задан в конфиге, берём из NAME
if
[
-z
"
$ADOMAIN
"
]
;
then
if
[
-z
"
$ADOMAIN
"
]
;
then
ADOMAIN
=
"
$NAME
"
ADOMAIN
=
"
$NAME
"
fi
fi
# Если название конфига явно не задано, берём из NAME
if
[
-z
"
$ACONF
"
]
;
then
if
[
-z
"
$ACONF
"
]
;
then
ACONF
=
"
$NAME
"
ACONF
=
"
$NAME
"
fi
fi
...
@@ -121,8 +123,11 @@ if [ -n "$VEIDORIG" ] ; then
...
@@ -121,8 +123,11 @@ if [ -n "$VEIDORIG" ] ; then
hostserver
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
>
apache/
$ACONF
.conf
hostserver
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/sites-enabled/
$ACONF
.conf
>
apache/
$ACONF
.conf
fi
fi
[
-s
apache/
$ACONF
.conf
]
||
fatal
"Empty apache/
$ACONF
.conf"
if
[
-s
apache/
$ACONF
.conf
]
;
then
cat
apache/
$ACONF
.conf | st
tee
/tmp/
$ACONF
.conf
>
/dev/null
cat
apache/
$ACONF
.conf | st
tee
/tmp/
$ACONF
.conf
>
/dev/null
else
echo
"Empty apache/
$ACONF
.conf, skipped"
fi
hostserver
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/include/prepend.php | st
tee
/tmp/prepend.php
>
/dev/null
hostserver
cat
/var/lib/vz/root/
$VEIDORIG
/etc/httpd2/conf/include/prepend.php | st
tee
/tmp/prepend.php
>
/dev/null
st
test
-s
/tmp/prepend.php
||
fatal
"Empty prepend.php"
st
test
-s
/tmp/prepend.php
||
fatal
"Empty prepend.php"
...
...
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