Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aegir vhost not loading? #7

Closed
mysty opened this issue Aug 6, 2010 · 34 comments
Closed

aegir vhost not loading? #7

mysty opened this issue Aug 6, 2010 · 34 comments

Comments

@mysty
Copy link

mysty commented Aug 6, 2010

Installation script runs just fine using 10.04 minimal fresh install.

Ran it before and after yesterday's alpha9e changes, on fresh installs, and I get the same issue: a 404 on the password reset link, say http://tstsrv.example.com/user/reset/1/1281100657/fe258839a763622a2dd5471e8fc08bed - so:

http://tstsrv.example.com/ responds with "Welcome to nginx!"
http://tstsrv.example.com/user (and the above reset) is a 404

I'm new to nginx, but from what I could tell the contents of

/etc/nginx/nginx.conf

/etc/nginx/conf.d/aegir.conf

/var/aegir/config/server_master/nginx/vhost.d/tstsrv.example.com

and their includes should cover it.

Seemed to me that perhaps the default vhost should be disabled, so I tried that. Restarted nginx, still got the above http responses.

Then I did a chmod -R 777 /var/aegir/config/server_master as that only seemed to be readable by the aegir user, restarted nginx, still got the above http responses.

Then I noticed that /var/aegir/config/server_master/nginx/vhost.d/tstsrv.example.com had the following line

listen 127.0.1.1:80;

(is that as expected?) ... which I changed to

listen 127.0.0.1:80;

and restarted nginx, but still got the above http responses.

Feels to me like the aegir vhost is not loading but I'm not sure what I can do to check or force it to load, beyond replacing default completely with the various directives that make up the aegir vhost.

Thanks again and in advance for any thoughts on how to progress.

@mysty
Copy link
Author

mysty commented Aug 6, 2010

one thing I did notice was that drush (while in /var/aegir/drush ) wasn't in the path when I installed before your update to your script yesterday, but is in the path and runs just fine as of the alpha9e update

@omega8cc
Copy link
Owner

omega8cc commented Aug 6, 2010

If anything doesn't work, while the installation was completed successfully, it probably means your DNS settings was not discovered correctly (or they are still wrong). But in any case, never touch manually Nginx configuration files and directories in /var/aegir. If it is set to listen on 127.0.1.1, then it means you have set your FQDN hostname and/or your custom web address for the Aegir frontend to something resolving to 127.0.1.1. Please double check what you have in /etc/hosts and what is the result of hostname -f command when run manually. This script was tested on servers with public IPs only, so its support for localhost installations is not confirmed/tested yet. Please post some details on your setup - local VM, how it's networked etc.

@omega8cc
Copy link
Owner

omega8cc commented Aug 6, 2010

Drush is now by default symlinked as /usr/bin/drush, so it is in path but it has no impact on the installation and Aegir itself. It is just for easier access from command line, even when you are not logged in as an aegir user.

@agoddard
Copy link

agoddard commented Aug 6, 2010

I just did a new install using the latest script and have the same issue, nginx is listening on all interfaces, hostname -f returns the same name as I am trying to access in the browser but I'm still just getting the vanilla welcome to nginx screen

@mysty
Copy link
Author

mysty commented Aug 6, 2010

Uh, yeah - how absolutely embaressing :P I did have a line saying

127.0.1.1  tstsrv.example.com tstsrv

in my /etc/hosts ... doh!!!!

What I always used to do was put something both the following in /etc/hosts

127.0.0.1   tstsrv.example.com tstsrv
12.34.56.78 tstsrv.example.com tstsrv #*

Except that this time the typo certainly didnt help.

So I got rid of that erroneous 127.* line so that /etc/hosts now looks like:

127.0.0.1   localhost
12.34.56.78 tstsrv.example.com tstsrv #*

.. ran the script again on a fresh install and ALL is just peachy with superfast
aegir - with memcache!

Thanks again

  • replace the example 12.34.56.78 IP and FQDN with your real ones

@agoddard
Copy link

agoddard commented Aug 6, 2010

awesome :) does hostname -f now return "tstsrv.example.com" or "localhost"?

@mysty
Copy link
Author

mysty commented Aug 6, 2010

@agoddard I think that may be a feature of Aegir. Did you try going to http://your.domain.com/user ? I am getting the default "Welcome to nginx!" when I go to / as well.

