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/list3) 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 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: passphrase11) 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 ... b634ebc0a2If 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".
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
). 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.pyfind
- 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
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
. 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 ]