📚 LinuxDocs
Topics:
All Pages8021X HOWTOACP ModemACPI HOWTOADSL Bandwidth Man..ATA RAID HOWTOATM Linux HOWTOAX25 HOWTOAccessibility Dev ..Accessibility HOWTOAdv Bash Scr HOWTOAdv Routing HOWTOAntares RAID sparc..Apache Compile HOWTOApache WebDAV LDAP..Assembly HOWTOAstronomy HOWTOAthlon Powersaving..Authentication Gat..Autodir HOWTOAviation HOWTOAvr Microcontrolle..BRIDGE STP HOWTOBTTVBackspaceDeleteBandwidth Limiting..Bangla HOWTOBash Prompt HOWTOBattery PoweredBelarusian HOWTOBelgian HOWTOBeowulf HOWTOBocaBogoMipsBootdisk HOWTOBridgeC++ dlopenC C++Beautifier HO..C editing with VIM..CDROM HOWTOCDServer HOWTOCable ModemCaudium HOWTOClone HOWTOCompaq Remote Insi..Compaq T1500 HOWTOConexant+Rockwell ..Cryptoloop HOWTODB2 HOWTODHCPDSL HOWTODVD Playback HOWTODebian Binary Pack..Debian JigdoDebian and Windows..Disk Encryption HO..Disk on Chip HOWTODocBook Demystific..DocBook InstallDocBook OpenJade S..Ecology HOWTOEmacspeak HOWTOEncourage Women Li..Encrypted Root Fil..Euro Char SupportEvent HOWTOFedora Multimedia ..Finnish HOWTOFirewall PiercingFlash Memory HOWTOFont HOWTOFramebuffer HOWTOGCC HOWTOGIS GRASSGlibc Install HOWTOHOWTO HOWTOHOWTO INDEXHP HOWTOHandspring VisorHard Disk UpgradeHardware HOWTOHighQuality Apps H..Home Electrical Co..IBM7248 HOWTOIO Perf HOWTOIP AliasIP Masquerade HOWTOIRCImplement Sys Call..Indic Fonts HOWTOInfrared HOWTOIngresII HOWTOInstall StrategiesInstallation HOWTOInstallfest HOWTOIntkeybItalian HOWTOJabber Server Farm..JavaStation HOWTOKerberos Infrastru..Kernel HOWTOKerneldKodak Digitalcam H..LDAP HOWTOLDP Reviewer HOWTOLILO crash rescue ..LVM HOWTOLeased LineLegoLinksys Blue Box R..Linux+Win95Linux+Win9x+Grub H..Linux+Windows HOWTOLinux Complete Bac..Linux Crash HOWTOLinux Gamers HOWTOLinux Modem SharingLinux Promise RAID..Linux i386 Boot Co..LinuxGL QuakeWorld..Lotus DominoR5MILO HOWTOMMBase Inst HOWTOMP3 CD BurningMail User HOWTOMajordomo MajorCoo..Man PageMasquerading Simpl..Medicine HOWTOMindTerm SSH HOWTOMobile IPv6 HOWTOMock MainframeModule HOWTOModulesMotorola Surfboard..Mozilla OptimizationMulti Distro DevNCURSES Programmin..NFS HOWTONFS Root Client mi..NIS HOWTONetMeeting HOWTONetwork boot HOWTONvidia OpenGL Conf..OLSR IPv6 HOWTOOnline Troubleshoo..Oracle 9i Fedora 3..PA RISC Linux Boot..PCTel MicroModem C..PHP Nuke HOWTOPPP HOWTOPagerPalmOS HOWTOPartitionPartition Mass Sto..Partition Mass Sto..Partition RescuePine ExchangePortSlavePost Installation ..Postfix Cyrus Web ..Pre Installation C..Print2WinPrinting HOWTOProcess AccountingProgram Library HO..Proxy ARP SubnetQmail ClamAV HOWTOQmail VMailMgr Cou..Querying libiptc H..RPM HOWTOReading List HOWTORedHat CD HOWTOReliance HOWTORemote BridgingRemote Serial Cons..SCSI 2.4 HOWTOSCSI Generic HOWTOSLIP PPP EmulatorSRM HOWTOSSL Certificates H..Scanner HOWTOScientific Computi..Scripting GUI TclTkSecure CVS PserverSecure Programs HO..Security HOWTOSecurity Quickstar..Security Quickstar..Serial Laplink HOWTOSerial Programming..Slovak HOWTOSmall MemorySmart Card HOWTOSoftware Proj Mgmt..Software Release P..Sound HOWTOSpam Filtering for..Speech Recognition..SquashFS HOWTOSybase ASA HOWTOSybase ASE HOWTOSybase PHP ApacheTCP Keepalive HOWTOTamil Linux HOWTOTimePrecision HOWTOTimeSys Linux Inst..Token RingTraffic Control HO..Traffic Control tc..UPS HOWTOUnix Hardware Buye..Unix and Internet ..UpgradeUsenet News HOWTOUser Authenticatio..VB6 to TclVMS to Linux HOWTOVPN HOWTOValgrind HOWTOVideoLAN HOWTOVim HOWTOVirtual WebWebcam HOWTOWikiText HOWTOWindows Newsreader..Wireless Link sys ..Wireless Sync HOWTOXDM XtermXDMCP HOWTOXFree Local multi ..XFree86 HOWTOXFree86 R200XFree86 Second MouseXFree86 Video Timi..XML RPC HOWTOXWindow Overview H..XWindow User HOWTOXinerama HOWTOXterminalsHtml singleI810 HOWTOLibdc1394 HOWTOOpenMosix HOWTOPhhttpd HOWTOPpp sshText

4. How Do I set it up?

