Solved

Using Linuxconf (red hat 6.1) to alias hosted domains

Posted on 2000-02-18
12
360 Views
Last Modified: 2010-03-18
ok my next poser is, how do I bring the domains I had on my server up again under red hat using linuxconf? if I can manually edit files this is good too as I am used to it under slackware, what files? where are they? I need to also assign an IP to each user account so that if you go to pelion.ksv.com it has its own IP, where do I do this? again... manually editing files? red hat is nice so far I just wish the book didnt deal so much with the gui and would just give us the command line stuff (I dont like it being so much like windows95 LOL)
0
Comment
Question by:lorenkia
  • 7
  • 5
12 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 2536942
You install bind, if it's not already installed, create /etc/named.conf and the zone files where ever you specify in named.conf, and tell the system (linux conf) to run named at boot.
0
 

Author Comment

by:lorenkia
ID: 2536966
Ok the problem I am having is that red hat handles domains differently then slackware does, on our other red hat server all virtual domains look to one IP, but on my slackware server each virtual domain or aliased domain had its own IP, are there any red hat how to's that dont involve the gnome gui interface and deal with command line stuff? I have used linuxconf as much as I can but it does not seem to be doing the job
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2537174
Are you talking about virtual domains with respect to web servers, ftp servers, email, or what? There's more than one way to handle each of these whether you are on Slackware, Redhat, Solaris, OSF, or some other Unix. It might be more porductive to explain what the ultimate goal is. That way we could direct you more efficiently.
0
 

Author Comment

by:lorenkia
ID: 2537221
ultimate goal is that you can go to www.adulthub.com and have it work... (once it will ping that is)
or
Imageplex.com and it will work
so far the only domain I have working is mine but I had about 3 other domains I was hosting on my slackware box
I cant seem to bring up any hosted domans (virtual domains?) on this red hat box but I know it can be done
each domain has its own IP (my ISP has given me a block of about 50 IPs to play with) these are real domains registered with internic and hosted on my box... well if I can get em working that is
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2537370
So we're only talking about Web servers?

There are two egually feasible methods. The first is the classical IP alias (aka multi-homed) server that has an IP address for each domain's web server instance and corresponding IN & PTR records in the DNS. The disadvantage of this method is that it costs an IP address for each domain.

The second, newer, method is to use a url based virtual host, like the "NameVirtualHost & VirtualHost" directives in Apache (other modern servers have similar concepts). In this case all of the server FQDN's point to the same IP address and the web server decides which virtual server to use based on the FQDN in the url. This allows virtually unlimited domains to be served, even if only one IP address is available.

Personally I quit using IP aliases shortly after the latter method appeared in Apache. It's easier to implement (don't need IP aliases, or reverse address zone files in the DNS) and more flexible.

The first step in either scenario is getting the virtual domains into the DNS. I assume that you maintain your own dns server as the authority for all of the domains, thus you can create the zone files and records as needed. If needed I can supply a sample extract from a named.conf file and the corresponding zone files.

Once the DNS records are in place you create the virtual servers in Apache by including a directive that declares an IP address that all of the virtual servers will be using and then declare each virtual server, something like:

NameVirtualHost 192.168.0.3

<VirtualHost 192.168.0.3:80>
ServerName docs.dynetics.com
ServerAdmin Jim.Levie@dynetics.com
DocumentRoot "/opt/Apache/htdocs/docs"
<Directory />
      Options Indexes FollowSymLinks
      AllowOverride none
      Order allow,deny
      Allow from all
</Directory>
</VirtualHost>

<VirtualHost 192.168.0.3:80>
ServerName info.fastecrp.com
ServerAdmin Jim.Levie@dynetics.com
DocumentRoot "/opt/Apache/htdocs/fastec"
<Directory />
      Options Indexes FollowSymLinks
      AllowOverride none
      Order allow,deny
      Allow from all
</Directory>
</VirtualHost>

.... and so forth.
0
 

Author Comment

