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
fa40f564
Commit
fa40f564
authored
Jul 26, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merge dir perms and owners code, add refresh_dirs.sh script
parent
9accf4bd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
12 deletions
+55
-12
add_site.sh
web/add_site.sh
+7
-10
functions
web/functions
+27
-0
refresh_dirs.sh
web/refresh_dirs.sh
+18
-0
refresh_site_conf.sh
web/refresh_site_conf.sh
+3
-2
No files found.
web/add_site.sh
View file @
fa40f564
...
...
@@ -29,18 +29,14 @@ cd /etc/httpd2/conf/sites-enabled || exit
umask
u
=
rwx,g
=
rwx,o
=
x
if
[
!
-d
"
$LOGDIR
"
]
;
then
mkdir
-p
$LOGDIR
$HOSTBASE
$SESSIONDIR
chown
-R
$2
:webmaster /home/
$2
chmod
g+rwx /home/
$2
chmod
g+s /home/
$2
chmod
g-w /home/
$2
chmod
o-rwx /home/
$2
/home/
$2
/www
chown
-R
root:root
$LOGDIR
chmod
0755
$LOGDIR
# create all dir from scratch
set_dirperms
fi
#mkdir -p $SITE/cgi
mkdir
-p
$SITEDIR
mkdir
-p
$SITEDIR
$SESSIONDIR
chown
$USERNAME
$SESSIONDIR
/
#mkdir -p $LOGDIR
#test -f $SITE/favicon.ico || cp -f ./favicon.ico $SITE/favicon.ico
test
-f
$SITEDIR
/favicon.ico
||
touch
$SITEDIR
/favicon.ico
...
...
@@ -58,6 +54,7 @@ create_site_config
service httpd2 reload
service httpd2 status
&&
echo
OK
# starthttpd2 forces run httpd2
service httpd2 status
||
starthttpd2
echo
"You can use technical name:
$TECHNAME
.
$TECHHOST
for access to the site."
web/functions
View file @
fa40f564
...
...
@@ -13,6 +13,33 @@ set_vars()
SITEDIR=$HOSTBASE/$DOMAINNAME
}
set_dirperms()
{
# TODO: merge with add_site
# home
mkdir -p $HOMEDIR
chown -v $USERNAME:webmaster $HOMEDIR
chmod -v 0750 $HOMEDIR
chmod -v g-s $HOMEDIR
# www
mkdir -p $HOSTBASE
chown root:webmaster $HOSTBASE
chmod -v 0775 $HOSTBASE
chmod -v g-s $HOSTBASE
# www/sites
chown $USERNAME:webmaster $HOSTBASE/*
chmod -v 0770 $HOSTBASE/*
chmod -v g+s $HOSTBASE/*
# log
mkdir -p $LOGDIR
chown -R -v root:apache2 $LOGDIR
chmod -v 0755 $LOGDIR
}
check_dir()
{
local dir=$1
...
...
web/refresh_dirs.sh
0 → 100755
View file @
fa40f564
#!/bin/sh
.
./config
.
./functions
.
./functions-apache
cd
/home
||
exit
LISTUSER
=
"*"
[
-n
"
$*
"
]
&&
LISTUSER
=
"
$*
"
for
USERNAME
in
$LISTUSER
;
do
echo
$USERNAME
set_vars
set_dirperms
done
web/refresh_site_conf.sh
View file @
fa40f564
...
...
@@ -24,8 +24,9 @@ for i in $LISTCONF ; do
ALIASLIST
=
$(
get_aliaslist
$i
)
[
-z
"
$ALIASLIST
"
]
||
echo
" Alias list:
$ALIASLIST
"
mkdir
-p
$SESSIONDIR
/
chown
$USERNAME
$SESSIONDIR
/
# one time fix
#mkdir -p $SESSIONDIR/
#chown $USERNAME $SESSIONDIR/
check_dirs
...
...
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