Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 28th August 2011, 03:41
nveid nveid is offline
Member
 
Join Date: Jan 2006
Location: Daytona Beach, FL
Posts: 87
Thanks: 7
Thanked 17 Times in 14 Posts
Send a message via Yahoo to nveid Send a message via Skype™ to nveid
Default 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?
__________________
-- RLB
Reply With Quote
Sponsored Links
  #2  
Old 28th August 2011, 05:28
nveid nveid is offline
Member
 
Join Date: Jan 2006
Location: Daytona Beach, FL
Posts: 87
Thanks: 7
Thanked 17 Times in 14 Posts
Send a message via Yahoo to nveid Send a message via Skype™ to nveid
Default

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
config.inc.php mysql_clientdb.conf
At /usr/local/ispconfig/interface/lib
config.inc.php
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.

EDIT:
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 @@
<?php
-
/*
Copyright (c) 2007-2011, Till Brehm, projektfarm Gmbh
All rights reserved.
@@ -28,8 +27,11 @@
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

-require('lib/config.inc.php');
-require('lib/app.inc.php');

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


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

2. At server/lib/app.inc.php, the code explicitly disallows symbolic linked classes. This is the diff I did to allow this changed.
--- a/server/lib/app.inc.php
+++ b/server/lib/app.inc.php
@@ -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')) {

include_once($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')) {
include_once($conf['classpath'].'/'.$classname.'.inc.php');
} else {
die('Unable to load: '.$conf['classpath'].'/'.$classname.'.inc.php');
__________________
-- RLB

Last edited by nveid; 29th August 2011 at 01:25. Reason: Road Block in setup
Reply With Quote
The Following User Says Thank You to nveid For This Useful Post:
falko (28th August 2011)
  #3  
Old 29th August 2011, 10:43
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,975
Thanks: 825
Thanked 5,367 Times in 4,214 Posts
Default

Might be better to define e.g. a constant like "devsystem" in config.inc.php that is checked if security functions should be disabled instead of removing the code to protect the function from loading symlinks.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #4  
Old 29th August 2011, 12:37
nveid nveid is offline
Member
 
Join Date: Jan 2006
Location: Daytona Beach, FL
Posts: 87
Thanks: 7
Thanked 17 Times in 14 Posts
Send a message via Yahoo to nveid Send a message via Skype™ to nveid
Default

Ok, submitted a revision whereas there is a define for DEVSYSTEM in config.inc.php defaulting to 0. Set to 1, it allows the classes to be loaded as symbolic links.
__________________
-- RLB
Reply With Quote
The Following 4 Users Say Thank You to nveid For This Useful Post:
falko (30th August 2011), Mark_NL (30th August 2011), till (29th August 2011), vStone (2nd September 2011)
  #5  
Old 9th September 2011, 13:53
Mark_NL Mark_NL is offline
Senior Member
 
Join Date: Sep 2008
Location: The Netherlands
Posts: 912
Thanks: 12
Thanked 100 Times in 96 Posts
Default

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
- DEVSYSTEM = 1
- 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?
Reply With Quote
  #6  
Old 9th September 2011, 15:06
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,975
Thanks: 825
Thanked 5,367 Times in 4,214 Posts
Default

Have you enabled loglevel debug and then executed the server.sh script manually to see which exact error you get?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos5.4/ISPConfig 3--Virtual site not working MichaelCaditz Installation/Configuration 25 25th March 2011 11:37
Virtual Users+Postfix+Courier+CentOS problem telnet localhost 25 stinson HOWTO-Related Questions 11 5th February 2011 13:57
ISPConfig3 Mail Warn Errors reason8 General 3 25th November 2009 13:58
I don't recieve mail. privir Installation/Configuration 2 3rd June 2009 22:08
What can be wrong martin_rudowicz Installation/Configuration 9 11th May 2008 19:42


All times are GMT +2. The time now is 14:16.


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