File: apache.sh

package info (click to toggle)
fusionforge 5.3.2%2B20141104-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 60,472 kB
  • sloc: php: 271,846; sql: 36,817; python: 14,575; perl: 6,406; sh: 5,980; xml: 4,294; pascal: 1,411; makefile: 911; cpp: 52; awk: 27
file content (35 lines) | stat: -rwxr-xr-x 1,034 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash

echo -n "Checking Project Web Directories: "

for i in `cd /home/groups ; ls | grep -v lost+found | grep -v quota.group | grep -v ^ftp` ; do
	if [ ! -d /home/groups/$i/log ] ; then
		mkdir /home/groups/$i/log
		chown dummy:$i /home/groups/$i/log
		chmod 0774 /home/groups/$i/log
	fi

# disabled for CVE-2014-6275
# Only enable it if you know what you are doing, by default all scripts run as Apache
#	if [ ! -d /home/groups/$i/cgi-bin ] ; then
#		mkdir /home/groups/$i/cgi-bin
#		chown dummy:$i /home/groups/$i/cgi-bin
#		chmod 0774 /home/groups/$i/cgi-bin
#	fi

	if [ ! -d /home/groups/$i/htdocs ] ; then
		mkdir /home/groups/$i/htdocs
		chown dummy:$i /home/groups/$i/htdocs
		chmod 0774 /home/groups/$i/htdocs
	fi

	if [ "`ls /home/groups/$i/htdocs/`" = "" ] ; then
		cp /root/alexandria/utils/default_page.php /home/groups/$i/htdocs/index.php
		chown dummy:$i /home/groups/$i/htdocs/index.php
                chmod 0664 /home/groups/$i/htdocs/index.php
        fi
done

echo "Done."

/etc/rc.d/init.d/apache restart