I hope this is the correct place to ask this question.

I installed Aegir in a fresh install of Ubuntu 10.04 LTS in Virtual Box 4.0.4 using the install script 1.0-rc3

It is working except for one thing. It may be that my expectations are wrong or my DNS settings are wrong. When I create a Drupal-6.20 platform and firstsite.dev everything goes fine. If I try to access the firstsite.dev from my vbox guest browser it cannot access the site until I edit the hosts file and add the name to the line
127.0.0.1 localhost.localdomain localhost firstsite.dev

I was expecting and hoping that Aegir would create an Apache2 document in sites-available and symlink in sites-enabled but neither is happening.

Here are the details of my setup.

When preparing to install Aegir I set a few things:
hostname = devserver
fqdn = devserver
hosts file:
127.0.0.1 localhost.localdomain localhost
127.0.1.1 devserver

I did not include an entry in the hosts file for the external IP which is 192.168.56.101

When Aegir was installing these are the settings it reported:

The following settings will be used:
 Aegir frontend URL: devserver
 Master server FQDN: devserver
 Aegir root: /var/aegir
 Aegir user: aegir
 Web group: www-data
 Web server: apache
 Aegir DB host: localhost
 Aegir DB user: root
 Aegir DB password: <prompted>
 Drush make version: 6.x-2.2
 Aegir version: 6.x-1.0-rc3
 Aegir platform path: /var/aegir/hostmaster-6.x-1.0-rc3
 Aegir makefile: /var/aegir/.drush/provision/aegir.make
 Admin email: admin@devserver

Looking at the Aegir Servers shows:
devserver, database no, web apache
localhost, database mysql, web no

This is probably not good.

Previously I tried setting up Aegir with the hosts file this way:
127.0.0.1 localhost devserver
127.0.0.1 devserver

On installing Aegir this was displayed:

    The following settings will be used:
    Aegir frontend URL: devserver
    Master server FQDN: localhost
    Aegir root: /var/aegir
    Aegir user: aegir
    Web group: www-data
    Web server: apache
    Aegir DB host: localhost
    Aegir DB user: root
    Aegir DB password: <prompted>
    Drush make version: 6.x-2.1
    Aegir version: 6.x-1.0-rc2
    Aegir platform path: /var/aegir/hostmaster-6.x-1.0-rc2
    Aegir makefile: /var/aegir/.drush/provision/aegir.make
    Client email: admin@devserver

    Do you really want to proceed with the install (y/n): y

Everything was fine but I did not test that install as I was still puzzling over the prep and setup.

I am not really sure what is the right way to setup the DNS on VBox and if I can change this after Aegir is installed or if it has to be done before installing Aegir.

One final note. One of the suggestions I found was to enable vhosts_alias which I did before installing Aegir. I am not sure if this is necessary.

Any help would be appreciated.

Thanks,

Izzy

Comments

Anonymous’s picture

Status: Active » Fixed

It is working except for one thing. It may be that my expectations are wrong or my DNS settings are wrong. When I create a Drupal-6.20 platform and firstsite.dev everything goes fine. If I try to access the firstsite.dev from my vbox guest browser it cannot access the site until I edit the hosts file and add the name to the line
127.0.0.1 localhost.localdomain localhost firstsite.dev

That sounds normal. You need to make the URL resolve to an IP, which is what you're doing here.

I was expecting and hoping that Aegir would create an Apache2 document in sites-available and symlink in sites-enabled but neither is happening.

It creates them in /var/aegir/config/server_master/apache/vhost.d, and apache knows to look in there for vhosts. You can verify what Apache can 'see' in terms of vhost by running apache2ctl -S as root from your VM's terminal.

It sounds like you expected the presence of apache vhosts (which are nonetheless there) to affect the resolving of the URL - which is not the case, that's two separate things (DNS and Apache).

