Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - eraskin

Pages: [1]
1
Installation and Upgrades / Re: Load DNS from text file?
« on: July 14, 2014, 10:32:54 pm »
We are a Linux shop with Windows XP desktops.  Right now everybody has their own Outlook with individual PST files.  I am trying to set up Openchange and get some groupware advantages, liked shared folders. 

As a Linux shop, we have always used DNS(bind) for our needs.  Never used Active Directory before.  I tend to stay with what I know, so I wanted to load the Zentyal DNS interface.  Using samba DNS would be a major jump, and would require my administrators know command lines to manage it.  Using the Zentyal DNS, they can use the GUI.

The way I read the code, the Zentyal DNS module automatically generates the reverse DNS zones from the forward zones you enter.

I am pleased to say that I got the code to work.  There were a few issues:

1)  a /etc/hosts file contains a FQDN as the first field.  I had to strip off the domain name from the FQDN to get the hostname.
2)  Once I do that, then the alias field may contain a duplicate of the hostname, so that needs to be checked and stripped out.
3)  I have to skip any record already in the DNS tables.  I had a couple I had entered by hand.

The final code is attached for anyone that wants it.  I modified it to take domain name and location of hosts file as command line arguments.  Note that I don't warranty anything -- you use at your own risk! :-)

Note that this code does not do the final "Save Changes" to the DNS module.  You must log in to the web interface and "Save Changes".  This may be a "good thing", as it gives you a chance to double-check the entries before they go live.

2
Installation and Upgrades / Re: Load DNS from text file?
« on: July 14, 2014, 09:21:18 pm »
I think I get it.  You are suggesting that I don't even bother to load the Zentyal DNS tables and that I just use commands to load the Samba DNS instead.  This, in effect, means that I ignore the Zentyal DNS module setup, right?

I was trying to keep it simple, so that my lan administrator could use the Web GUI to update the DNS when necessary.  If I switch to using Samba's DNS instead, can we still do that?

3
Installation and Upgrades / Re: Load DNS from text file?
« on: July 14, 2014, 08:55:54 pm »
Thanks for the reply, but I'm not understanding it.  Are you saying that the samba DNS server needs some settings before the perl will work?  Isn't Zentyal running a "bind" server?  Doesn't this code load the bind server settings in the Zentyal configuration database?

As a follow-up, since it is updating bind server settings, is there a "Save Changes" that has to be done somehow in the perl script to get get the new DNS settings out to the actual bind configuration files?

I don't understand what the samba commands have to do with this? 

In any event, I got a little farther with my code.  I had to create a "DNS" module object and use that:

Code: [Select]
EBox::init();
my $dns=EBox::DNS->_create;
   .
   .
$dns->addHost( 'paslists.com', $host);

I no longer get an error about the module 'EBox::DNS'.  Of course, it doesn't actually *work* yet. ;-)

4
Installation and Upgrades / Load DNS from text file?
« on: July 14, 2014, 06:06:41 pm »
This is probably a very basic perl question.  I am trying to migrate my DNS hostnames/ip addresses from another server, modeled after the perl code given in the docs for the EBox API.  The other server (ClearOS) placed all info in the /etc/hosts file, so that is what I am parsing.

Here is my code:

Code: [Select]
#!/usr/bin/perl

use strict;
use warnings;

use EBox;
use EBox::DNS;

EBox::init();

open(DOMAIN,"</tmp/pas-hosts") || die "Can't open pas-hosts: $!";
while(my $line = <DOMAIN>)
{
  next if $line =~ /127.0.0.1/ or $line =~ /::1/ or $line =~ /^#/;
  chomp($line);
  my ($ip, $hostname, @aliases) = split(/\s+/, $line);

  my $host = {
      hostname => $hostname,
      ipAddresses => [ $ip ],
      aliases => [ @aliases ],
      readonly => 0
  };

  EBox::DNS->addHost( 'paslists.com', $host);

}
close(DOMAIN);


Here is the error I get:

Code: [Select]
Can't use string ("EBox::DNS") as a HASH ref while "strict refs" in use at /usr/share/perl5/EBox/Model/Manager.pm line 254.

There is definitely an EBox::DNS::addHost method and an EBox::DNS module.

Can somebody help me understand what I am doing wrong?

5
Hi:

I have a brand new 3.5 zentyal installation.  I have configured an external dhcp connection (connected to my cable modem).  Whenever I start up zentyal, the external interface comes up but the default route is not set.  I have the interface configured as external.  The resulting /etc/network/interfaces file I get looks correct:

# cat /etc/network/interfaces
auto lo eth0 eth1

iface lo inet loopback

iface eth0 inet static
      address 192.168.10.4
      netmask 255.255.255.0
      broadcast 192.168.10.255

iface eth1 inet dhcp

The resulting routing table after an "ifup eth1" is:

# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
74.89.144.0     0.0.0.0         255.255.248.0   U     0      0        0 eth1
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0

As you can see, the gateway is not set.  I can add it manually:

# route add -net 0.0.0.0 gw 74.89.144.141
# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         74.89.144.141   0.0.0.0         UG    0      0        0 eth1
74.89.144.0     0.0.0.0         255.255.248.0   U     0      0        0 eth1
192.168.10.0    0.0.0.0         255.255.255.0   U     0      0        0 eth0


What am I doing wrong?

6
Responding to my own question....

After a lot of work, I discovered that I made a mistake and set my Webserver to the same port as my Webadmin (443).  This caused the haproxy to always send data to Apache.

To fix, I had to manually override the haproxy.cfg file so that I could access the Webadmin interface again.  I hand-edited the file and killed/restarted the haproxy command manually.  Once in webadmin, I changed the ports for my Webserver to 8080 and 8443.

All is well in Zentyal land again.

7
Hello:

Newbie user here...  I just installed Zentyal 3.5 using the apt-get method after installing Ubuntu 14.04.  It started out working fine.  I could access the webadmin interface with no problem.

I then enabled other modules.  Unfortunately, one of them has interfered with my access to the webadmin interface.  Now, instead, I get the default Apache2 web page.

I have read through some of the code, and it appears that haproxy is responsible for choosing which back end server to access based on the url.  I see this code under https:

Code: [Select]

  default_backend bk_zentyal_webadminHAProxyId_61443
  use_backend bk_zentyal_webserverHAProxyId_62443 if { ssl_fc_sni pdc.paslists.com  }

backend bk_zentyal_webadminHAProxyId_61443
 mode http
 server srv_zentyal_webadminHAProxyId 127.0.0.1:61443
backend bk_zentyal_webserverHAProxyId_62443
 mode http
 server srv_zentyal_webserverHAProxyId 127.0.0.1:62443

When I do a netstat, I see that nginx is running on port 62443 and apache2 is running on port 61443.  I looked at the nginx configuration and that does seem to contain the webadmin interface. 

So, something must be going wrong with my haproxy.  How do I debug this?

Pages: [1]