HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Developers' Forum (
-   -   preparing dev server to work off svn (

nveid 28th August 2011 04:41

preparing dev server to work off svn
I'm trying to prepare my server to work off of svn, curious if some other developers can help me with how they manage this?

1) What config files do I need to copy from my current live installation to the svn installation in order for it to work correctly when I switch my test system over?

2) Is there a database update script I can run while running my system ISPConfig directly off subversion repo checkout?

nveid 28th August 2011 06:28

Welp.. Answered my own question & thought I'd give the quickest setup to someone who might search the forums in the future.

1. do your svn check out as normal

2. cp -sr /path/to/your/svn /path/for/a/copy

3. Backup Up the following configuration files:
At /usr/local/ispconfig/server/lib mysql_clientdb.conf
At /usr/local/ispconfig/interface/lib
4. Get rid of your server/interface directories, and move your symbolic link farms into the place of server/interface.

5. Move your configuration files back in place.. Everything should be peachy.

Now when you make changes or when your pulling new changes svn diff works correctly off your work to the repo.

And the update script in install/ directory works beautiful without not affecting my setup & just updating sql entries in the database.

There is 2 limitations preventing this setup, however I solved it in my current checkout(I'm using git-svn.. so I just stash my changes I'm not committing), if Falko or Till say its okay I'll commit these changes. Basically its this..
1. At server.php.. Its using a require(), its not so symbolic link friendly.. Have to specify an absolute path. So here's the needed change.

diff --git a/server/server.php b/server/server.php
old mode 100644
new mode 100755
index c171d48..967d13a
--- a/server/server.php
+++ b/server/server.php
@@ -1,5 +1,4 @@
Copyright (c) 2007-2011, Till Brehm, projektfarm Gmbh
All rights reserved.
@@ -28,8 +27,11 @@


+// $script_path allows development work of using a symbolic link farm
+// to use along side git or svn
+$script_path = dirname($_SERVER["SCRIPT_FILENAME"]);

ini_set('error_reporting', E_ALL & ~E_NOTICE);

2. At server/lib/, the code explicitly disallows symbolic linked classes. This is the diff I did to allow this changed.
--- a/server/lib/
+++ b/server/lib/
@@ -75,7 +75,8 @@ class app {
if(is_array($cl)) {
foreach($cl as $classname) {
if(!@is_object($this->$classname)) {
- if(is_file($conf['classpath'].'/'.$classname.'.inc.php') && !is_link($conf['classpath'].'/'.$classname.'.inc.php')) {
+ // Nveid: Why was this protected against links?
+ if(is_file($conf['classpath'].'/'.$classname.'.inc.php') || is_link($conf['classpath'].'/'.$classname.'.inc.php')) {

$this->$classname = new $classname;
@@ -91,7 +92,7 @@ class app {
$cl = explode(',',$classes);
if(is_array($cl)) {
foreach($cl as $classname) {
- if(is_file($conf['classpath'].'/'.$classname.'.inc.php') && !is_link($conf['classpath'].'/'.$classname.'.inc.php')) {
+ if(is_file($conf['classpath'].'/'.$classname.'.inc.php') || is_link($conf['classpath'].'/'.$classname.'.inc.php')) {
} else {
die('Unable to load: '.$conf['classpath'].'/'.$classname.'.inc.php');

till 29th August 2011 11:43

Might be better to define e.g. a constant like "devsystem" in that is checked if security functions should be disabled instead of removing the code to protect the function from loading symlinks.

nveid 29th August 2011 13:37

Ok, submitted a revision whereas there is a define for DEVSYSTEM in defaulting to 0. Set to 1, it allows the classes to be loaded as symbolic links.

Mark_NL 9th September 2011 14:53

I'm having trouble using this method ..

It works silky smooth for "just" editing files.

The problem i have is this:

- Clean os install
- svn checkout
- install ispconfig
- create a website -> OK!
- backup config libs
- delete interface / server dirs
- cp -sr /usr/src/trunk /usr/src/copy
- copy interface / server dirs to /usr/local/ispconfig
- restore config libs
- create a website -> NOT OK!

The Apache config files, the web folders etc, nothing is created on the system.

Did I miss something? or was this a "know problem" when using this method?

till 9th September 2011 16:06

Have you enabled loglevel debug and then executed the script manually to see which exact error you get?

Mark_NL 9th September 2011 19:29

Yes i did, when it's not working i only get this:

root@ispc3dev:/usr/local/ispconfig# /usr/local/ispconfig/server/
09.09.2011-13:34 - DEBUG - Set Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock
09.09.2011-13:34 - DEBUG - Found 1 changes, starting update process.
09.09.2011-13:34 - DEBUG - Processed datalog_id 13
09.09.2011-13:34 - DEBUG - Remove Lock: /usr/local/ispconfig/server/temp/.ispconfig_lock

when it does work i get a whole lot of other debug info.

nveid 7th October 2011 03:39

Your using define('DEVSYSTEM',1) in in ~/server/lib/ right? Check your permissions as well and the /var/log/ispconfig/cron.log, could be that and doesn't have the correct permissions (thats happened a couple times with me, had to change the permissions back). Oh, and check the permissions in the repo directory since its symbolically linked.

All times are GMT +2. The time now is 11:33.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.