fredistrano trying to create my httpdocs folder when it already exists

5 views
Skip to first unread message

travisbeck

unread,
Feb 12, 2009, 1:08:29 AM2/12/09
to fredistrano-discuss
the absolute path to my sites project directory is

/var/www/vhosts/simpleapp.net/httpdocs/

the project exports to the temp directory but throws the following
errors


--STEP--------------------------------
[step name] synchronize
[took] 0.004 secondes
Error : [createDirectory] > Unable to create directory /var/www/vhosts/
simpleapp.net/httpdocs/
--------------
[user]
--ACTION------------------------------
[name] createDirectory [type] ShellAction
[description] Creating /var/www/vhosts/simpleapp.net/httpdocs/ with
mode 755
[took] 0 secondes
Error : Unable to create directory /var/www/vhosts/simpleapp.net/
httpdocs/


why is it trying to create a directory that already exists?

euphrate_ylb

unread,
Feb 13, 2009, 5:06:09 PM2/13/09
to fredistrano-discuss
Hi,

I have double checked the code and I really don't understand how your
problem can happen. There should be a problem with the file
permissions...

To try to solve your issue:
- Remove the target production directory ( /var/www/vhosts/
simpleapp.net/httpdocs/ ),
- Check if the apache user has the write permission on the parent
folder ( ls -lisa /var/www/vhosts/simpleapp.net/ ),
- Let fredistrano recreate your production environnement.

Regards,

euphrate_ylb

travisbeck

unread,
Feb 14, 2009, 1:29:24 PM2/14/09
to fredistrano-discuss
ok, i renamed the httpdocs to httpdocs.bak

then i "chown apache:apache /var/www/vhosts/simpleapp.net"
then "chmod 775 /var/www/vhosts/simpleapp.net"

still same error.

I checked php.ini and safemode is off and there are no restricted
commands.

here is an exceprt from php.ini


;
; Safe Mode
;
safe_mode = Off

; By default, Safe Mode does a UID compare check when
; opening files. If you want to relax this to a GID compare,
; then turn on safe_mode_gid.
safe_mode_gid = On

; When safe_mode is on, UID/GID checks are bypassed when
; including files from this directory and its subdirectories.
; (directory must also be in include_path or full path must
; be used when including)
safe_mode_include_dir =

; When safe_mode is on, only executables located in the
safe_mode_exec_dir
; will be allowed to be executed via the exec family of functions.
safe_mode_exec_dir =

; Setting certain environment variables may be a potential security
breach.
; This directive contains a comma-delimited list of prefixes. In Safe
Mode,
; the user may only alter environment variables whose names begin with
the
; prefixes supplied here. By default, users will only be able to set
; environment variables that begin with PHP_ (e.g. PHP_FOO=BAR).
;
; Note: If this directive is empty, PHP will let the user modify ANY
; environment variable!
safe_mode_allowed_env_vars = PHP_

; This directive contains a comma-delimited list of environment
variables that
; the end user won't be able to change using putenv(). These
variables will be
; protected even if safe_mode_allowed_env_vars is set to allow to
change them.
safe_mode_protected_env_vars = LD_LIBRARY_PATH

; open_basedir, if set, limits all file operations to the defined
directory
; and below. This directive makes most sense if used in a per-
directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
;open_basedir =

; This directive allows you to disable certain functions for security
reasons.
; It receives a comma-delimited list of function names. This directive
is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_functions =

; This directive allows you to disable certain classes for security
reasons.
; It receives a comma-delimited list of class names. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
disable_classes =



Do you see anything there?

euphrate_ylb

unread,
Feb 15, 2009, 6:17:18 AM2/15/09
to fredistrano-discuss
Really weird... but we won't let you down.

In the file [fredistrano]/app/config/core.php on line 43, change the
code from:

> Configure::write('debug', 0);

To

> Configure::write('debug', 1);

In the file [fredistrano]/app/vendors/fbollon/commands.php on line
217, change the code from:

> // $path = Utils::formatPath($path);
>> if (!@mkdir($path, octdec( $mode ), TRUE)) {
> $actionLog->error( sprintf(__('Unable to create directory %s',
true), $path) );
> }

To

> // $path = Utils::formatPath($path);
>> if (!mkdir($path, octdec( $mode ), TRUE)) {
> $actionLog->error( sprintf(__('Unable to create directory %s',
true), $path) );
>}

If you deploy again your project, you should see an explanatory error
message...


euphrate_ylb

travisbeck

unread,
Feb 15, 2009, 5:23:02 PM2/15/09
to fredistrano-discuss
OK, we're getting closer.

i get these warnings now.


Warning (2): is_dir() [function.is-dir]: open_basedir restriction in
effect. File(/var/www/vhosts/simpleapp.net/httpdocs/) is not within
the allowed path(s): (/var/www/vhosts/simpleapp.net/subdomains/deploy/
httpdocs:/tmp) [APP/models/deployment.php, line 286]

Code | Context