TBH this is the first time I'm using Aegir on my own server so I'm not really sure, but I think it's the way it's supposed to be.

@mysty
Copy link
Author

mysty commented Aug 6, 2010

@agoddard yeah! :)

hostname -f always returned tstsrv.example.com but my errant line was I think throwing things off.

@agoddard
Copy link

agoddard commented Aug 6, 2010

weird.. my hostname returns the correct name, but I still get a 404 on the /user and /user/reset urls..

@agoddard
Copy link

agoddard commented Aug 6, 2010

ah, it's cool now.. I just had to remove the default nginx vhost, I thought the script was doing that automagically..

@mysty
Copy link
Author

mysty commented Aug 6, 2010

Pleased to hear it, I will try that myself. Was worried I closed the issue a bit early...
My bad

@omega8cc
Copy link
Owner

omega8cc commented Aug 6, 2010

It should work with default host configuration as-is, unless you have set "localhost" as your domain, which is not supported (you need any real or false FQDN but never "localhost") and yes, if you will see the default Nginx "Welcome to Nginx" page, it simply means there is no correct entry for the domain name (URL) you are trying to reach. I think I will replace this default "Welcome" page with something better, like a nice "Under construction" page or something.

Anyway, if you are experiencing issues, please post some details about your configuration on http://gist.github.com, so I can help better.

@omega8cc
Copy link
Owner

omega8cc commented Aug 6, 2010

I think I will add the check for "localhost" so it will deny it as a hostname or Aegir domain, since it shouldn't be used, because in the vanilla Nginx install we are using, there is already defaul host for "localhost" configured and we are not removing it to keep it vanilla clean for compatibility with manual installs reasons.

@mysty
Copy link
Author

mysty commented Aug 7, 2010

I got the "Welcome to nginx!" for my http://tstsrv.example.com until I removed default from
/etc/nginx/sites-enabled
.. and restarted nginx. After that point I get the main Aegir pages served. My /etc/hosts file looks like
127.0.0.1 localhost
12.34.56.78 tstsrv.example.com tstsrv
/etc/hostname contains tstsrv.example.com - which is what hostname -f also returns, and I'm using 10.04, without touching any of the automatically created config files, bar adding a bunch of packages.

Been playing with it for hours and everything else seems to be working fine (though I probably need to reinstall postfix). Hope that may help :)

@omega8cc
Copy link
Owner

omega8cc commented Aug 7, 2010

Excellent! Thanks for sharing your results =) Interesting why you had to remove the default nginx host and why your Postfix doesn't work as expected?

@agoddard
Copy link

agoddard commented Aug 7, 2010

Hi there, I ran the script on a clean install of Debian Lenny. Hostname, uname -n and hostname -f all returned the correct fqdn, when I got the e-mail from the script, it gave me a link at this fqdn to the password reset, though clicking the link gave me a 404. I edited vim /etc/nginx/conf.d/aegir.conf and commented out lines 75-83, which were the nginx default server, bounced nginx and everything worked fine. Hitting the domain name's root URL also gave me the correct aegir page at this point.
Hope that helps :)

@omega8cc
Copy link
Owner

omega8cc commented Aug 7, 2010

You shouldn't edit that file. It is required as a default catch-all server for all not configured yet (in Aegir) domains, already pointing to your server IP address. You could replace the /var/www/nginx-default/index.html with something more fancy, but it should work there as is. Can you please copy and paste the content of your /etc/nginx/nginx.conf and /etc/nginx/sites-available/default files, here or in http://gist.github.com?

@agoddard
Copy link

agoddard commented Aug 7, 2010

Yep, here they are. without removing that default domain, nginx wouldn't serve aegir
/etc/nginx/nginx.conf -> http://gist.github.com/512329
/etc/nginx/sites-available/default -> http://gist.github.com/512331

@omega8cc
Copy link
Owner

omega8cc commented Aug 7, 2010

Thanks, both files looks exactly the same as in all my tests, and it works for me with the default server defined in /etc/nginx/conf.d/aegir.conf. I'm really curious why it didn't worked for you. Could you please do me a favor and tried to uncomment those lines you commented out in /etc/nginx/conf.d/aegir.conf, then restart nginx by killall nginx; service nginx start and check if you still see the Welcome page instead of expected Aegir frontend?

@agoddard
Copy link

agoddard commented Aug 7, 2010