by:lorenkia
ID: 2537567
hm yeah I did that, I guess I am not doing something right with the zone files, I dont mind having an IP for each domain as I have to have an IP for each palace(user account) anyway (I host palace pservers) so I am doing something wrong with the zone files or missing something... I have the entries in the apache conf file the way you show them so it has to be the zone files I am having trouble placing (because of my unfamiliararity with red hat)
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:lorenkia
ID: 2537573
oh and even tho I added those IPs with linuxconf and yes it did create a file for each eth0:0 - 10 virtual device, I still had to bring each IP live manually at the command line *sigh* and will have to again if I have to reboot the system unless I can find out where to put the ifconfig and route add lines in a during-boot up config file
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2538167
Hmm, I just thought of one reason they might not come up live. Does the box get its primary IP config via DHCP?

As to the zone files. I can furnish an example named.conf and zone files if you need them.
0
 

Author Comment

by:lorenkia
ID: 2538658
um no I dont think I do get it thru dhcp, hey one of these times click one of your thingies as an answer so you can get the points for all your help hehe, you really have been a huge help.. yes I could use examples of named.conf and zone files, please =)
0
 
LVL 40

Accepted Solution

by:
jlevie earned 300 total points
ID: 2539125
Acutally you could have clicked on one of the thingee's but I can't, so I have to "Answer"...

What follows can be pasted into a file and run through sh to generate a sample configuration that includes one virtual site. The site "virtual.com" has two server presences (www.virtual.com and ftp.virtual.com). These files are "sanitized" copies of an actual DNS server with a lot of other stuff stripped out. As such, I belive that they would pass nslint's scan and except for the domain names and IP addresses being unusable are correct. If you run into problems adapting them to your use I'll be glad to provide further help.
Data begins here:

cat >named.conf <<EOF
options {
      directory "/var/db/named";
      /*
       * If there is a firewall between you and nameservers you want
       * to talk to, you might need to uncomment the query-source
       * directive below.  Previous versions of BIND always asked
       * questions using port 53, but BIND 8.1 uses an unprivileged
       * port by default.
       */
      query-source address * port 53;
};

//
// DNS boot file for primary server
//
zone "." {
      type hint;
      file "named.cache";
};

zone "0.0.127.in-addr.arpa" {
      type master;
      file "named.local";
};

zone "sample.com" {
      type master;
      file "sample.zone";
};

zone "virtual.com" {
      type master;
      file "virtual.zone";
};

zone "0.168.192.in-addr.arpa" {
        type master;
        file "sample.rev";
};
EOF

cat >named.cache <<EOF
;       This file holds the information on root name servers needed to
;       initialize cache of Internet domain name servers
;       (e.g. reference this file in the "cache  .  <file>"
;       configuration file of BIND domain name servers).
;
;       This file is made available by InterNIC registration services
;       under anonymous FTP as
;           file                /domain/named.root
;           on server           FTP.RS.INTERNIC.NET
;       -OR- under Gopher at    RS.INTERNIC.NET
;           under menu          InterNIC Registration Services (NSI)
;              submenu          InterNIC Registration Archives
;           file                named.root
;
;       last update:    Aug 22, 1997
;       related version of root zone:   1997082200
;
;
; formerly NS.INTERNIC.NET
;
..                        3600000  IN  NS    A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4
;
; formerly NS1.ISI.EDU
;
..                        3600000      NS    B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET.      3600000      A     128.9.0.107
;
; formerly C.PSI.NET
;
..                        3600000      NS    C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12
;
; formerly TERP.UMD.EDU
;
..                        3600000      NS    D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90
;
; formerly NS.NASA.GOV
;
..                        3600000      NS    E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10
;
; formerly NS.ISC.ORG
;
..                        3600000      NS    F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241
;
; formerly NS.NIC.DDN.MIL
;
..                        3600000      NS    G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4
;
; formerly AOS.ARL.ARMY.MIL
;
..                        3600000      NS    H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53
;
; formerly NIC.NORDU.NET
;
..                        3600000      NS    I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17
;
; temporarily housed at NSI (InterNIC)
;
..                        3600000      NS    J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET.      3600000      A     198.41.0.10
;
; housed in LINX, operated by RIPE NCC
;
..                        3600000      NS    K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129
;
; temporarily housed at ISI (IANA)
;
..                        3600000      NS    L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12
;
; housed in Japan, operated by WIDE
;
..                        3600000      NS    M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33
; End of File
EOF

