last day (25 days later) » 

19:41
I'm here
sorry i don't want to ask a billion questions via comments, the mods will hate me
no problems :)
Did you ever get a domain for the server? If so, did you actually make a DNS entry that points that domain to the IP address?
because if that doesn't exist and resolve, then that needs to be in place first
19:43
What do you mean? Have I registered a domain? Yes, I've registered it at GoDaddy. Then I changed the nameservers to point to my hosting nameservers
the "hosting nameservers" are owned by your VPS provider?
hiya @jrg
yes
what, sorry?
@DimaKnivets ignore me saying hello, one of the mods hopped in :)
like they always do :)
ah, ok :)
jrg
jrg
@TheLordofTime waves to everyone, then leaves
19:45
Mind sharing the domain name? I only want to poll my DNS servers to see if they actually correctly set up the records.
yes, of course — applehearted.me
just pointing your domain to your provider's nameservers won't help if they don't have a record that points the domain actually to an IP
opens his command line
yes, i've also added the domain at hosting panel
one sec
applehearted.me. NS dns1.stabletransit.com.
applehearted.me. NS dns2.stabletransit.com.
^ those are your provider's DNS nameservers?
right, those NS
19:46
okay, just to let you know, I use a more advanced DNS tool that shows me the raw output from the DNS lookup.
this is what those nameservers have for your domain:
$ dnsget -t ANY -n dns1.stabletransit.com applehearted.me
applehearted.me. SOA ns.rackspace.com. knivets.gmail.com. 1370027032 21600 3600 1814400 300
applehearted.me. NS dns1.stabletransit.com.
applehearted.me. NS dns2.stabletransit.com.
what that tells me is that it's missing a record that says domain -> IP
lemme show you an example from one of my domains
$ dnsget -t ANY -n ns6.zoneedit.co.uk trekweb.org
trekweb.org. SOA ns2.zoneedit.com. soacontact.zoneedit.com. 2013219478 300 300 300 300
trekweb.org. A 107.21.233.123
trekweb.org. NS ns2.zoneedit.com.
trekweb.org. NS ns6.zoneedit.co.uk.
trekweb.org. NS imogen.hotellite.net.
trekweb.org. NS ns1.linode.com.
trekweb.org. NS ns2.linode.com.
trekweb.org. NS ns3.linode.com.
trekweb.org. NS ns4.linode.com.
trekweb.org. NS ns5.linode.com.
firstly, ignore the billions of NS lines
i just use a lot of nameservers.
you mean A line?
mhm
that needs to be added
how and where?
19:49
in your hosting provider's DNS servers
i don't know your hosting provider, but they should have a guide for how to add to their DNS
but they need to add an A record.
IP adress of my server, right?
mhm
that's the first part
that will allow the domain name to correctly point to the server
OK now we can set up your nginx configuration file
do you only have that one application on your webserver?
or do you have more than one site there?
yes, i have one, but i would like to have the ability to host more
can we do this?
19:51
yeah we can do that, it's not hard, but it requires additional configuration on nginx's side.
as well as each other domain or subdomain pointing correctly in DNS to the server.
like the A record we added for your domain.
can you please look if i added A record?
with your tool?
yeah, but i will point out most providers only update their nameservers once every few hours
which is why domain resolution takes so long to reach the internet.
i'll check now though
I have configured TTL to 5 minutes (i hope this helps)
$ dnsget -t ANY -n dns1.stabletransit.com applehearted.me
applehearted.me. SOA ns.rackspace.com. knivets.gmail.com. 1370202607 21600 3600 1814400 300
applehearted.me. NS dns1.stabletransit.com.
applehearted.me. NS dns2.stabletransit.com.
applehearted.me. A 162.209.57.188
yep but that only helps your nameservers.
all the other DNS servers need to pull the data
like, i use google dns (8.8.8.8)...
ah, understand
19:56
and they pull very quickly
so does Level3
but others might take a little
indeed :)
Your site works now :)
great! thank you! :)
yep, but one second :)
will you help with that multiple-site configuration?
19:57
yeah, sure! But give me a bit, my internet's lagging so I have to reboot my modem.
ok, no problem
and we're back.
i'm here
so yeah, if you want, you can pastebin your current config on paste.ubuntu.com and I can tell you what to tweak to make that be one listener for your one domain, and can give you a template to use for other sites you might host.
all you'll have to do is tweak those templates for whatever you're running, ruby, python, some PHP in the backend, whatever :)
ok, one sec
20:04
just, share the link to the pastebin so I can give you a tidbit of advice :)
I use Ruby on Rails + Unicorn as "bridge" (or what) between Rails and nginx
right, that's expected
because nginx doesn't speak Rails, Unicorn does
this config example was on the Unicorn project
i have a question
we have the same happen with PHP :)
sure!
from this config it looks like the server is setup only for one site
20:07
it is.
it seems to me that it must be something universal in this config
there is, but only sorta
and something special in children configs
right?
or I'm speaking to cryptical? :)
20:08
because here's the problem, they have everything sitting in one location
in the nginx.conf
yes, i've also read about sites-available folder
in every Ubuntu nginx.conf deployment that the nginx team has worked with has the server { blocks in a different folder.
in THIS config file they remove the include that includes the sites-available folder.
ok, i have a small understanding of what is happening, just tell me what should I do :)
mmm, this would require me to dig around in nginx
because there's a lot i see wrong on this config.
(sorry, not your fault, but you're really using a sample file that has way too many comments for my liking xD)
i was in a hurry :)
20:13
no problem
but i'm going to tweak your config slightly
and i'll explain the tweaks when i'm done
ok, no problem
note i haven't tested this so i have a backup of your original config :)
@DimaKnivets they had you put that in nginx.conf right?
what, sorry?
the configuration file
the one they provided.
they had you put that in nginx.conf right?
replacing the default nginx.conf?
'they' who?
20:16
their site
their samples.
ah, right
yes
OK
we're going to have to reinclude some of the lines they had you remove...
you can delete all the comments, by the way :)
i'm leaving them
they're helpful :)
BUT
paste.ubuntu.com/5727268 <-- this goes into nginx.conf
pase.ubuntu.com/5727269 <-- this goes into a new file in /etc/nginx/sites-available
doesn't matter what you name the file, just that you remember it
i normally name by what the config file contains, like the domain name it works with
so, you could name it applehearted.me or whatever
ok
one sec
20:21
yep
then there's two more steps
do let me know what you named the file, though
and remember, sudo is needed to edit/create those unless you're root.
applehearted.me.conf
done
okay.
next step is this:
cd /etc/nginx/sites-enabled
and
then this, only after you've done the cd command: ln -s /etc/nginx/sites-available/applehearted.me.conf .
then do: sudo service nginx restart
and make sure your site still runs :P
and what about /etc/init.d/nginx restart ?
will it work?
20:24
that will work too, but in Ubuntu, service is designied to auto-check /etc/init.d/
so service nginx is the same as /etc/init.d/nginx (in Ubuntu and Debian)
ok, done, but site doesn't run
'master failed to start, check stderr log for details'
okay, that's what i thought might happen
which is why i said it could break
lemme point out i hate rails/unicorn/passenger/anything_complex
actually wait one second
/me checks something
@DimaKnivets given that they gave you their conf file i can't easily make other sites work...
give me two seconds to change something
ok, no problem
20:28
paste.ubuntu.com/5727308 <-- put this into the file we created in sites-available
and then go back to the sites-enabled directory
and paste the output of ln -alshF
because i want to see whether the links are actually in place
:P
i don't see YOUR.IP.HERE line
is it ok?
so, i've updated the file, what should I do next?
yeah i'm making sure we get their default stuff working first
/etc/init.d/nginx restart
as sudo if need be
then test your site again.
and what about 'go back to the sites-enabled directory
and paste the output of ln -alshF'
?
wait
the site works
why does it show error then
are you there? :)
sorta
sorry, i do a thousand things at once
including IRC support for nginx :)
no problem :)
what do you think?
20:37
what was the full error again?
here's the command 'unicorn_rails -c /var/www/applehearted.me/config/unicorn.conf.rb -D
'
and here's the error 'master failed to start, check stderr log for details'
but the site works
okay that's a unicorn error
i can't help with that one.
you'd have to look through the error logs for unicorn
but if the site works then that's what I say matters.
ok
thanks!
the only change i did here so far was to add back in the ability to read the sites-enabled folder
so that you can run other sites
but now i have to check one more thing
because the _ command on the server_name in the site conf will match everything i think...
or at least a default server
anyways, what you need to do is make sure that for every site you want to host, that (a) the domain points to your VPS's IP in the DNS configuration
yeah, that's clear
20:41
(b) that you make sure you have a configuration file in /etc/nginx/sites-available that has the site's configuration data
and...
(c) that you symlink the sites-available file into the sites-enabled directory
like we did when I said to do cd /etc/nginx/sites-enabled; ln -s /etc/nginx/sites-available/FILENAME .
(replace "FILENAME" with the actual file name)
i can't help with the unicorn side of things, but you can set up multiple sites now.
ok, that's great!
if you need help you can drop me an email at teward AT ubuntu DOT com
which is my email :)
well, one of them :p
is that everything, right?
20:43
that should be everything to answer your question, yes :)
thank you very much :)
you're welcome :)
any time.
you saved my life :)
i've got one more question
Heh. I answered your question with a brief summary and a link back here. so you can upvote me if you want :)
20:44
sure!
remember that line with ip address
(your.ip.adress)
you've deleted it
is it ok?
yeah it's OK. We'll have to change that later if you want to run multiple sites. but when that happens we have to do some testing to make sure your site works as-is when we change all the configs.
otherwise, you don't have to worry about it. the server_name _; line catches all.
what does it do — server_name _; ?
and when i decide to add other sites, it will work out of box or I need to contact you?
server_name is a way to narrow down the listener so that it specifically says "This server block pertains to the following domains: [whatever's on server_name]". The extra _ is a special character that acts as a catch-all and listens for everything. regardless of the domain name.
understand, thanks!
20:47
if you add other sites... we have to modify your only sites-enabled conf for now, otherwise the others won't work.
so i should drop you a line?
Yeah, just drop me an email at the address I told you, and include a link to your Ask Ubuntu user profile ( askubuntu.com/users/163906/dima-knivets ) so I know it's you :)
ok, thank you very much, once again! :)
as for "out of the box" i can't tell you if ruby and unicorn will behave right, that's something you'd have to talk to the unicorn support people with :)
you're welcome, any time!
i've accepted the answer
but can't upvote, because of the lack of reputation
but definitely will when have one
is it ok? :)
20:50
yeah you're good
i get +25 for the accept :)
okay, thanks, good luck!
same to you! :)

  last day (25 days later) »