Gitlab redirecting loop - gitlab

yesterday I installed gitlab on a vm of mine and configured everything to work with it.
Gitlab listens on port 8081 of my domain (e.g. domain:8081).
I have an apache instance which listens to port 80 and 443, so I did a forward there (e.g. domain/git).
Everything worked fine (except the css theme of domain/git, but thats no problem), but then I changed the root url (I think, I don't know how this settings is called) in the admin section directly in gitlab to http://domain/git to let gitlab show me directly this url if I want to copy a URL to clone.
Now I can't access my gitlab instance, because I do have an redirection loop.
I also can't find where the setting was done by gitlab itself, I guess it's stored in the database and not any file.
Can someone help me figure out how to change this particular configuration back to default?
Thanks in advance!

You likely changed the 'homepage url' used for redirecting logged out users. Instead of hitting the domain mainpage, hit /users/sign_in and you should be able to sign back in as your admin user. Go to the admin section, and clear out the setting.
You instead need to go into your config/gitlab.yml (source install) or /etc/gitlab/gitlab.rb (package install) and set the external_url to be the address you wanted.
Then restart/reconfigure the app to have it used in the git clone instructions.

Related

accessing a webpage stored on a home server

I am running a raspberry pi using raspbian linux. I have apache web service installed and when i type in my ip address into the address bar of a browser it loads the default apache webpage saying it all works.
I have another folder located in home/Client5 on this device from which i am trying to load an index.html page but i am recieving a 404 not found error. eg
192.304.0.22/home/Client5/index.html
Not Found
The requested URL /home/Client5/task5.html was not found on this server.
I gather that theres something wrong in the above web adress or is it that i have to place this folder within the apache folder?
You have two solutions.
1/ If you want to keep the default apache pages, add a virtualhost (there are tons of docs on this, I don't think it needs to be repeated here).
2/ If you don't care about the default apache pages, edit /etc/apache2/sites-available/default and change DocumentRoot to make it point to /home/Client5/ . Add an index.html file in there, hit the Raspberry IP in your browser, you should see your page.
You might need to chmod -R ugo+rwX /home/Client5.
I don't know what you have under /home/Client5, but if it's a regular user, this setup is highly insecure. There are a bunch of additional steps to take if you want to host under home directories (first step, don't put pages in $HOME but create a subdir). It is safer to have a dedicated place with proper perms outside home dirs unless you really know what you're doing.
Is it working in local ? (XXX.XXX.X.XX:80) ? Surely yes, so take a look at your router.
If you have apache2, you local ip indicate to folder '/var/www/'.
If you want host page in '/home/Client5' you have to make virtual host :)
#edit
Read about it here

Jenkins URL with own domain

I have installed Jenkins Continues Integration system on my windows server successfully and it works without any errors. But I was unable to get Jenkins URL working with my host domain. The default Jenkins address which is http://localhost:8080 works well. My domain/server name is projectdev so I want to give Jenkins the http://projectdev/jenkins URL so that other developers in my network will be able to access Jenkins dashboard easily.
Although I added http://projectdev/jenkins as the Jenkins URL from the Jenkins configuration sections, it doesn’t work. I can’t access it from other computers in my network. But when I use http://localhost:8080 I can access the dashboard directly.
I also tried to add Jenkins as a web application on IIS and give it the address I want. But I don’t know what to provide as the physical path of Jenkins as it was installed using Jenkins.jar file.
It would be really great if someone can help me to get this done as I want.
Thank you.
You have to configure IIS to re-route requests to {domain}/jenkins to {domain}:8080/jenkins
check the info on:
http://www.iis.net/learn/web-hosting/microsoft-web-farm-framework-20-for-iis-7/setting-up-a-server-farm-with-the-web-farm-framework-20-for-iis
Try this address: http://projectdev:8080/jenkins If you type without 8080 port , the port will be 80 by default.

Direct a URL directly to a GlassFish application in a virtual server

We have a domain name with DNS management facility. We also have a web application developed in a GlassFish server hosted in a virtual server with a path is
http://198.98.103.233:8080/pemis/
I want to direct to the home page of that application when some one type the domain name. After navigating through the pages, we must be able to see
http://www.pemis.lk/faces/public.xhtml
in the browser rather than
http://198.98.103.233:8080/pemis/faces/public.xhtml
How can we configure that.
Thanks in advance.
You need to install your application as the root application in Glassfish, as explained here. But it's not hard:
asadmin deploy --contextroot "/" your-webapp.war
or set the context-root property in the sun-web.xml or glassfish-web.xml depending on the version of Glassfish you use.
To change the port Glassfish listens on you need to modify the HTTP Listener configuration. On default installations you'll want to change http-listener-1's port. You can do so using the console. But you can also directly edit the domain's domain.xml:
<network-listeners>
<network-listener port="80" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
...
</network-listeners>
Last, to make www.pemis.lk point to that server you need a DNS entry that points to the address the server is attached to. The details of how to do that depend on the comapny that sold you the domain, quite often they have online tools that allow you to enter or modify the name-address mapping. In case of doubt it's best to contact them by phone or mail.
I'm on the same path and, as you don't posted the solution that you found (if you found it), I'll add here some future reference for anyone facing this problem.
I'll break the question in two parts: Eliminating host:port and changing how the URL behave.
I don't have a complete response to the first, however if you chose to listen at port 80, by HTML standard, you will supress the port on the URL, getting half the solution you want.
The second part, changing the URL behavior and/or shortening it can be achieved by either using mod_rewrite in apache or Tuckey's URL Rewrite Filter (http://www.tuckey.org/urlrewrite/). A google search using URL Rewrite can achieve you a more in depth explanation and there's a guide on the website.
You should, however, update your question with an answer, if you found one.

How can I give my browser localhost:80/foo.js when it asks for www.productionsite.com/foo.js?

I'm doing work on "foo.js", a previous version of which is currently deployed on "www.productionsite.com". I'd like to see how the new version of foo.js behaves on the production version of productionsite.com before I actually deploy it.
www.productionsite.com loads the script from http://www.productionsite.com/js/somescript.js I'd like to find a way to have my browser load http://localhost:80/js/somescript.js instead
I've worked out a way to do this using apache and mod_proxy:
In /etc/hosts, re-route local.productionsite.com to localhost:80 (apache)
Using mod_proxy, re-route all requests for local.productionsite.com/* to www.productionsite.com/*
Make exceptions in the proxy setup for any assets I want to load locally. i.e.
This gets the job done, but is pretty cumbersome. What a want is a tool (presumably a proxy I'd point my browser to) which I can easily configure to replace specific assets, like:
http://www.productionsite.com/js/somescript.js = http://localhost:80/js/somescript.js
or even
http://www.productionsite.com/js/somescript.js = http://dev.productionsite.com/js/somescript.js
Is there any easier way to do this than what I'm currently doing? I'd prefer a mac os solution, but can use windows too.
I believe that if you set your hosts file to refer back to 127.0.0.1 that should do what you want it to.
C:\WINDOWS\system32\drivers\etc\hosts
or on unix (not sure about mac)
/etc/hosts
Add www.productionsite.com to your 127.0.0.1 entry:
127.0.0.1 localhost <dns_name> www.productionsite.com

IIS: Can I create a host header for an intranet site?

This is a fairly simple question (in my opinion) but for some reason despite my Googling I cannot find a straight answer to it.
Currently I have an application running under my Default Web Site located at http://localhost/myApp. Ideally, I'd like to create a new site in IIS with a binding to 127.0.0.1:80 and a host header of http://myApp so that I can test my url rewriting rules properly (since my app will ultimately be hosted at http://www.myApp.com, not http://www.somedomain.com/myApp).
So, my question is this: will the above work? I haven't had a chance to try it yet.
If the above will not work, what are the steps to be able to access my site at http://myApp on my local network?
It should work provided you fool the OS into resolving www.myapp.com to 127.0.0.1. To do so, edit your hosts file in %systemroot%\system32\drivers\etc to contain the following:
127.0.0.1 myapp.com
I believe you could do just myapp(without the .com) as well, but that gets a bit trickier because how that is resolved depends on your node type. (hybrid, etc) To be safe, add
127.0.0.1 myapp
to BOTH the hosts and LMHosts files in the same directory. By default the lmhosts is non-existent and there is a lmhosts.sam there. You'll have to rename that to just lmhosts or create a new one.
Then create the binding as per usual in IIS7/7.5 (I assume it's 7... Site->Actions->Bindings->Add or Edit->Populate hostname accordingly).. IIS6 will work too but it's alot harder to get https working should you need it.

Resources