$options = array(
"simulation" => false,
"runBeforeScript" => false,
"backup" => false,
"comment" => "Revision exported 30",
"stepLog" => StepLog
StepLog::$childType = "ActionLog"
StepLog::$data = NULL
StepLog::$logs = array
StepLog::$context = array
StepLog::$name = "synchronize"
StepLog::$startTime = 1234735678.3046
StepLog::$endTime = NULL
StepLog::$elapsedTime = 0
StepLog::$error = NULL
StepLog::$attached = false
)
$default_options = array(
"simulation" => true,
"runBeforeScript" => false,
"backup" => false,
"comment" => "none"
)
$projectTmpDir = "/var/www/vhosts/simpleapp.net/subdomains/deploy/
httpdocs/files/tmp/Adit/"

is_dir - [internal], line ??
Deployment::_synchronize() - APP/models/deployment.php, line 286
Deployment::_runStep() - APP/models/deployment.php, line 185
Deployment::process() - APP/models/deployment.php, line 98
DeploymentsController::runAutomatic() - APP/controllers/
deployments_controller.php, line 93
Object::dispatchMethod() - CORE/cake/libs/object.php, line 116
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 256
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 230
[main] - APP/webroot/index.php, line 84

Warning (2): is_dir() [function.is-dir]: open_basedir restriction in
effect. File(/var/www/vhosts/simpleapp.net/httpdocs/) is not within
the allowed path(s): (/var/www/vhosts/simpleapp.net/subdomains/deploy/
httpdocs:/tmp) [APP/vendors/fbollon/commands.php, line 211]

Code | Context

$path = "/var/www/vhosts/simpleapp.net/httpdocs/"
$mode = "755"
$options = array(
"stepLog" => StepLog
StepLog::$childType = "ActionLog"
StepLog::$data = NULL
StepLog::$logs = array
StepLog::$context = array
StepLog::$name = "synchronize"
StepLog::$startTime = 1234735678.3046
StepLog::$endTime = NULL
StepLog::$elapsedTime = 0
StepLog::$error = NULL
StepLog::$attached = false
)
$comment = "Creating /var/www/vhosts/simpleapp.net/httpdocs/ with mode
755"
$actionLog = ActionLog
ActionLog::$type = "ShellAction"
ActionLog::$description = "Creating /var/www/vhosts/simpleapp.net/
httpdocs/ with mode 755"
ActionLog::$command = NULL
ActionLog::$result = NULL
ActionLog::$name = "createDirectory"
ActionLog::$startTime = 1234735678.3147
ActionLog::$endTime = NULL
ActionLog::$elapsedTime = 0
ActionLog::$error = NULL
ActionLog::$attached = true

is_dir - [internal], line ??
ShellAction::createDirectory() - APP/vendors/fbollon/commands.php,
line 211
Deployment::_synchronize() - APP/models/deployment.php, line 292
Deployment::_runStep() - APP/models/deployment.php, line 185
Deployment::process() - APP/models/deployment.php, line 98
DeploymentsController::runAutomatic() - APP/controllers/
deployments_controller.php, line 93
Object::dispatchMethod() - CORE/cake/libs/object.php, line 116
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 256
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 230
[main] - APP/webroot/index.php, line 84

Warning (2): mkdir() [function.mkdir]: open_basedir restriction in
effect. File(/var/www/vhosts/simpleapp.net/httpdocs/) is not within
the allowed path(s): (/var/www/vhosts/simpleapp.net/subdomains/deploy/
httpdocs:/tmp) [APP/vendors/fbollon/commands.php, line 217]


I checked the php.ini file again and open_basedir is commented out
like so.

; open_basedir, if set, limits all file operations to the defined
directory
; and below. This directive makes most sense if used in a per-
directory
; or per-virtualhost web server configuration file. This directive is
; *NOT* affected by whether Safe Mode is turned On or Off.
;open_basedir =

I'm going to check if this is also defined for the sited in the
httpd.include file in /var/www/vhosts/simpleapp.net/conf/

Yann Le Blevec

unread,
Feb 16, 2009, 2:57:16 AM2/16/09
to fredistra...@googlegroups.com
This is a promising lead. Keep us informed.

Yann

travisbeck

unread,
Feb 16, 2009, 9:26:15 PM2/16/09
to fredistrano-discuss
UPDATE:

The httpd.include file in /var/www/vhosts/simpleapp.net/conf/ did in
fact have a restricting open_basedir line in it for the my virtual
host. i simply removed this line. I will later change it to just go
up to /var/www/vhosts/simpleapp.net/ for security reasons.

I renamed my httpdocs folder and changed the owner of simpleapp.net to
apache:apache and redeployed successfully except for one major
caveat. none of my .htaccess files are showing up. the logs mention
them being copied over but they are not there and this obviously
breaks my app. So one major problem remedied another emerged.



On Feb 16, 1:57 am, Yann Le Blevec <yann.leble...@gmail.com> wrote:
> This is a promising lead. Keep us informed.
>
> Yann
>

travisbeck

unread,
Feb 17, 2009, 10:49:28 AM2/17/09
to fredistrano-discuss
it seems that the .htaccess file not being copied over was just a
fluke, everything works splendidly now. Thank you for helping me out
with this.
> ...
>
> read more »

Yann Le Blevec

unread,
Feb 17, 2009, 11:23:01 AM2/17/09
to fredistra...@googlegroups.com
Your welcome. Glad we could help. I hope you'll enjoy fredistrano now!

BTW, you may also use this forum to share your feedbacks.

Yann
Reply all
Reply to author
Forward
0 new messages