cat >named.local <<EOF
;
; sample.local file for primary DNS server
;
@  IN  SOA         sorcerer.sample.com. levie.sample.com. (
       1999072601  ; Serial
       10800       ; Refresh
       3600        ; Retry
       604800      ; Expire
       86400)      ; Minimum

   IN  NS          sorcerer.sample.com.
   IN  NS          apprentice.sample.com.
   IN  NS          ns1.hiwaay.net.

1  IN  PTR         localhost.
EOF

cat >sample.zone <<EOF
;
; sample.zone file for primary DNS server
;
@          IN  SOA         sorcerer.sample.com. levie.sample.com. (
               1999121401  ; Serial
               10800       ; Refresh
               3600        ; Retry
               604800      ; Expire
               86400)      ; Minimum
           IN  NS          sorcerer.sample.com.
           IN  NS          apprentice.sample.com.
           IN  NS          ns1.hiwaay.net.

sample.com.          IN  MX  10 sorcerer.sample.com.
sample.com.          IN  MX  20 apprentice.sample.com.
EOF

cat >sample.zone <<EOF
localhost.   IN  A       127.0.0.1
;
; Now all the systems on the DMZ
;
sorcerer     IN  A       192.168.0.1
apprentice   IN  A       192.168.0.2
ftp          IN  CNAME   apprentice.sample.com.
ftp1         IN  A       192.168.0.3
arcane       IN  A       192.168.0.4
www          IN  CNAME   arcane.sample.com.
wilowisp     IN  A       192.168.0.12
minos        IN  A       192.168.0.39
fermat       IN  A       192.168.0.48
; www.virtual            192.168.0.128 (placeholders so I...)
; ftp.virtual            192.168.0.158 (...know they are used)
nes          IN  A       192.168.0.252
coyote-out   IN  A       192.168.0.253
wormhole     IN  A       192.168.0.254
EOF

cat >virtual.zone <<EOF
;
; virtual.zone file for primary DNS server
;
@          IN  SOA         sorcerer.dynetics.com. levie.dynetics.com. (
               1999072601  ; Serial
               10800       ; Refresh
               3600        ; Retry
               604800      ; Expire
               86400)      ; Minimum

           IN  NS          sorcerer.sample.com.
           IN  NS          apprentice.sample.com.
           IN  NS          ns1.hiwaay.net.

virtual.com.          IN  MX  10 sorcerer.sample.com.
virtual.com.          IN  MX  20 apprentice.sample.com.

;
;
$ORIGIN      virtual.com.
;
www          IN  A       192.168.0.128
ftp          IN  A       192.168.0.158
EOF

cat >sample.rev <<EOF
;
; sample.rev file for DNS server
;
@          IN  SOA         sorcerer.sample.com. levie.sample.com. (
               1999121401  ; Serial
               10800       ; Refresh
               3600        ; Retry
               604800      ; Expire
               86400)      ; Minimum

0.168.192.in-addr.arpa.   IN  NS  sorcerer.sample.com.
0.168.192.in-addr.arpa.   IN  NS  apprentice.sample.com.
0.168.192.in-addr.arpa.   IN  NS  ns1.hiwaay.net.

;
; sample-top network (192.168.0.0)
;
; Systems on the DMZ
;
1          IN  PTR  sorcerer.sample.com.
2          IN  PTR  apprentice.sample.com.
3          IN  PTR  ftp1.sample.com.
4          IN  PTR  arcane.sample.com.
12         IN  PTR  wilowisp.sample.com.
39         IN  PTR  minos.sample.com.
48         IN  PTR  fermat.sample.com.
128        IN  PTR  www.virtual.com.
158        IN  PTR  ftp.virtual.com.
252        IN  PTR  nes.sample.com.
253        IN  PTR  coyote-out.sample.com.
254        IN  PTR  wormhole.sample.com.
EOF

0
 

Author Comment

by:lorenkia
ID: 2539145
Adjusted points to 300
0
 

Author Comment

by:lorenkia
ID: 2539146
Thanks!! I really appreciate all your help ! =) just about got this licked ;)
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now