From 768797a60c2256fbfb9b79bd304c4d2458f81f71 Mon Sep 17 00:00:00 2001 From: "paul.baranowski" Date: Fri, 10 Sep 2010 10:48:08 -0400 Subject: [PATCH] Fixed errors during storage server build. For some reason detection of a request from localhost was no longer detected by the webserver. --- src/modules/storageServer/bin/setupDirs.sh | 24 ++++++++++++------- .../storageServer/var/install/getGname.php | 4 +++- .../storageServer/var/install/getPwd.php | 5 +++- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/modules/storageServer/bin/setupDirs.sh b/src/modules/storageServer/bin/setupDirs.sh index e2ff568d4..2b7d1e3c8 100755 --- a/src/modules/storageServer/bin/setupDirs.sh +++ b/src/modules/storageServer/bin/setupDirs.sh @@ -27,7 +27,7 @@ WWW_ROOT=`cd var/install; php -q getWwwRoot.php` || exit $? echo " *** StorageServer bin/setupDirs.sh BEGIN" -echo " *** Root URL: $WWW_ROOT" +echo " * Root URL: $WWW_ROOT" PHP_PWD_COMMAND=`bin/getUrl.sh $WWW_ROOT/install/getPwd.php` || \ { errno=$? @@ -37,6 +37,7 @@ PHP_PWD_COMMAND=`bin/getUrl.sh $WWW_ROOT/install/getPwd.php` || \ fi exit $errno } + PHP_PWD=$PHP_PWD_COMMAND # MOD_PHP may not be working, this command will tell us if [ ${PHP_PWD_COMMAND:0:5} == ' Probably wrong setting in var/conf.php: URL configuration"; exit $ERN; } -echo " *** The system group that is running the http daemon: '$HTTP_GROUP'" +echo " ** The system group that is running the http daemon: '$HTTP_GROUP'" for i in $* do - echo " *** chown :$HTTP_GROUP $i" + echo " * chown :$HTTP_GROUP $i" if [ -G $i ]; then chown :$HTTP_GROUP $i || \ { @@ -73,7 +79,7 @@ do echo "ERROR: chown :$HTTP_GROUP $i -> You should have permissions to set group owner to group '$HTTP_GROUP'"; exit $ERN; } - echo " *** chmod g+sw $i" + echo " * chmod g+sw $i" chmod g+sw $i || exit $? fi done diff --git a/src/modules/storageServer/var/install/getGname.php b/src/modules/storageServer/var/install/getGname.php index 7a02033d5..75051942c 100644 --- a/src/modules/storageServer/var/install/getGname.php +++ b/src/modules/storageServer/var/install/getGname.php @@ -6,7 +6,9 @@ header("Content-type: text/plain"); $egid = posix_getegid(); $info = posix_getgrgid($egid); -if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") { +if ( (isset($_SERVER["REMOTE_ADDR"]) && ($_SERVER["REMOTE_ADDR"] == "127.0.0.1")) + || (isset($_SERVER["HTTP_HOST"]) && ($_SERVER["HTTP_HOST"] == "localhost")) + || (isset($_SERVER["SHELL"])) ) { echo $info['name']; } ?> \ No newline at end of file diff --git a/src/modules/storageServer/var/install/getPwd.php b/src/modules/storageServer/var/install/getPwd.php index 67123dd31..f416e57f1 100644 --- a/src/modules/storageServer/var/install/getPwd.php +++ b/src/modules/storageServer/var/install/getPwd.php @@ -4,7 +4,10 @@ *----------------------------------------------------------------------------*/ header("Content-type: text/plain"); -if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") { +//var_dump($_SERVER); +if ( (isset($_SERVER["REMOTE_ADDR"]) && ($_SERVER["REMOTE_ADDR"] == "127.0.0.1")) + || (isset($_SERVER["HTTP_HOST"]) && ($_SERVER["HTTP_HOST"] == "localhost")) + || (isset($_SERVER["SHELL"])) ) { echo `pwd`; } ?> \ No newline at end of file