Koozali.org: home of the SME Server

add domains query / modification

MoonLight

add domains query / modification
« on: January 02, 2005, 07:13:09 PM »
I have only just recently started to use sme server as a little development platform at home, however a few things dont do them the way I would ideally like them to.

1. When adding domain.co.uk the web interface creates www.domain.co.uk and a whole load of others.

Code: [Select]
/etc/e-smith/events/actions/create-default-hosts

my @hosts = qw ( ftp mail www proxy wpad );


Which brings me to my second point.

2. Be able to add www.domain.co.uk and dev.domain.co.uk as seperate hosts so its possible to point them to there own individual ibay, at the moment it is kinda possible but when adding a domain it get prefixed as explained at point 1.

I have tried to sort of edit some of the web interface code, and have commented out the following from the following files.

Code: [Select]
/etc/e-smith/events/actions/create-default-hosts

my @hosts = qw ( ftp mail www proxy wpad );

foreach my $host ( @hosts )
{
    my $FQDN = join ".", $host, $domain;

    next unless defined $FQDN;
    next if (defined db_get(\%hosts, $FQDN));

    db_set (\%hosts, $FQDN, 'host',
{
   HostType => 'Self',
   Visibility => $visibility,
   InternalIP => '',
   ExternalIP => '',
   MACAddress => ''
} );
}


That solved the problem of making the unwanted subdomains, which was kinda halfway towards what I was wanting. it however still made the hostname for the servername, so I also commented out the following.

Code: [Select]
/etc/e-smith/events/actions/create-default-hosts

if (defined db_get(\%conf, 'SystemName'))
{
    my $systemName = db_get (\%conf, 'SystemName');

    my $FQDN = join ".", $systemName, $domain;

    unless (defined db_get (\%hosts, $FQDN))
    {
db_set (\%hosts, $FQDN, 'host',
   {
HostType => 'Self',
Visibility => $visibility,
static => 'yes',
InternalIP => '',
ExternalIP => '',
MACAddress => ''
   } );
    }
}


Now when I go and add a domain to the system, it creates no hostnames at all, what I would like it to do now is if I was to add the following as a domain "dev.domain.co.uk" it would also create this as a hostname, this is where I am now stuck does anyone have any ideas? or even understand anything I have said?

Offline briank

  • ****
  • 146
  • +0/-0
add domains query / modification
« Reply #1 on: January 03, 2005, 12:25:41 AM »
I suspect you are doing things the hard way :)
There is a panel in user manager to add virtual domains and ibays.
http://forums.contribs.org/index.php?topic=22798.0
Lots of posts about this - do a search on multiple domains and click "Show all results" under Forums.

This post deals with emails to the same username at differents domains which may be an issue.
http://forums.contribs.org/index.php?topic=25254.0

Good luck
Brian

Offline briank

  • ****
  • 146
  • +0/-0
add domains query / modification
« Reply #2 on: January 03, 2005, 12:46:59 AM »
:oops: That should read server manager not user of course!
Brian

MoonLight

add domains query / modification
« Reply #3 on: January 03, 2005, 12:48:13 AM »
I suspect you are correct in that I am doing it the hardway, but I feel I have to edit the files in someway as I do not want it to create the following everytime I add a domain.

In the following list below sme is what I called the server.

Say for example I added domain.co.uk as a domain it would create the following.

sme.domain.co.uk
ftp.domain.co.uk
mail.domain.co.uk
www.domain.co.uk
proxy.domain.co.uk
wpad.domain.co.uk

However out of the list above I dont want them all, and I understand that its easy to delete them, but I am unable to delete "sme.domain.co.uk"

But what I am wanting to do is add www.domain.co.uk and for it to only create a hostname for www.domain.co.uk likewise if I added this dev.domain.co.uk as a domain.

As I want www. and dev. to map to different ibays, and I have no need for any of the other hostnames, so I dont wish for them to be created for me.

I have only 1 domain at the moment www. points to a server in a hosting facility, but I am wanting to serve a thing files from my own server at home.

So instead of www., dev. site. radio. files. all pointing to the same ibay I wish for them to point to different ibays, but to do that I have to add them as domains, but when I do this they get prefix so for example dev.domain.co.uk would then become www.dev.domain.co.uk and wpad.dev.domain.co.uk which is what I do not want so trying to find a way to modify the code to get around that issue.

I think I am on the right lines with what I have modified so far I just now need to work out how to make it create a hostname for the domain I have added as at present that is what it does not do and I have to do it manually, and it then is not a static domain, in that there is a remove link which ideally should not be there.

The mail issue is not a problem as the box is only going to be used to serve pages, and wont be handling mail other than maybe the odd mail going out via things like php mail function and the like.

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
add domains query / modification
« Reply #4 on: January 03, 2005, 02:12:51 AM »
Quote from: "MoonLight"

So instead of www., dev. site. radio. files. all pointing to the same ibay I wish for them to point to different ibays, but to do that I have to add them as domains, but when I do this they get prefix so for example dev.domain.co.uk would then become www.dev.domain.co.uk and wpad.dev.domain.co.uk which is what I do not want so trying to find a way to modify the code to get around that issue.


I think you are worrying about nothing. If you do not configure your externally visible DNS so that wpad.dev.domain.co.uk exists, and points to your server, then no HTTP requests for wpad.dev.domain.co.uk will come to your server. All that matters is that requests for dev.domain.co.uk deliver the right content, right?

MoonLight

add domains query / modification
« Reply #5 on: January 03, 2005, 03:11:26 AM »
Quote from: "CharlieBrady"
I think you are worrying about nothing. If you do not configure your externally visible DNS so that wpad.dev.domain.co.uk exists, and points to your server, then no HTTP requests for wpad.dev.domain.co.uk will come to your server. All that matters is that requests for dev.domain.co.uk deliver the right content, right?


Yes that is correct, just was wanting it all to look nice and neat :-) and I would also prefer it to not assume what hostnames a particular domain should have.

I was wanting the box to be just a test server to like put this and that on it, things that I didn't mind to loose if something went wrong, but also wanted it to behave like a real hosting linux server.

Be honest does anyone actually use any of those other subdomains ? ok well maybe www. ftp. and mail. would be ok, but the others ?

If anyone does know what code I need to add to that create hostnames file I would love to hear it and have it.

Anyway I will take this opportunity to ask another question, how often to new official version of the sme server come out ? and also how easy/hard is it to develop rpm for it ?

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
add domains query / modification
« Reply #6 on: January 03, 2005, 03:24:58 AM »
Quote from: "MoonLight"

Yes that is correct, just was wanting it all to look nice and neat :-) and I would also prefer it to not assume what hostnames a particular domain should have.


I agree with you it's not as neat as it could be.

The problem IMO is that the term "virtual domain" is used for two different things. I've long thought that it should handle two thing separately:

- domains for which it handles mail
- web site names

Quote

Anyway I will take this opportunity to ask another question, how often to new official version of the sme server come out ?


There's no fixed answer to that.

Quote

and also how easy/hard is it to develop rpm for it ?


Hard or easy, depending on what you try to achieve :-). If you want to develop rpms, join the devinfo mailing list. You'll get help promptly there.

MoonLight

add domains query / modification
« Reply #7 on: January 03, 2005, 03:28:50 AM »
Thanks all the help everyone it was very much appreciated indeed :-)