Accessing gitblit from an external machine

609 views
Skip to first unread message

karl jones

unread,
Nov 20, 2013, 3:10:50 PM11/20/13
to git...@googlegroups.com
Hello,

I have gitblit running on a windows server. I can access gitblit locally however when I try to access remotely on the same network I can not see it.

The server is also running WAMP which is hosting our wiki so I have used port 8080 for gitblit on http.


-I have changed gitblit from localhost.
-I have disabled firewalls on both the server and the machine attempting to connect.
-I have also disabled WAMP
-If I disable WAMP and set gitblit to use port 80 it works however if I use any other port it fails.

I have managed to set gitblit up on 2 other servers with no problems, I have no idea why this one wont work.

Any suggestions would be great, I am out of ideas :(
Alternatively is there a way I can run gitblit on port 80 alongside our WAMP system? 

Thanks

Karl

James Moger

unread,
Nov 20, 2013, 3:20:27 PM11/20/13
to git...@googlegroups.com
"-If I disable WAMP and set gitblit to use port 80 it works however if I use any other port it fails."

Very suspicious.  And you are sure the firewall is disabled?  Doesn't sound like it.

No two servers can share the same port on the same interface.
You could put a reverse proxy on 80 and have that relay to WAMP & Gitblit.

If your server is multi-homed, perhaps you could bind WAMP to one interface and Gitblit to another.
I use that trick frequently.

-J



--
You received this message because you are subscribed to the Google Groups "gitblit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitblit+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

karl jones

unread,
Nov 20, 2013, 4:53:51 PM11/20/13
to git...@googlegroups.com
Hi James,

I disabled the windows firewall, I will check it again tomorrow to be sure, maybe it has 2 firewalls??
The reverse proxy idea sounds interesting, is that simple to do? 

Karl

James Moger

unread,
Nov 21, 2013, 8:15:56 AM11/21/13
to git...@googlegroups.com
Hi Karl,

I myself do not use the reverse proxy trick very often, although it is very common.  When I have used it, it's been on a Linux box - not a Windows box.  Having said that, you should be able to use nginx or Apache httpd to accomplish this.  Maybe even IIS, but I have 0 experience with that.  I don't have any tutorials for setting this up, but Google can probably help you out here.

-J

karl jones

unread,
Nov 21, 2013, 10:29:29 AM11/21/13
to git...@googlegroups.com

Hi James.

It seems it was an issue with the firewall. Doh. After some further problems we are now stuck again. We are able to run gitblit as a service on our local machine however we would like to have the data folder on a nas drive as its much larger and does backups. So I moved the whole data dir to our nas and used the basedir command to set it however it does not seem to be working. I checked the log and it never gets any further than generating key store cache.

We don't need SSL so can this part be skipped?

Thanks

Karl

--
You received this message because you are subscribed to a topic in the Google Groups "gitblit" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gitblit/fheqJgCPDcM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gitblit+u...@googlegroups.com.

James Moger

unread,
Nov 21, 2013, 10:38:37 AM11/21/13
to git...@googlegroups.com
Sure.  You can skip SSL - just disable the https connector.  I do not recommend storing on a NAS.  There are updating/caching problems with that approach - but maybe it'll work. YMMV.

-J

karl jones

unread,
Nov 22, 2013, 10:38:04 AM11/22/13
to git...@googlegroups.com
Hi James,

It seems using the NAS is not working. I am now running gitblit from my local machine and I changed the git repositories dir to use our NAS dir. This works fine when i run gitblit.cmd however if i run it as a windows service i get an internal error when i try to create a new repository.
I am fairly certain that their is some sort of permission to write to the NAS issue here but cant find a solution. I changed the Windows Service to use a logon that has permissions and still no luck. Do i need to give java special permissions?

Here is my log:

The X drive is my NAS drive.


2013-11-22 15:32:53 Commons Daemon procrun stdout initialized
INFO  ***********************************************************
INFO              _____  _  _    _      _  _  _
INFO             |  __ \(_)| |  | |    | |(_)| |
INFO             | |  \/ _ | |_ | |__  | | _ | |_
INFO             | | __ | || __|| '_ \ | || || __|
INFO             | |_\ \| || |_ | |_) || || || |_
INFO              \____/|_| \__||_.__/ |_||_| \__|
INFO                        Gitblit v1.3.2
INFO  
INFO  ***********************************************************
INFO  Running on Windows Server 2008 R2 (6.1)
INFO  Setting up NIO SelectChannelConnector on port 8080
INFO  Using JCE Standard Encryption Policy files, encryption key lengths will be limited
INFO     allowing SSL renegotiation on Java 1.7.0_45
INFO     certificate alias = localhost
INFO     keyStorePath   = C:\GITBLIT\data\serverKeyStore.jks
INFO     trustStorePath = C:\GITBLIT\data\serverTrustStore.jks
INFO     crlPath        = C:\GITBLIT\data\certs\caRevocationList.crl
INFO  Setting up NIO SslSelectChannelConnector on port 8443
INFO  Gitblit base folder     = C:\GITBLIT\data
INFO  Git repositories folder = X:\GITBLIT\data\git
INFO  Gitblit settings        = C:\GITBLIT\data\gitblit.properties
INFO  Identifying available repositories...
INFO  0 repositories identified with calculated folder sizes in 16 msecs
INFO  JVM timezone is Europe/London (GMT +0000)
INFO  Gitblit timezone is Europe/London (GMT +0000)
INFO  Setting up user service GitblitUserService
INFO  GUS delegating to ConfigUserService(C:\GITBLIT\data\users.conf)
WARN  Mail server is not properly configured.  Mail services disabled.
INFO  Lucene executor is scheduled to process indexed branches every 2 minutes.
WARN  Federation passphrase is blank! This server can not be PULLED from.
INFO  Git Daemon is listening on 127.0.0.1:9418
INFO  preparing 14 day commit cache. please wait...
INFO  0 repositories identified with calculated folder sizes in 0 msecs
INFO  built 14 day commit cache of 0 commits across 0 repositories in 1 msecs
INFO  Shutdown Monitor listening on port 8081
INFO  jetty-7.6.8.v20121106
INFO  Extract jar:file:/C:/GITBLIT/gitblit.jar!/ to C:\GITBLIT\data\temp\webapp
INFO  NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
INFO  started o.e.j.w.WebAppContext{/,file:/C:/GITBLIT/data/temp/webapp/},file:/C:/GITBLIT/gitblit.jar
INFO  [GitBlitWebApp] init: Wicket extensions initializer
INFO  [GitBlitWebApp] init: Wicket core library initializer
INFO  [GitBlitWebApp] Started Wicket version 1.4.21 in deployment mode
INFO  Enabled Protocols [SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2] of [SSLv2Hello, SSLv3, TLSv1, TLSv1.1, TLSv1.2]
INFO  Loading properties files from jar:file:/C:/GITBLIT/gitblit.jar!/com/gitblit/wicket/GitBlitWebApp.properties
INFO  0 repositories identified with calculated folder sizes in 0 msecs
INFO  0 repository models loaded for karl in 0 msecs
INFO  0 repositories identified with calculated folder sizes in 0 msecs
INFO  0 repository models loaded for karl in 0 msecs
INFO  Loading properties files from jar:file:/C:/GITBLIT/ext/wicket-1.4.21.jar!/org/apache/wicket/Application.properties
INFO  create repository test.git
ERROR Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = editForm]] threw an exception
org.apache.wicket.WicketRuntimeException: Method onFormSubmitted of interface org.apache.wicket.markup.html.form.IFormSubmitListener targeted at component [MarkupContainer [Component id = editForm]] threw an exception
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:193)
at org.apache.wicket.request.target.component.listener.ListenerInterfaceRequestTarget.processEvents(ListenerInterfaceRequestTarget.java:73)
at org.apache.wicket.request.AbstractRequestCycleProcessor.processEvents(AbstractRequestCycleProcessor.java:92)
at org.apache.wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:1279)
at org.apache.wicket.RequestCycle.step(RequestCycle.java:1358)
at org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
at org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
at org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
at org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
at com.gitblit.EnforceAuthenticationFilter.doFilter(EnforceAuthenticationFilter.java:87)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:363)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:931)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:992)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.wicket.RequestListenerInterface.invoke(RequestListenerInterface.java:182)
... 33 more
Caused by: org.eclipse.jgit.api.errors.JGitInternalException: Creating directories for X:\GITBLIT\data\git\test.git failed
at org.eclipse.jgit.api.InitCommand.call(InitCommand.java:95)
at com.gitblit.utils.JGitUtils.createRepository(JGitUtils.java:263)
at com.gitblit.GitBlit.updateRepositoryModel(GitBlit.java:2429)
at com.gitblit.wicket.pages.EditRepositoryPage$2.onSubmit(EditRepositoryPage.java:395)
at org.apache.wicket.markup.html.form.Form.delegateSubmit(Form.java:1595)
at org.apache.wicket.markup.html.form.Form.process(Form.java:960)
at org.apache.wicket.markup.html.form.Form.onFormSubmitted(Form.java:922)
... 38 more
Caused by: java.io.IOException: Creating directories for X:\GITBLIT\data\git\test.git failed
at org.eclipse.jgit.util.FileUtils.mkdirs(FileUtils.java:315)
at org.eclipse.jgit.internal.storage.file.FileRepository.create(FileRepository.java:251)
at org.eclipse.jgit.api.InitCommand.call(InitCommand.java:92)
... 44 more
 

James Moger

unread,
Nov 22, 2013, 10:55:48 AM11/22/13
to git...@googlegroups.com
Hi Karl,

Certainly you are having permissions problems.  But even after you resolve that, you are likely to still have trouble with Gitblit identifying repository updates.  The NAS can introduce caching and latency issues.  I advise against this approach.

-J



--
You received this message because you are subscribed to the Google Groups "gitblit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gitblit+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages