Page 1 of 1

New features

PostPosted: 19. May 2012 19:25
by AndzinSan
Hi, I am interesting if there is some plan to integrate some other servers to the xampp.
Specifically I mean version controll servers like Visual SVN server or/and some GIT server - both with web interface - and SSH.
And web interface for this like TRAC and GitStack?

Re: New features

PostPosted: 19. May 2012 20:58
by Altrea
Hi AndzinSan,

AndzinSan wrote:I am interesting if there is some plan to integrate some other servers to the xampp.

I don't think that it is planed right know. But i think it is an interesting idea.
XAMPP is designed to be as platform independend and portable as portable.
I know that there are some options to get for example git or subversion working from a portable USB-Drive (without SSH i think), but if this also works for linux and solaris, i don't know.

Maybe the best way would be to try it out and write a little description how to get this all working portable with XAMPP. If this is at the end bullet proof we can think about the next step of integration as Module or more.
But this first step has to be done by someone.

best wishes,
Altrea

Re: New features

PostPosted: 20. May 2012 22:15
by AndzinSan
In last few hours, I succesfully implement portable git, gitstack and python with diango do my xampp. But there is one thing whitch is not portable. For using python/diango we have to include mod_wsgi.so, but there is many of them. Version of this depends on version of apache and python. In my case I have to upgrade apache bins and modules in xampp 1.7.7 from version 2.2.21 to 2.2.22 and use python 2.7.2 (apache log report warning that mod_wsgi.so is compiled for python 2.7, but it looks all works).

The thing whitch is not portable is this:
If I just copy python files and dont use installer apache cant start and report that mod_wsgi.so cant find. This is because python must be installed for ALL Users in Windows. So I have to run installer, select install for all users and set install location to owerwrite python copied files. Now it works. There is lot of things what has to be done before everything is running (I have all of this noted but only in my native language - later I will post it here).
At first we must find what is happen where python installer is installing python for all users - what is difference?
If we answer this question, then we can continue.

Re: New features

PostPosted: 20. May 2012 23:35
by Altrea
AndzinSan wrote:I have all of this noted but only in my native language - later I will post it here

That would be great :D

Maybe there is another way of getting mod_wsgi working without the need of installing python. XAMPP is very proud of it's registry and PATH variable independency.

Re: New features

PostPosted: 21. May 2012 21:12
by AndzinSan
Ok, I get lot of experience in last few hours.
Here are my first notes about portable git: (I use this: http://markashleybell.com/articles/port ... t-variable article)

Most of steps are described for XAMPP developers (or users who want integrate git to xampp by theirself).

PLEASE DONT PERFORM ANY STEP BEFORE BACKUP YOUR XAMPP AND AS YOU WILL SEE IN PART 2 ALL THIS STEP ARE RIGHT BUT FINALY UNUSABLE BECAUSE OF DEVELOPMENT STATUS OF GIT WEB MANAGEMENT!

1) Install/unpack XAMPP 1.7.7 to D:\XAMPP_Server\
>>> D:\XAMPP_Server\ can be anything else. This dir I select because I have alredy XAMPP installed here. I recommend any other directory in root!

2) Download PortableGit-1.7.10-preview20120409.7z from google code: http://code.google.com/p/msysgit/downloads/list

3) Unpack PortableGit to D:\XAMPP_Server\gitstack\git\
>>> folder gitstack must be created manualy, it is not included in XAMPP - I use this because later I will use GitStack web interface for git management

4) Copy files from D:\XAMPP_Server\gitstack\:
\git\bin\ibiconv2.dll to \git\libexec\git-core\
\git\bin\ibiconv-2.dll to \git\libexec\git-core\

5) Create folder "home" in D:\XAMPP_Server\gitstack\git\

6) Create folder "xampp" in D:\XAMPP_Server\gitstack\git\home\
>>> this folder will be used by git for store settings, normaly it uses user home directory

7) Open D:\XAMPP_Server\gitstack\git\etc\profile

8) Find and insert before lines:
Code: Select all
# normalize HOME to unix path
HOME="$(cd "$HOME" ; pwd)"

this line:
Code: Select all
HOME="/D/XAMPP_Server/gitstack/git/home/xampp"


9) Create basic account for git as XAMPP. Run D:\XAMPP_Server\gitstack\git\git-bash.bat and run command
git config --global user.name "XAMPP"
git config --global user.email xampp@apachefriends.org
>>> This will create .gitconfig in D:\XAMPP_Server\gitstack\git\home\xampp\ with user.

10) Create SSH keypair like in this manual: http://help.github.com/win-set-up-git/
>>> I recommend create default xampp keypair. It can be deleted by user and he can create his own one.
Default XAMPP keypair can be for example like this:

keypair file: D:\XAMPP_Server\gitstack\git\home\.ssh\id_rsa
identifikation: xampp@localhost.com
passphrase: passphrase