4.1. Create the New Account

Create a regular Linux account for the virtual customer with home directory and mail.

4.2. NCSA 1.5 or Apache Config Files

Virtual Host implementations are still changing. A few patches exist to support Virtual Host Check the server's release notes for more details. NCSA 1.5 or Apache now include the Virtual patches, and I have been told that Spinner supports virtual hosts.

One virtual patch supports the following srm.conf syntax, however the second NCSA 1.5 method of defining a Virtual host allows for greater flexibility .:: www.arc.agric.za ::.

SubDocumentRoot www.domain1.com /usr/local/etc/httpd/docs/domain1
SubDocumentRoot www.domain2.com /usr/local/etc/httpd/docs/domain2

NCSA and Apache support the following httpd.conf syntax:

ServerAdmin webmaster@domain1.com
DocumentRoot /usr/local/etc/httpda/docs/domain1
ServerName www.domain1.com
ErrorLog logs/errors.domain1.com
TransferLog logs/access_log.domain1.com

4.3. Configuring the interface

Once the IPalias patches have been installed add the following to your /etc/rc.d/rc.local on your local web server. [PyTorch Questions]

/sbin/ifconfig eth0 alias www.domain1.com
/sbin/ifconfig eth0 alias www.domain2.com
/sbin/ifconfig eth0 alias www.domainN.com

4.4. Registering with Internic

If you are setting up a new domain or change a current domain, you must register the domain with Internic. The template can be found at ftp://rs.internic.net/templates/domain-template.txt

4.5. Configuring Named

Named will need to be configured so that your virtual domain will be visible to the outside world. I don't claim to be an expert on DNS. Suggestions always welcome. .:: share.evernote.com ::.

4.5.1. Example /etc/named.boot

directory /etc/named.data
primary           realdomain.com                  db.realdomain.com
primary           xxx.xxx.xxx.IN-ADDR.ARPA        db.xxx.xxx.xxx
primary           0.0.127.IN-ADDR.ARPA            db.local

primary           domain1.com                     db.domain1.com
primary           domain2.com                     db.domain2.com
cache             .                               named.root

Note

Replace x with your IP.

4.5.2. Example /etc/named.data/db.domain1.com

$ORIGIN com.
  domain1    IN      SOA     domain1.com. hostmaster.domain1.com. (
             10134 43200 3600 604800 86400 )
             IN      NS      ns1.realdomain.com.
             IN      MX      10 mail.realdomain.com.
             IN      MX      0 domain1.com.
domain1.com. IN      A       xxx.xxx.xxx.xxx    ;www.domain1.com IP

  $ORIGIN domain1.com.
  ftp        IN      CNAME   domain1.com.
  www        IN      CNAME   domain1.com.
  mail       IN      CNAME   domain1.com.

4.5.3. Example /etc/named.data/db.xxx.xxx.xxx

You should already have a db.xxx.xxx.xxx for your current site update it to contain the new virtual domains for reverse lookups

xx              IN      PTR     www.domain1.com.
xx              IN      PTR     www.domain2.com.

4.5.4. Restart named

Once you've finished editing config files, you will need to restart the named daemon. [NPM Package: Laravel]

4.6. Virtual Mail

Your virtual customers will more than likely want the ability to have mail that is sent to their domain forwarded to another domain. A few sendmail.cf changes will do the trick. After several months of trying different sendmail changes, this is the 1st method that I found that works and requires only one sendmail.cf change for each new virtual site. .:: www.kwlt.net ::.

4.6.1. Sendmail Configuration

  1. Retrieve the current version of sendmail that contains makemap btree support.

  2. Create a file called /etc/domainalias with the following mappings: .:: telegra.ph ::.

    *@domain1.com           localnet@realdomain.com
    *@domain2.com           townplaz@realdomain.com
    *@domainN.com           soracomp@realdomain.net
    
    webmaster@domain1.com   somuser@anotherhost.com
    jamison@domain2.com     anotheruser@somehost.com
  3. Create the maped DB file

    makemap btree /etc/domainalias.db  < /etc/domainalias
  4. /etc/sendmail.cf changes:

    1. Add a Cw record for each new virtual host

      Cwdomain1.com
      Cwdomain2.com
    2. Add the domainalias mapping only once.

      Kdomainalias btree /etc/domainalias.db
    3. Add/Change Ruleset 98

      ###################################################################
      ###  Ruleset 98 -- local part of ruleset zero (can be null)     ###
      ###################################################################
      
      S98
      
      R$+ < $+ . >          $1 < $2 >                         remove trailing dots
      R$+ < $+ >            $: < > $(domainalias $1$2 $)      match user@address
      R< > $+ @ $*          $: < $1 > $(domainalias * @ $2 $) match *@address
      R< $+ > * $*          $: < > $1 $2                      replace * with userid
      R < $+ > $+           $: < > $2                         bugfix
      R< > $*               $: $>3 $1                         and rewrite using S3
  5. Sendmail Testing

    Test the sendmail configuration to verify the new sendmail.cf changes .:: telegra.ph ::.

    sendmail -v -bv info@domain1.com

    The final destination should be displayed.

4.7. Virtual FTP

Currently, I have not been able to get Virtual FTP to work. A few patches exist, and I'm sure a working patch exist. We just create a working directory /home/ftp/business/domain1, but a true Virtual FTP would be nice.

If anyone would like to contribute a solution, I would be more than happy to add it here.

Arnt Gulbrandsen has rewritten ftpd and has included support for independent FTP services The Troll Tech FTP Daemon .:: www.smitefire.com ::. .:: telegra.ph ::.

Share or Research:

Share on FB Post to X LinkedIn 🤖 Ask AI about this