yep, I see the Welcome Page. It's the same behavior as it was before I commented them out. Interestingly though, if I hit the server by IP address (with them commented out), I get the drupal installation page (redirects to install.php).

@omega8cc
Copy link
Owner

omega8cc commented Aug 7, 2010

Thanks. Anyway, that is odd. So your IP used is public and FQDN hostname is used to access Aegir front-end? And just to make sure, you have file matching your FQDN hostname in /var/aegir/config/server_master/nginx/vhost.d/* and inside that files you have line saying server_name your.fqdn.host.name ?

@agoddard
Copy link

agoddard commented Aug 7, 2010

yep, public IP, fqdn accesses the front-end. I have the file matching the fqdn in the vhost.d directory and there is the correct server_name line.

@omega8cc
Copy link
Owner

omega8cc commented Aug 7, 2010

Thanks. That is very odd :) Is it some known provider so I could get a test account there and perform some debugging? I'm just doing it for Linode based servers.

@omega8cc
Copy link
Owner

omega8cc commented Aug 7, 2010

Ah, btw, have you any custom stuff edited in your /etc/hosts maybe? mysty had to remove default file in /etc/nginx/sites-enabled to get it working and it also sounds odd (I don't see any reason why it could help :)

@agoddard
Copy link

agoddard commented Aug 7, 2010

unfortunately it's not a known provider. I took the default Debian Etch template from XenServer and dist-upgrade'd it up to Lenny, if that helps.

The contents of my hosts file are exactly as follows:

127.0.0.1 localhost localhost.localdomain
public.ip name.server.org name #*
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

@omega8cc
Copy link
Owner

omega8cc commented Aug 7, 2010

Not sure if that kind of install (upgrade from Etch) can make any difference. Anyway, you don't need that line in your /etc/hosts: public.ip name.server.org name when you have correct IP set in your A record for this domain, but your /etc/hostname should contain your name.server.org FQDN hostname. Anyway, I can't reproduce it on any other Lenny server (I tried four in four different datacenters), so I would suggest to uncomment those lines in /etc/nginx/conf.d/aegir.conf and to remove the default file from /etc/nginx/sites-enabled instead, then please restart nginx. I will investigate it further.

@mysty
Copy link
Author

mysty commented Aug 7, 2010

omega8cc, btw, postfix is working just fine. Gmail was just being a little aggressive on the filtering.

@omega8cc
Copy link
Owner

omega8cc commented Aug 7, 2010

@mysty - thanks for confirmation. I'm still curious why you had to remove the default from /etc/nginx/sites-enabled to get it working. I can delete that file on install since it is never used, but I'm trying to leave the vanilla nginx config files as-is, to keep it compatible with standalone installs (without installer) with apt-get install nginx only.

@mysty
Copy link
Author

mysty commented Aug 8, 2010

Is there anything I can do to help test? btw, I was running in a VirtualBox minimal install 10.04 vm (not that it should really make a difference), with a local DNS server taking care of the DNS side. Advantage of that of course is that it's easy to snapshot/test/rollback/test etc so if there is something I can do, please do let me know. I will have a go with your alpha9f on a vanilla 10.04 minimal and report back. May take a few days.

@omega8cc
Copy link
Owner

omega8cc commented Aug 9, 2010

@mysty , Every new edition needs some testing, and I'm doing it always on the servers with public IP and hostname, so if you can test it on the local VM, it is always appreciated =) Thank you!

@agoddard
Copy link

agoddard commented Aug 9, 2010

@omega8cc I uncommented the lines and removed the default site, however the problem came back. I'm going to put this down to something different in my environment as everything is working ok for me now, I assume most people won't be taking a xen etch template and updating it to lenny..

btw, awesome script - it saved a ton of time.. this problem was pretty easy to get around and it sounds like I'm the only who had it..

@omega8cc
Copy link
Owner

omega8cc commented Aug 9, 2010

@agoddard Thanks for the info. I like problems - it is the only way to get things improved! =)

@mysty
Copy link
Author

mysty commented Aug 13, 2010

@omega8cc turns out I was flooded on my return to work and now about to leave the country for two weeks, but I look forward to doing more testing/feedback if I can be of any assistance when I return. Have fun and sorry not to be meeting you in CPH, as I won't be making it.

@omega8cc
Copy link
Owner

@mysty I can't go to CPH due to gov contract :( so maybe next time. Thank you for your help. All the best.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants