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
2aac6e2d
Commit
2aac6e2d
authored
Jul 11, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
last fixes and fix variables name
parent
c8d72e22
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
add_site.sh
web/add_site.sh
+8
-7
functions
web/functions
+13
-6
No files found.
web/add_site.sh
View file @
2aac6e2d
...
...
@@ -5,6 +5,7 @@ test "$1" || exit 1
test
"
$2
"
||
exit
1
USERNAME
=
$2
DOMAINNAME
=
$(
echo
"
$1
"
|
tr
[
A-Z]
[
a-z]
)
ALIASLIST
=
.
./config
.
./functions
...
...
@@ -39,17 +40,17 @@ if [ ! -d "$LOGDIR" ] ; then
fi
#mkdir -p $SITE/cgi
mkdir
-p
$SITE
mkdir
-p
$SITE
DIR
#mkdir -p $LOGDIR
#test -f $SITE/favicon.ico || cp -f ./favicon.ico $SITE/favicon.ico
test
-f
$SITE
/favicon.ico
||
touch
$SITE
/favicon.ico
touch
$SITE
/robots.txt
test
-f
$SITE
DIR
/favicon.ico
||
touch
$SITEDIR
/favicon.ico
touch
$SITE
DIR
/robots.txt
# due nscd?
chown
-R
$2
:webmaster
$SITE
/
||
{
sleep
10
;
chown
-R
$2
:webmaster
$SITE
/
;
}
chown
-R
$2
:webmaster
$SITE
DIR
/
||
{
sleep
10
;
chown
-R
$2
:webmaster
$SITEDIR
/
;
}
#chmod o+r $SITE/robots.txt $SITE/favicon.ico
chmod
g+rwx
$SITE
/
chmod
o-rwx
$SITE
/
chmod
g+s
$SITE
/
chmod
g+rwx
$SITE
DIR
/
chmod
o-rwx
$SITE
DIR
/
chmod
g+s
$SITE
DIR
/
check_dirs
...
...
web/functions
View file @
2aac6e2d
...
...
@@ -9,7 +9,8 @@ set_vars()
USERTMPDIR=$HOMEDIR/tmp
SESSIONDIR=$USERTMPDIR/session/$DOMAINNAME
TECHNAME=`echo $DOMAINNAME | sed -e "s|\..*||g"`
SITE=$HOSTBASE/$DOMAINNAME
TECHALIAS=$TECHNAME.$TECHHOST
SITEDIR=$HOSTBASE/$DOMAINNAME
}
check_dir()
...
...
@@ -22,7 +23,7 @@ check_dir()
check_dirs()
{
for i in HOSTBASE LOGDIR USERTMPDIR SESSIONDIR SITE ; do
for i in HOSTBASE LOGDIR USERTMPDIR SESSIONDIR SITE
DIR
; do
check_dir $i
done
}
...
...
@@ -30,7 +31,11 @@ check_dirs()
# needs: DOMAINNAME
create_site_config()
{
PHPINCLUDE=/etc/httpd2/conf/include
local aliaslist=
# for get space before
[ -n "$ALIASLIST" ] && aliaslist=" $ALIASLIST"
local PHPINCLUDE=/etc/httpd2/conf/include
[ -r $PHPINCLUDE/prepend.php ] || echo "<?php putenv('TMPDIR='.ini_get('upload_tmp_dir'));" >$PHPINCLUDE/prepend.php
cat <<EOF >$DOMAINNAME.conf
#NameVirtualHost *
...
...
@@ -38,14 +43,16 @@ cat <<EOF >$DOMAINNAME.conf
# ----- $1 -----
<VirtualHost *>
ServerName $DOMAINNAME
ServerAlias www.$DOMAINNAME $TECH
NAME.$TECHHOST
ServerAlias www.$DOMAINNAME $TECH
ALIAS$aliaslist
AssignUserID $USERNAME $USERNAME
php_admin_value session.save_path "$SESSIONDIR"
php_admin_value open_basedir "$SITE:$USERTMPDIR:$PHPINCLUDE"
# Due http://drupal.stackexchange.com/questions/10646/i-get-tmp-is-not-writeable-by-the-webserver-on-migration
# NOTE: /tmp for open_basedir
php_admin_value open_basedir "$SITEDIR:$USERTMPDIR:$PHPINCLUDE:/tmp"
php_admin_value upload_tmp_dir "$USERTMPDIR"
php_admin_value auto_prepend_file "$PHPINCLUDE/prepend.php"
ServerAdmin $ADMINMAIL
DocumentRoot "$SITE"
DocumentRoot "$SITE
DIR
"
ErrorLog $LOGDIR/${TECHNAME}_error.log
CustomLog $LOGDIR/${TECHNAME}_access.log common
</VirtualHost>
...
...
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