4803 Posts in 1980 Topics by 1446 members
Page: 1 2
|Go to End||Next >|
11 November 2009 at 10:09pm
Quick question. I am trying to automate my deployment process a bit. One thing I am trying to do is make the core silverstripe codebase available to each virtual host on my server through ScriptAlias in my apache config, like this:
ScriptAlias /sapphire /var/www/silverstripe/2.3.3/sapphire
ScriptAlias /cms /var/www/silverstripe/2.3.3/cms
ScriptAlias /jsparty /var/www/silverstripe/2.3.3/jsparty
Trouble is, because the .htaccess directs to sapphire/main.php, I am having trouble getting Apache to execute this file from an aliased directory. Anyone done this or have any ideas?
11 November 2009 at 11:29pm
I'm using symbolic links for local development. Meaning: I have a SilverStripe 2.3.3 codebase and all it's folders (cms, sapphire, etc.) are being symlinked into all my projects.
I even created a shell script that automatically creates a new folder, creates the links, the database and runs /dev/build
If you have access to a shell on your server, then this is probably the better solution.
12 November 2009 at 12:17am
I tried to use sym links a well, they worked for the most part, but I get an issue with generating an error log. Debug doesn't seem to like being located outside the site route. Keeps saying it cant locate my error log file :s.
12 November 2009 at 12:27am
That's strange, it works fine here. Are you talking about the apache, or php error log? Can't you set the path for that somewhere?
The only thing I had to change in the SilverStripe codebase was the Image class, since it used "hard-coded" paths to the asset folder (as described in this post: http://silverstripe.org/general-questions/show/251650?start=24).
If you wish I can post my shell script here, although it was written for Mac OS X.
12 November 2009 at 12:37am
I was talking about Debug::log_errors_to();
12 November 2009 at 12:44am Last edited: 12 November 2009 1:09am
And if you put something like this in your /mysite/_config.php:
Debug::log_errors_to(Director::baseFolder() . '/error.log');
Should create the log file in your current site root.
Update: After looking at the Debug class I noticed that Debug::log uses "relative to __FILE__" paths which won't work with symlinks. Are you using Debug::log by any chance?
Update 2: looks like Debug::log_error_if_necessary is also creating some strange paths. WTF at the following:
$shortFile = "../" . self::$log_errors_to;
I guess this wasn't meant to be used with absolute paths. There's room for improvement here, I guess I will submit it as a patch, so that it works with symlinked installs (they already changed the Image class in that respect, so why not do the same for Debug)
Update 3: Ah. Another update..
Just had a look at the Debug class in 2.4-alpha1 and saw that the log_errors_to will be replaced with a Wrapper around Zend_Log (SS_Log). That should give much more flexibility (I love Zend_Log) and solve this issue once 2.4 is out. I guess there's no point in patching the old Debug class. I suggest you simply modify the Debug.php file to use paths that work with the symlinked install (Director::baseFolder() comes to mind, or use a defined constant)
12 November 2009 at 1:26am
I think we must be sharing a similar brainwave frequency Banal, just done exactly what you suggested .
I have set my 2.4 test site up to use zend log, I think you are right about it being more flexible .
12 November 2009 at 1:53am
When using Zend_Log, be sure to check out the FirePHP log-writer. It's awesome:
Page: 1 2
|Go to Top||Next >|