I developed a Ruby website and in order to deploy it, I followed this tutorial. Everything went well, but I skipped all user switching operations because I really didn't see the point of it, and to be honest maybe this is the problem.
My problem is that the server is running, as we can see
And I can do a successful curl on it using the local machine, but I can't access it online.
To be honest, it's the first time I'm deploying a website ever so I'm sure I'm just missing an obvious thing (a DNS maybe), but I don't really know what.
The problem might also come from the fact that I'm using the passenger and Nginx binaries given by the passenger gem installed. I didn't install passenger and Nginx on my system so it's using the binaries from the gem.
EDIT:
Thanks all for the current answers, I think the problème, as stated by the first comment under this question is that I'm not using the default server port configured by Nginx but another one, so I'm gonna try to add my port in the Nginx config file.
And to clarify a bit, because I don't have a server name, I'm running my tests using :
curl ipaddress:port
EDIT 2:
I just tried looking at the config file and it appears that the passenger is generating an Nginx config file (because it uses its own Nginx standalone binary to run) that looks like that, so the port must not be not the problem.
Maybe I really have no choice but to use port:80 but now I'm not even sure if I can ping the Nginx standalone from outside my VM, I'm a total beginner with Nginx
EDIT 3:
A netstat gives me this
So the nginx server is really running, but how can I access it? Because curl ipaddress:8080 (I changed the port since the first try with 90 and replaced it with 8080) is not working. But on the local machine a curl on 0.0.0.0:8080 is still working.
I built a site using Roots' Trellis that now uses CloudFlare, thus proxying traffic. Which, understandably, prevents Trellis from deploying via MyExample.com.
I’m aware I can connect via IP or an un-proxied CName (Ex. ssh.MyExample.com). But I am unclear about which file(s) I edit in Trellis so the deploy uses the IP or un-proxied domain.
It seems that editing the /hosts/production file would do the trick, but the rest of the Roots ecosystem depends on the values in these files I'm afraid that re-running the deploy with corrupt the server. This has been my experience with similar issues in the past.
Can anyone confirm the steps to achieve this?
Edit /trellis/hosts/production at lines 5 and 8, below [production] and [web] and update it with the un-proxied domain (ex. ssh.myexample.com).
Save, and Git commit your change.
Navigate to the /trellis/ directory and run your deploy using the proxied domain. Ex. ./bin/deploy.sh production myexample.com
I wanted to set up a simple go server in a webhost. I acquired a domain mydomain.com and hosted it using Bluehost. Now, going through the Go tutorial, I went through this example http://tour.golang.org/#59 and it works fine on my machine. Now, instead, I want to make the HelloWorldServer work when I call mydomain.com:4000 or some other port.
What I did was ssh to my server at bluehost, install go there, then compile the server and run. But then I try to access mydomain.com:4000 and it is not found. I also tried to change "localhost:4000" to just ":4000". any ideas how to make it work ?
Any help or pointers are appreciated. (some more details: it is a shared-hosting account)
This is due to the firewall on your BlueHost server not having ports (including 4000) open on a shared hosting account, Firewall Port Restrictions
If you want to do some simple (and not so simple) web hosting, why don't you look at Google App Engine
I have gitlab running behind a proxy, gitlab itself running on port 3000 not accessible from outside.
Mail notifications generated by gitlab always contain URLs with port 3000 in them, so where can I configure gitlab to generate links accessible from outside?
I already found
gitlab email setup
but I do not have email:host: or anything like that in my gitlab.yml
I'm running gitlab 5.2.0 right now.
EDIT: I would also appreciate any link to some info about the config options in gitlab.yml...
The setting is indeed in gitlab/config/gitlab.yml, it just isn't that clear anymore (config names and comments changed in gitlab 5.0 I think).
The section ## Web Server Settings is actually used to generate the links in emails. The only settings referring to emails are email_from: and support_email: but host:, port: and https: are also used for links in emails.
The actual IP and port settings can be found in puma.rb config file which is why I was confident enough to just tinker around with the gitlab.yml settings and it worked.
Solution for my problem: just comment the production:gitlab:port: setting or change it to your external port.
I suspect that the corporate firewall is preventing gems from getting installed. I have HTTP_PROXY defined and I'm able to view remote gems via the following command:
jruby -S gem list -r
But when I go to install a gem, I get a 404:
jruby -S gem install rails
Is there a good workaround for resolving this issue other than maintaining an internal gem repository?
for ruby gems, placing this in my gem.bat this works for me
#"%~dp0ruby.exe" "%~dpn0" %* --http-proxy http://domainname.ccc.com:8080
for jruby gems this works
#"%~dp0jruby.exe" "%~dpn0" %* -p http://domainname.ccc.com:8080
Also setting the environment variable works like
set http-proxy=http://domainname.ccc.com:8080
or if your proxyserver needs authentication
set http-proxy=http://user:password#host:port)
EDIT: for folks who have a very restrictive firewall or no internet accesss (eg on a server) you can do the following: install the gem(s) on a pc who has free access to internet, afterward you check the folder C:\Ruby193\lib\ruby\gems\1.9.1\cache and copy all the gems with a date last modified after the moment you did your install. On the target pc you copy them in the same folder or if you clean up afterward in your bin folder and start the install there with
c:\ruby193\bin\gem.bat install --local gemname-x.x.x.gem
gemname-x.x.x.gem being the gem filename of the base gem you want to install. The gem with all its dependencies should install. This is for windows, but other OS's can use the same technique, just adapt a few things.
Success
Look in Internet Explorer proxy settings to find the name of your proxy server.
Use the name of your proxy server in the -p option to the gem command.
gem update rails -p http://mylocalproxy.mycompany.com
If this doesn't work, you can always set your own proxy server up on the internet somewhere.
I'm not an expert with Ruby. None the less I might give the following "generic" advices (useful for lots of situations with installers) :
Check which protocol is the installation running over. Some installer download package from mirror instead of main site, and some mirrors might be using FTP or something else instead of HTTP. Thus you might need to update your settings accordingly, and check with your admin that the corporate proxy is able to retrieve data from FTP sites.
Check which user the installer is running as (some of the installer have to escalate privileges to "root". And therefore inherit a different environment with another HTTP_PROXY defined).
Check what the installer program is using to download the packages (lots of distribution package managers rely on curl/libcurl which stores its proxy parameters in a rc file). Same warning as 2 regarding the users whose homedir should contain the rc file.
Transparent proxying : it is possible to transfer on-the-fly HTTP/FTP requests initially targeting the web to a proxy. Either the corporate proxy (if it can work with such an installation) or some mini local proxy which will then cascade to the corporate one.
Setup a quick VPN (either Tunnel other PPP) over SSH (see SSH's man page) between your machine and a special machine within the corporation which is allowed to see the web, then update your routing tables to route traffic through the VPN.
You can also use corkscrew to connect through SSH (and thus be able to install a VPN over SSH like 5) with a machine outside, on the other side of the corporate firewall, like your own at home. (this uses the HTTPS "CONNECT" mode of the proxy to access a SSH outside). Just make sure that the admins are- or at least one person in charge is- kept in loop and don't panic.
Desperate measure : create a tunnel between two machines running each http tunnel, over a proxy which only allows HTTP requests. Then use the tunnel to establish SSH VPN.
These solutions aren't specific to Ruby but can help you through any desperate solution behind an over-restrictive firewall.
1 to 4 should work in most situation. You'll have to resort to 5 to 7 if confronted with some bizarre and/or paranoid firewalls. 7 is rather extreme but always works, although sometimes with catastrophic performance.
Simple thing first: are you in the same shell session when you tried both the list and the install? Maybe you forget to set the env second time around?
Try setting http_proxy instead of HTTP_PROXY.
Make sure the proxy setting is a valid URL (see below)
Do you have multiple proxy options? Open IE and type wpad in the address bar. You might see some other possibilities.
Is your proxy authenticated? If so, do you have your credentials in the URL. Mine is like this (on windows):
set http_proxy=http://myuserid:mypassword#internetproxy:3128
Does your your password have any punctuation characters? Try it with just numbers and letters, as : and # (and possibly others) are significant in the URL string itself.
You can use this tool:
http://ntlmaps.sourceforge.net/
gems don't support proxy authentication, so going through a secondary proxy (like, say, YOUR machine) that does the authentication for you and lets gems think there is no authentication happening should make your life easier.
Another stupid question, but what's the corporate proxy software ? Some Windows-based software tend to used weird authentication standards (NTLM hashes, etc.) which aren't supported by all clients (wget doesn't support it, for example), but are supported by lots of browsers.
Thus even if you tried writing the username and password into the proxy URL, it won't work when you try to download and install a packages, although it works pretty well when you try to display a page in FireFox. I've had similar problems with some corporate network and my distro's package manager.
In these situation, you might use something like ntlmaps. You use it as a local proxy which will then cascade the requests to the corporate proxy. The good thing is that ntlmaps will be able to authenticate the weird NTLM password with the corporate proxy, and all your applications will be able to connect to ntlmaps, even those which don't support NTLM.
I've retested this since the gemcutter.org folks made the mode to Amazon's Cloudfront and am able to download gems again through my employer's firewall.
I described a procedure to get around any restrictions of a corporate firewall in:
How do I update Ruby Gems from behind a Proxy (ISA-NTLM)
It basically uses an ssh tunnel and the programm tsocks.
1.GO to the drive in which you installed ruby.
2.you will find a folder named "ruby200-x64" or something similar to it based on which version you installed.
3.inside the folder open ...bin/
4. find gem.bat, open it with any text editor you will find a bunch of settings.
5. after #"%~dp0ruby.exe" "%~dpn0" %* place you proxy server address and port.
**
#"%~dp0ruby.exe" "%~dpn0" %* --http-proxy
http://domainname.ccc.com:8080
**