11) Create file D:\XAMPP_Server\gitstack\git\home\xampp\.profile and copy this to it:
Code: Select all
SSH_ENV="$HOME/.ssh/environment"

# start the ssh-agent
function start_agent {
    echo "Initializing new SSH agent..."
    # spawn ssh-agent
    ssh-agent | sed 's/^echo/#echo/' > $SSH_ENV
    echo succeeded
    chmod 600 $SSH_ENV
    . $SSH_ENV > /dev/null
    ssh-add
}

# test for identities
function test_identities {
    # test whether standard identities have been added to the agent already
    ssh-add -l | grep "The agent has no identities" > /dev/null
    if [ $? -eq 0 ]; then
        ssh-add
        # $SSH_AUTH_SOCK broken so we start a new proper agent
        if [ $? -eq 2 ];then
            start_agent
        fi
    fi
}

# check for running ssh-agent with proper $SSH_AGENT_PID
ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null
if [ $? -eq 0 ]; then
    test_identities
# if $SSH_AGENT_PID is not properly set, we might be able to load one from
# $SSH_ENV
else
    . $SSH_ENV > /dev/null
    ps -ef | grep $SSH_AGENT_PID | grep ssh-agent > /dev/null
    if [ $? -eq 0 ]; then
        test_identities
    else
        start_agent
    fi
fi


12) Go to the GitStack github and download source code. This step can be dangerous! There is many revisions. Newest revisions have included their own apache server. So i download and use revision without apache server from: https://github.com/smart-mobile-softwar ... b634ebc0a2
If you download another revision there can be many errors. But this revision have still much issues because it is still in development. When I finish this all, git was working, git web administration from gitstack was working, but I was unable to create repositories from web management. As I say there is still many issues, but I found the way and learn "how to". :D
OK, when you have downloaded this source, unpack it to D:\XAMPP_Server\gitstack\

13) Copy file mod_wsgi.so from D:\XAMPP_Server\gitstack\installation\ to D:\XAMPP_Server\apache\modules\

