#ubuntu-ec2 2010-07-20
<flaccid> i see some images set up /etc/hosts like 127.0.0.1   domU-12-31-38-00-95-65.compute-1.internal localhost
<flaccid> localhost.localdomain
<flaccid> is this a good or bad practice? (as opposed to just1 27.0.0.1   localhost   localhost.localdomain)
<flaccid> yeah the .internal address should be the internal 10. IP
<l1234> hello.  anyone around?
<flaccid> no
<l1234> well thats too bad.
<l1234> I'm trying to setup a subdomain of my ec2 site, and this might be a #apache question
<flaccid> cool
<l1234> any chance you'd be willing to help me out?
<l1234> i think I have the virtualhost settings correct in the 000-default file
<l1234> but its not working
<flaccid> enter #httpd and enter, NameVirtualHost
<l1234> except I'm on webchat.freenode which they ban
<flaccid> really
<l1234> yes.
<flaccid> so whats the prob
<flaccid> paste the config..
<flaccid> well the vhost at least
<l1234> <VirtualHost *:80> ServerName ec2.amazonaws.com DocumentRoot /var/www ServerAlias qa.ec2.compute-1.amazonaws.com </VirtualHost>  <VirtualHost *:80> ServerName ec2.amazonaws.com DocumentRoot /var/www2 ServerAlias qa2.ec2.amazonaws.com </VirtualHost>
<l1234> sorry it stripped the spacing out
<l1234> and i did a crappy job and stripped the compute-1 from the 2nd entry
<l1234> basically when I go to ec2.amazonaws.com it works fine(ccurrently pointed to /var/www)
<l1234> but the subdomains don't seem to work at all
<flaccid> you own amazonaws.com ?
<l1234> no
<l1234> lol
<l1234> i just stripped out our info from the file
<l1234> before I pasted it in here
<flaccid> so you don't even know what the directives mean?
<flaccid> and you can't google?
<l1234> i've tried googling
<flaccid> all you need is ServerName qa.ec2.compute-1.amazonaws.com
<l1234> http://httpd.apache.org/docs/2.0/vhosts/examples.html#purename  and http://www.howtoforge.com/forums/showthread.php?t=23
<flaccid> no aliases
<l1234> so just servername and docroot?
<l1234> lemme try
<flaccid> i did not mention DocumentRoot.
<l1234> how would it know where to get the data?
<flaccid> the first link you gave me doesn't even show using ServerAlias
<flaccid> DocumentRoot /var/ww
<flaccid> *w
<flaccid> you also shouldn't create /var/www2 :)
<l1234> i'm using random dir names
<l1234> obviously www2 is a crappy directory name
<flaccid> so anyway
<flaccid> as long as you have Listen 80 and NameVirtualHost *:80
<flaccid> the solution i advised is the go
<l1234> so like this
<l1234> <VirtualHost *:80> ServerName qa.ec2.compute-1.amazonaws.com DocumentRoot /var/www </VirtualHost>
<l1234> ?
<flaccid> yeah
<flaccid> of course qa.ec2.compute-1.amazonaws.com is foobar
<l1234> right i need to change it to our proper domain name
<l1234> still doesn't work
<flaccid> still doesn't work aint going to help
<l1234> a coworker said I should change my local hosts file
<flaccid> can you explain
<l1234> which makes no sense to me.
<l1234> 404's when I go to qa.ec2
<flaccid> thats better
<flaccid> check the apache logs
<flaccid> first check the access log to ensure you are hitting the server
<flaccid> then the error log
<flaccid> also ensure the vhost configuration is correct in apachectl -S
<l1234> neither apache or error have any info in there
<flaccid> if nothing in access log then you probably are not hitting the right server
<flaccid> check the server signature against curl http://localhost/
<l1234> but -S talks about compute-1.internal
<flaccid> so that would probably come back to dns
<l1234> whereas the one I setup seems to point to amazaws.com ?
<flaccid> show me
<l1234> computer-1.amazonaws.com that is
<flaccid> ok so you shouldn't be touching/changing the default vhost
<flaccid> you need to create new ones and then enable them with a2ensite
<flaccid> please don't pm me again
<l1234> sorry
<l1234> http://apache.pastebin.com/qfHn1w5A  better?
<flaccid> ok so what i said above
<flaccid> you also don't need sudo for apache2ctl
<flaccid> and yes of course your dns and /etc/hosts needs to be correct subsequent to that
<flaccid> i'm about to go to bed
<l1234> http://apache.pastebin.com/tbng2d6i
<l1234> how about this now?
<flaccid> yeah but you still have one of them in /etc/apache2/sites-enabled/000-default
<flaccid> thus its default to the local fqdn
<l1234> have one of what?
<flaccid> the vhosts
<l1234> the vhost info?
<l1234> oh ok
<l1234> one sec
<flaccid> and qa.ec2-184-73-97-66.compute-1.amazonaws.com has to resolve to the client
<flaccid> you don't have authority on this domain so its either hijack in local dns or add to /etc/hosts
<flaccid> sorry, to the client = for the client
<flaccid> as in the computer the web browser is on
<flaccid> also on the server for local access
<l1234> hrm
<l1234> ok
<l1234> damn
<l1234> was hoping to avoid that
<flaccid> aws is not a dns provider
<l1234> aaah ok
<l1234> hrm
<l1234> damn
<flaccid> non elastics IPs are also dynamic
<flaccid> and technically elastic IPs are not marked as static in the ip register
<flaccid> moral to the story, get dns
<l1234> ok
<l1234> thanks
<flaccid> np
<flaccid> oh but the public ip of the instance does not change in the instance lifetime
<flaccid> sidenote..
<flaccid> im gone.
<flaccid> thanks for the help heh
#ubuntu-ec2 2010-07-23
<uvirtbot> New bug: #608958 in ubuntu-on-ec2 "Root logins are crippled" [Undecided,New] https://launchpad.net/bugs/608958