Your hardcoding in /etc/hosts is quite reasonable - if you want to go to more effort, you could run a DNS server on this virtualbox VM that automatically resolves anything .dev to 127.0.0.1 to save you the trouble of editing /etc/hosts. That said, setting up a DNS server is not the most straightforward of things to do if you're relatively new to sysadmin and is outside the scope of Aegir. Plenty of good guides exist on the web though.

Looking at the Aegir Servers shows:
devserver, database no, web apache
localhost, database mysql, web no

This is probably not good.

That's ok and is the default setup for Aegir. Aegir has selected to use 'localhost' (i.e, Unix sockets) as opposed to IP (TCP sockets) for communicating to the database server. So it created two separate 'server nodes'. This is the default and to be expected. It can be overridden to *only* use TCP sockets by specifying --aegir_db_host=devserver at install time if you want, but isn't necessary for normal Aegir operation. To use such an option, you have to ensure that your MySQL server is listening on all or on that specific IP (has bind-address commented out in /etc/mysql/my.cnf, usually the quickest way to do this). As you can see this involves a little more work to setup, which is why it isn't the default option.

Hope that's cleared things up: at least you can be assured your install sounds like it's working normally, just your expectations of what is normal were slightly different :)

izmeez’s picture

@mig5 Thanks for the fast and detailed response. I hope you don't mind a bit of follow-up.

It creates them in /var/aegir/config/server_master/apache/vhost.d, and apache knows to look in there for vhosts. You can verify what Apache can 'see' in terms of vhost by running apache2ctl -S as root from your VM's terminal.

Thanks, I see them there. Before taking Aegir for a spin I was testing Quickstart which creates documents in /etc/apache2/sites-available with symlinks in ../sites-enabled and the new sites are immediately available by name url through the local browser. Handy for a dev environment. I'm not sure if something like this can be added to Aegir without interfering with it's use in other environments.

When I run apache2ctl -S I get the following:

[warn] NameVirtualHost *:80 has no VirtualHosts
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80                   is a NameVirtualHost
         default server default (/etc/apache2/conf.d/aegir.conf:5)
         port 80 namevhost default (/etc/apache2/conf.d/aegir.conf:5)
         port 80 namevhost d6-first.dev (/var/aegir/config/server_master/apache/vhost.d/d6-first.dev:1)
         port 80 namevhost devserver (/var/aegir/config/server_master/apache/vhost.d/devserver:1)
         port 80 namevhost devserver (/etc/apache2/sites-enabled/000-default:1)
Syntax OK

Does the warning NameVirtualHost *:80 has no VirtualHosts mean something else needs to be configured?

I am still wondering if I needed to enable apache2 vhosts_alias which I did do before installing aegir?

Aegir has selected to use 'localhost' (i.e, Unix sockets) as opposed to IP (TCP sockets) for communicating to the database server. So it created two separate 'server nodes'. This is the default and to be expected. It can be overridden to *only* use TCP sockets

I did comment out the bind-address line prior to installing Aegir but did not use the option
--aegir_db_host=devserver
Is there any advantage to using TCP sockets over the 'localhost' ?

Thanks,

Izzy

izmeez’s picture

Sorry for the low level of my questions I see the answers to some of this in the Aegir documentation under common installation problems http://community.aegirproject.org/node/462

Also from my testing there does not appear to be any need to enable vhost_alias explaining why it is not in the manual installation instructions although it is in some other posts on d.o. preparing server for Aegir.

Certainly lots of learning in this process but a pretty slick environment. Hopefully, I can get on with applying it as I hoped to.

Thanks,

Izzy

Anonymous’s picture

The NameVirtualHost warning just means there are multiple definitions of NameVirtualHost *:80 in the apache config (one in Aegir, and probably one in the global apache config). It's just a warning and can be ignored.

I don't know anything about 'vhost_alias', never heard of this before in Apache, so I can't give any advice there sorry. Again, it seems your system is working perfectly normally.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.