14) In my case, I am not 100% sure, but mod_wsgi.so must be compiled for specified version of apache and python. I look for GitStack apache and python version and found that apache was version 2.2.22 and python 2.7.2. So, you must upgrade apache binaries in XAMPP for that version, or compile mod_wsgi.so for your version of apache and python. I am not skilled in compilling that means I upgrade my XAMPP apache 2.2.21 (included in XAMPP 1.7.7) to 2.2.22. I was not doing anything with python. Just use included one in GitStack. (Later in apache error log I found this:
Code: Select all
[Mon May 21 08:37:58 2012] [warn] mod_wsgi: Compiled for Python/2.7.
[Mon May 21 08:37:58 2012] [warn] mod_wsgi: Runtime using Python/2.7.2.
but python works, apache works... So this error is not so important how it looks.

15) Edit your httpd.conf file. Insert this lines
Code: Select all
# GitStack configurations
Include conf/extra/gitstack/*.conf

at the end of file after
Code: Select all
# Secure (SSL/TLS) connections
Include conf/extra/httpd-ssl.conf

and insert
Code: Select all
LoadModule wsgi_module modules/mod_wsgi.so
to the LoadModule section in httpd.conf

16) Copy main.conf and wsgi.conf from D:\XAMPP_Server\gitstack\installation\ to D:\XAMPP_Server\apache\conf\extra\gitstack\

17) Now open D:\XAMPP_Server\apache\conf\extra\gitstack\main.conf and comment line with
Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so
this is because XAMPP has this module loaded in httpd.conf in modules section. (I am not sure if this module is enabled by default in XAMPP, if not just enable it in httpd.conf)
Find all C:/dev/gitstack/ in this file (2 times) and replace it with your instalation directory, i.e. D:/XAMPP_Server/gitstack/.

18) Open D:\XAMPP_Server\apache\conf\extra\gitstack\wsgi.conf and edit it to support virtual hosts (dont forgot enable virtual hosts module in httpd.conf). This have to be done, because when I let this as default, all my sites was presented as python and nothing what I have on localhost and previously work stops work. So edit will be looks like:
Code: Select all
# Django Settings
<VirtualHost *:80>
    DocumentRoot "D:/XAMPP_Server/gitstack/app"
    #ServerName you can choose what you want, or you can specify localhost subdomain, like django.localhost or gitstack.localhost etc...
    ServerName diango
    WSGIScriptAlias / D:/XAMPP_Server/gitstack/app/django.wsgi
    <Directory "D:/XAMPP_Server/gitstack/app">
      Options Indexes FollowSymLinks
      AllowOverride All
      Order allow,deny
      Allow from all
      <Files django.wsgi>
          Order deny,allow
          Allow from all
       </Files>
    </Directory>
    # Non Django directories
    Alias /static D:/XAMPP_Server/gitstack/app/staticfiles/
    <Location "/static">
       SetHandler None
    </Location>
</VirtualHost>
with this, all Servers include localhost I have previously created are running on PHP, but only this one virtual host is running GitStack python app.

You can edit WSGIScriptAlias for non-root. For example as /gitstack/
Code: Select all
WSGIScriptAlias /gitstack/ D:/XAMPP_Server/gitstack/app/django.wsgi
and let it in non virtual host. In this case, gitstack app running on python should be on adress localhost/gitstack/, all others should be on PHP. It should be work, but I dont test this.

19) Now when you you open your virtual host diango or any other you set (django.localhost, gitstack.localhost or localhost/gitstack/) in browser (dont forget run apache before it :D ). You got apache error 500. Detailed error trac you can find in apache error logs. This error appears because in GitStack python files are not correct sets paths. GitStack have sets it to path C:\dev\gitstack but we have gitstack in D:\XAMPP_Server\gitstack\. So open and edit this files and lines:
[quote=D:\XAMPP_Server\gitstack\app\django.wsgi]replace all C:/dev/ to D:/XAMPP_Server/[/quote]
[quote=D:\XAMPP_Server\gitstack\app\settings.py]replace all C:/dev/ to D:/XAMPP_Server/[/quote]

20) Open diango (or any other you set: django.localhost, gitstack.localhost or localhost/gitstack/) in browser and you will see gitstack error 404. This is OK. To run property you must set diango/gitstack (or django.localhost/gitstack/, gitstack.localhost/gitstack/ or localhost/gitstack/gitstack/). This needs some work for property set mod_rewrite conditions in main.conf and in D:\XAMPP_Server\gitstack\app\urls.py for work python only in adresses (localhost/gitstack; localhost/registration and localhost/rest) - these are parts of gitstack - and let other adresses works with PHP. Because I have running gitstack on virtual host diango, I have test only fix error 404 on index page. This can be done by editing D:\XAMPP_Server\gitstack\app\urls.py
find
Code: Select all
    #url(r'^$', 'app.views.home', name='home'),

and inser before it this
Code: Select all
    url(r'^$', include('gitstack.urls')),

Now when you open index page of your virtual host you will see index page of gitstack.

21) Now stay tuned because hard work just start :D and I dont have done everything from this step, yet.
Because we have changed paths of apache relative to the gitstack dir, we must edit all paths in all gitstack app source code. Tired work :(. For now, I dont finish with this, I am still looking for code. But merits is that this source islooking for apache and its configurations in GitStack installation dir (variable can be found in D:\XAMPP_Server\gitstack\app\settings.py) whitch is set to D:\XAMPP_Server\gitstack\. Maybe enough to set this variable to D:\XAMPP_Server\ but I am not sure if there is some conflict with this. So we must find all of the code and check it.

For example:
file D:\XAMPP_Server\gitstack\app\gitstack\models.py line 16
Code: Select all
            subprocess.Popen(settings.INSTALL_DIR + '/apache/bin/httpd.exe -n "GitStack" -k restart')
it looks for apache in D:/XAMPP_Server/gitstack/apache/bin/httpd.exe -n "GitStack" -k restart, that is wrong. And name of service is wrong too. It must be set as name of apache service installed by XAMPP!

file D:\XAMPP_Server\gitstack\app\gitstack\models.py line 198
Code: Select all
        config_folder_path = settings.INSTALL_DIR + '/apache/conf/gitstack/repositories'
it is set repositories config files to D:/XAMPP_Server/gitstack/apache/conf/gitstack/repositories but it is wrong because of our XAMPP is not loading configs from this directory.

When I was trying gitstack web interface there was some issues, so I try tu update gitstack app sources to nevest revision from git, but there was another issues - sucks. For example apache cant start because of mising LDAP module in python.

Conclusion? This is not the way! But all this work was not in vain, I learn much about it and now I have some experience. I will try another method: Install last release of GitStack from their home page (not from git) and try integrate this to XAMPP. I hope there will not be issues in web management. Yesterday I succefully installed GitStack 2.0.2 for my second computer where was never been XAMPP, python or other server installed - clear system :D. And there appears another issues, but I was abble to quickly fix it - (look at gitstack github issues number 91 where I post it - https://github.com/smart-mobile-softwar ... /issues/91).

Because I have Master of Science final exams and thesis defense next week, and admissions for dissertation next mont, I will be back for work on this at end of june - thanks for patience.

[EDIT by Altrea: Helping to link the anchors :D]

Re: New features

PostPosted: 22. May 2012 10:09
by AndzinSan
Part II added. Look at previous post from point 16)

Re: New features

PostPosted: 18. December 2012 18:30
by AndzinSan
Hi, after a six months I am back with some new experiences.

At first, forgot everything from my first tutorial. I found better way. It is XAMPP + git + Redmine, no python needed, no unfinished gitstack, but needs Ruby on rails :D
So now I have not prepared tutorial but my server(s) now work with git via Redmine.

Later I will be post tutorial for you, if you want it.

Re: New features

PostPosted: 18. December 2012 18:54
by brunoais
please do!