LDP/LDP/howto/linuxdoc/Intranet-Server-HOWTO.sgml

740 lines
40 KiB
Plaintext

<!doctype linuxdoc system>
<article>
<TITLE>The Linux Intranet Server HOWTO</TITLE>
<author>Pramod Karnad, <tt><htmlurl url="mailto:karnad@indiamail.com" name="karnad@indiamail.com"></tt>
<date>v2.12, 2001-12-03
<abstract>
This document describes how to setup an Intranet using Linux as the server which binds Unix, Netware, NT and Windows together. Hence by just establishing the connection to the Linux box you are provided transparent access to all the various platforms. Detailed explanations are provided for setting up HTTP using the NCSA server and connect to it using TCP/IP clients from Novell, Microsoft under Windows3.1, WFWG,Win95 and WinNT and MacTCP on the Apple PowerMac.
</abstract>
<toc>
<sect>Introduction<label id="Intro">
<p>
In simple terms, the <BF>Intranet</BF> is the descriptive term being used for the implementation of Internet technologies within a corporate organisation, rather than for external connection to the global Internet. This implementation is performed in such a way as to transparently deliver the immense informational resources of an organisation to each individuals desktop with minimal cost, time and effort. This document attempts to explain in simple terms how to setup an Intranet using tools which are readily available and are generally costing little or are free.
<p>
This document assumes that you already know how to install TCP/IP on your Linux server and connect it physically to your LAN using an Ethernet network card. This also assumes you have some basic knowledge of Netware, WinNT and Mac systems. The configuration of the Netware server has been shown using version 3.1x as the basis. You can also use INETCFG to achieve the same result. On the client side the discussion is with respect to Windows 3.1x, Windows for Workgroups and Win95, WinNT and the Apple PowerMac.
<P>
I am using the private network addresses (RFC-1918) of 172.16.0.0 and 172.17.0.0 only as examples. You may choose suitable addresses depending on your configuration.
<quote><verb>
Linux Netware WFWG/WinNT
Server Server Server
172.16.0.1 172.16.0.2 172.16.0.3
| | | 172.16.0.0
------+-----+-----+--------+--+--------------
| | 172.16.0.254
W/S 1 Router
172.16.0.5 | 172.17.0.254
|
----------+-------+--------
172.17.0.0 |
W/S 2
172.17.0.5
</verb></quote>
<sect1>What is required
<p>
You will need the following software before attempting the installation.
<itemize>
<item>the HTTP server software which can be downloaded from OneStep NCSA HTTPd Downloader at <htmlurl url="http://hoohoo.ncsa.uiuc.edu/docs/setup/OneStep.html" name="http://hoohoo.ncsa.uiuc.edu/docs/setup/OneStep.html"> page.
<item>The Novell Netware Client available from
<htmlurl url="HTTP://support.novell.com/" name="HTTP://support.novell.com/"> (The TCP/IP files are included with the client).
<item>The Microsoft TCP/IP client available from
<htmlurl url="HTTP://www.microsoft.com/" name="HTTP://www.microsoft.com/">
<item>The Apple MacTCP client available from
<htmlurl url="HTTP://www.apple.com/" name="HTTP://www.apple.com/">
<item>WWW Browsers like Netscape at <htmlurl url="HTTP://home.netscape.com/" name="HTTP://home.netscape.com/"> or MS Internet Explorer at <htmlurl url="HTTP://www.microsoft.com/" name="HTTP://www.microsoft.com/"> or NCSA Mosaic from <htmlurl url="http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/NCSAMosaicHome.html" name="http://www.ncsa.uiuc.edu/SDG/Software/Mosaic/NCSAMosaicHome.html">
</itemize>
<sect1>New versions of this document
<p>
New versions of the Linux Intranet Server HOWTO will be periodically posted to comp.os.linux.announce and comp.os.linux.help. They will also be uploaded to various Linux FTP sites, including sunsite.unc.edu.
<p>
The Latest version of this document is available in HTML format at
<htmlurl url="http://www.inet.co.th/cyberclub/karnadp/http.html" name="http://www.inet.co.th/cyberclub/karnadp/http.html">
<sect1>Feedback
<p>
If you have questions or comments about this document, please feel
free to mail Pramod Karnad, at <htmlurl url="mailto:karnad@indiamail.com" name="karnad@indiamail.com">. Suggestions, criticism and mail are always welcome. If you find a mistake with this document, please let me know so I can correct it in the next version. Thanx.
<sect>Install the HTTP server
<p>
When you download the server you have two options: To get the source and compile it yourself, or get the precompiled binaries. The precompiled binaries for Linux (ELF) version are available at NCSA but not the older versions.
<sect1>Preparation before downloading
<p>
The server at NCSA will guide you through the steps for configuration options and prepare the various files for you. But before you attempt to download HTTPd be prepared with answers to the following questions
<sect2>The Operating System
<p>
First, you must choose whether to download the source or a pre-compiled version of the software. If your particular system doesn't appear in the menu, then you will have to get the default source, and compile it yourself.
<p>
To check the version of your Linux go to the command prompt on your Linux machine and type
<tscreen><verb>
linux:~$ uname -a
</verb></tscreen>
which will respond with a line which looks similar to this
<tscreen><verb>
linux:~$ uname -a
Linux linux 2.0.29 #4 Tue Sep 13 04:05:51 CDT 1994 i586
linux:~$
</verb></tscreen>
<p>
The version of Linux is 2.0.29.
<p>
The remaining parameters can be specified before downloading or configured later by modifying the file <tt>srm.conf</tt> in the <tt>/usr/local/etc/httpd/conf</tt> directory. The names of the actual directives that appear in the file <tt>httpd.conf</tt> are shown in brackets. The only exception is the directive DocumentRoot which appears in the file <tt>srm.conf</tt>
<sect2>Process type (ServerType)
<p>
This specifies how your machine will run your HTTPd server. The preferred method is &quot;standalone&quot;. This makes the HTTP daemon to be running constantly. If you choose to load HTTPd under &quot;inetd&quot;, the server binary will be reloaded into memory for every request, which may slow your server down.
<sect2>Binding Port (Port)
<p>
This specifies which port of your machine that the HTTPd daemon will bind
to and listen for HTTP requests. If you can login as &quot;root&quot;, use the default setting of 80.
Otherwise choose a setting between 1025 and 65535.
<sect2>Server user identity (User)
<p>
This is the user id the server will change to when answering requests and acting on files.This question needs to be answered only if you are running the server as &quot;standalone&quot;.
If you are someone without root permissions, just use your own login name. If you are system administrator, you might want to create a special user so you can control file permissions.
<sect2>Server group identity (Group)
<p>
This is the group id the server will change to when answering requests and acting on files. This is similar to Server User identity and is applicable only if you are running the server as standalone.
<p>
If you do not have root permissions, just use the name of your primary group. You can find out your group by typing
<bf>groups</bf> at the Linux command prompt.
<sect2>Server administrator email address (ServerAdmin)
<p>
This is the email address that the user should send an email message to when reporting a problem with the server. You can put your personal e-mail address.
<sect2>Location of server directory (ServerRoot)
<p>
This is where the server resides on your system. If you have root permissions leave it in its recommended location <tt>/usr/local/etc/httpd</tt>. If you cannot login as root, choose a subdirectory in your home path. You can find out the path of your home directory with the <bf>pwd</bf> command.
<sect2>Location of HTML files (DocumentRoot)
<p>
This is where the HTML files to be served are located. The default location is <tt>/usr/local/etc/httpd/htdocs</tt>.
You could however set it to be the home directory of the special user you chose in Server user identity, or a subdirectory
in your home directory if you can't login as root.
<P>
When in doubt, use the default settings. Now that you have answers to the above questions you can Download NCSA HTTPd at <htmlurl url="http://hoohoo.ncsa.uiuc.edu/docs/setup/OneStep.html" name="http://hoohoo.ncsa.uiuc.edu/docs/setup/OneStep.html">. You should read the HTTPd Documentation at <htmlurl url="http://hoohoo.ncsa.uiuc.edu/docs/" name="http://hoohoo.ncsa.uiuc.edu/docs/"> before you attempt installation. If you are planning to compile the code then you need to modify the makefiles in each of the th
ree directories <tt>support, src, cgi-src</tt>. If your version of Linux is already supported then you just have to type <bf>make linux</bf> at the top level directory (i.e. <tt>/usr/local/etc/httpd</tt>)
<sect1>Compiling HTTPd
<p>
Compiling is simple, just type <tt>make linux</tt> at the prompt in the server root directory.
<bf>Note:</bf> Users of pre-ELF Linux have to uncomment <tt>#define NO_PASS</tt> in file <tt>portability.h</tt> and set <tt>DBM_LIBS= -ldbm</tt> in the <tt>Makefile</tt> before compiling HTTPd.
<sect>Testing HTTPd
<p>
After you have installed HTTPd, login as root and start it by typing <bf>httpd &amp; </bf>. (assuming you have installed as standalone) You should now be able to see it in the list generated by <bf>ps</bf>. The simplest way to test HTTPd is by Telnet. At the Linux command prompt type
<tscreen><verb>
linux:~$ telnet 172.16.0.1 80
</verb></tscreen>
where 80 is the default port for HTTP. If you have configured &quot;Port&quot; as something different then type that number instead. You should get a response which looks like this
<tscreen><verb>
Trying 172.16.0.1...
Connected to linux.mydomain.
Escape character is '^]'.
</verb></tscreen>
Now if you type in any character and press Enter you should get a response similar to the one shown below.
<tscreen><verb>
HTTP/1.0 400 Bad Request
Date: Wed, 10 Jan 1996 10:24:37 GMT
Server: NCSA/1.5
Content-type: text/html
<HEAD><TITLE>400 Bad Request < /TITLE> < /HEAD>
<BODY><H1>400 Bad Request < /H1>
Your client sent a query that this server could
not understand.<P>
Reason: Invalid or unsupported method.<P>
< /BODY>
</verb></tscreen>
<P>
Now we are ready to connect to this server using another PC and a WWW Browser.
<sect>Connecting to the Linux Server
<p>
Please refer to the diagram shown in the chapter <ref id="Intro" name="Introduction"> for the addressing scheme used. Workstation 1 (W/S1) is on network 172.16.0.0 and can access the Linux server directly whereas Workstation 2 (W/S2) is on network 172.17.0.0 and needs to use the gateway (router) 172.17.0.254 to access the Linux box. This gateway information needs to be provided while configuring the clients only on W/S2. Netware refers to the gateway as 'ip_router'.
<p>
I am using W/S2 to illustrate the client setup. To setup W/S1 just change the address 172.17.0.5 to 172.16.0.5 and ignore all references to the gateway/router.
<p>
If you do not have a router you can skip the next section and proceed to
<itemize>
<item><ref id="SetupNW" name="Setup Netware Server"> if you use a Netware server.
<item><ref id="MSClient" name="Setup MS Windows Client"> if you use the Microsoft Client.
</itemize>
<sect1>Setup the Linux server
<p>
<BF>You may skip this section if you do not have a router.</BF>
<p>
You have to configure the Linux server to recognise the router thus allowing
Workstation 2 to connect to the Web server. In order to setup the Linux server you should login as root. At the server prompt type
<tscreen><verb>
route add gw default 172.16.0.254
</verb></tscreen>
To use this gateway everytime you boot the Linux server edit the file <tt>/etc/rc.d/rc.inet1</tt> and change the line containing the gateway definition to <tt>GATEWAY = "172.16.0.254"</tt>. Make sure the line for adding the gateway is not commented out.
<p>
ALT: You can add routes to the networks on the other side of the router. This would be done as
<tscreen><verb>
route add -net 172.17.0.0 gw 172.16.0.254
</verb></tscreen>
To add this route everytime you boot Linux add the command to your <tt>/etc/rc.d/rc.local</tt> file.
<P>
<sect1>Setup the Netware server<label id="SetupNW">
<p>
In order to setup the Netware server you should have Supervisor permissions or atleast Console operator permissions. If these cannot be got, try asking your Network Administrator to help you with the setup.
At the Server enable the Ethernet_II frame type on the LAN by typing these commands or include them in the AUTOEXEC.ncf file.
<tscreen><verb>
load NE2000 frame=Ethernet_II name=IPNET
load TCPIP
bind IP to IPNET addr=172.16.0.2 mask=FF.FF.FF.0
</verb></tscreen>
<P>
You might have to specify the slot or board number while loading the NE2000 driver depending on your machine configuration. (eg: load NE2000 slot=3 frame=.....)
<sect1>Setup the Netware Client<label id="NWClient">
<p>
On the PC you have the choice of Win3.1,WFWG or Win95. The installation procedure differs between Win95 and the older windows if you are using the 32bit client from Microsoft or Novell. If you are going to use the 16bit client, the procedure is the same and you can refer to the Windows 3.x installation instructions. For installing the 32bit client for Win95 skip to <ref id="NWWin95" name="Windows 95 installation">.
<sect2>Windows 3.x<label id="NWWin">
<p>
If you are using Win3.1 or WFWG you can install the Netware Client (VLMs) and some additional files which are provided with the TCP/IP diskette, namely
<p>
TCPIP.exe, VTCPIP.386, WINSOCK.dll and WLIBSOCK.dll
<P>
Note that the WINSOCK.dll file is different from the ones provided with Win95 and Trumpet. Install the Netware Client with the support for windows. Copy VTCPIP.386, WINSOCK.dll and WLIBSOCK.dll to the SYSTEM directory and TCPIP.exe to the NWCLIENT directory. Now modify the STARTNET.bat in the NWCLIENT directory to
<tscreen><verb>
lsl
ne2000 ---> your network card driver
c:\windows\odihlp.exe ---->if you are using WFWG
ipxodi
tcpip ---> add this line
nwip ---> if you use Netware/IP
vlm
</verb></tscreen>
<P>
Create a subdirectory (say) <tt>&bsol;NET&bsol;TCP</tt> and copy the files HOSTS, NETWORKS, PROTOCOLS and SERVICES from <tt>/etc</tt> on your Linux server or the directory <tt>SYS:ETC</tt> on your Netware server. Edit the copied HOSTS file to add the line for your new Linux server. This will enable you to refer to the Linux server as <tt>http://linux.mydomain/</tt> instead of <tt>http://172.16.0.1/</tt>in your WWW browser
<tscreen><verb>
127.0.0.1 localhost
172.16.0.1 linux.mydomain
</verb></tscreen>
<p>
Edit the NET.cfg file in NWCLIENT directory
<tscreen><verb>
Link Driver NE2000
port 300
int 3
MEM D0000
FRAME Ethernet_802.2
; ---- add these lines ----
FRAME Ethernet_II
Protocol TCPIP
PATH TCP_CFG C:\NET\TCP
ip_address 172.17.0.5
ip_netmask 255.255.255.0
ip_router 172.17.0.254 ---> add the address of your gateway only
---> if you have to use this
---> gateway to reach your HTTP server
Link Support
MemPool 6192 ---> the minimum is 1024. Try with different values
Buffers 10 1580 ---> this again can be fine tuned
;---------------------------------
; You may need to add lines like these if you are using Netware/IP
;
NWIP
NWIP_DOMAIN_NAME mydomain
NSQ_BROADCAST ON
NWIP1_1 COMPATIBILITY OFF
AUTORETRIES 1
AUTORETRY SECS 10
</verb></tscreen>
Edit the SYSTEM.ini file in the WINDOWS directory and add this entry for VTCPIP.386
<tscreen><verb>
[386Enh]
.....
network=*vnetbios, vipx.386, vnetware.386, VTCPIP.386
.....
</verb></tscreen>
<p>
Reboot your PC, run STARTNET.bat and you can now use your favorite WWW browser to access your Web pages. You need not login to Netware and you don't have to run TCPMAN (if you use Trumpet Winsock).
<sect2>Windows 95<label id="NWWin95">
<p>
This section explains how to install the 32bit client on Win95. Firstly you must install the following
<tscreen><verb>
Client for Netware Networks (from Microsoft or Novell)
Microsoft TCP/IP Protocol
Network Adapter
</verb></tscreen>
<p>
To install these items, click on My Computer, Control Panel, Networks. Click Add. You will now be in a window that displays Client, Adapter, Protocol and Service.
To install the Client for Netware Networks:
<tscreen><verb>
1. DoubleClick on Client
2. Click on Microsoft or Novell
3. DoubleClick on Client for Netware Networks
</verb></tscreen>
<p>
To install the TCP/IP Protocol:
<tscreen><verb>
1. DoubleClick on Protocol
2. Click on Microsoft
3. DoubleClick on TCP/IP
</verb></tscreen>
<p>
Windows 95 by default installs several other protocols automatically. Remove
them by clicking on them and clicking the Remove button. Typically Win95 installs the Microsoft NetBeui protocol, and IPX/SPX compatible protocol. You can delete the NetBEUI protocol, but you will need the IPX/SPX protocol if you wish to login to the Netware Server.
<p>
To setup TCP/IP click on TCP/IP, click on Properties, click on the tab IP address
<tscreen><verb>
Enter your IP address in the &quot;Specify an IP address &quot;
box as 172.17.0.5
In the Subnet Mask box enter 255.255.255.0
</verb></tscreen>
select the tab Gateway
<tscreen><verb>
Enter your gateway (router) address in the box New gateway
as 172.17.0.254
Click the Add button
</verb></tscreen>
The gateway address should now appear under the installed gateways box. Now Click OK.
<p>
You should get a message to reboot. Do so. You should now be able to use the Browser to connect to your HTTP Server.
<sect1>Setup Microsoft Client<label id="MSClient">
<p>
If you are using the Microsoft Client for accessing your network, then this section details how to install TCP/IP for
<itemize>
<item><ref id="MSWFWG" name="Windows for Workgroups (WFWG)">
<item><ref id="MSWin95" name="Windows 95">
<item><ref id="MSWinNT" name="Windows NT 4.0">
</itemize>
<BF>Note: </BF>To enable you to refer to the Linux server as <tt>http://linux.mydomain/</tt> instead of <tt>http://172.16.0.1/</tt> in the WWW browser and all your intranet commands you need to edit the <tt>hosts</tt> file. You can add more entries for each of your other hosts (Netware, Unix, WinNT) as well. The Windows family keeps its HOSTS file in <tt>&bsol;WINDOWS</tt> or in <tt>&bsol;WINDOWS&bsol;SYSTEM</tt> depending on the version. Edit this file and add a line for your Linux server as:
<tscreen><verb>
127.0.0.1 localhost
172.16.0.1 linux.mydomain
172.16.0.2 netware.mydomain
172.16.0.3 winNT.mydomain
172.16.0.5 ws_1
</verb></tscreen>
<sect2>Windows for Workgroups<label id="MSWFWG">
<p>
This section explains how to install the 32bit client on WFWG. Firstly you must
download the TCP/IP drivers for Windows from Microsoft. The current version is 3.11b and is available at <htmlurl url="ftp://ftp.microsoft.com" name="ftp://ftp.microsoft.com"> or other sites as <tt>tcp32b.exe</tt>. Make sure that you have load Win32s before trying to load the TCP/IP-32bit driver.
<p>
Having expanded the TCP/IP files into a temporary directory (say <tt>C:&bsol;TEMP</tt>), check your <tt>&bsol;WINDOWS&bsol;SYSTEM</tt> directory for copies of <tt>OEMSETUP.INF</tt>. If there are any, rename them. Now copy the <tt>OEMSETUP.INF</tt> file from the TEMP directory to the <tt>&bsol;WINDOWS&bsol;SYSTEM</tt> directory. If you have loaded any other TCP/IP stacks on your system, please remove them before you proceed.
<p>
Start Network Setup or Windows Setup/Change Network settings
<tscreen><verb>
Click the Networks button
Click Install Microsoft Windows Network.
Choose support for additional networks (if required)
Click OK
</verb></tscreen>
You should be prompted for your network adapter - select the appropriate one. If you are not prompted, then
<tscreen><verb>
Click the Adapter button
select an adapter (say NE2000)
Click OK
Click the Protocol button
select the MS TCP/IP-32 protocol
click OK
</verb></tscreen>
You will now be prompted to configure the TCP/IP protocol stack. You can always reconfigure this by highlighting the TCP/IP protocol shown in the box Adapters
and clicking the Setup button.
<tscreen><verb>
In the IP address box enter 172.17.0.5
In the Subnet Mask box enter 255.255.255.0
Enter your gateway (router) address in the box default gateway
as 172.17.0.254
</verb></tscreen>
Click OK. The computer will ask you to restart. Do so. You should now be able to use the Browser to connect to your HTTP Server.
<sect2>Windows 95<label id="MSWin95">
<p>
This section explains how to install the 32bit client for Microsoft on Win95. Firstly you must install the following
<tscreen><verb>
Client for Microsoft Networks
Microsoft TCP/IP Protocol
Network Adapter
</verb></tscreen>
<p>
To install these items, click on My Computer, Control Panel, Networks. Click Add. You will now be in a window that displays Client, Adapter, Protocol and Service.
To install the Client for Microsoft Networks:
<tscreen><verb>
1. DoubleClick on Client
2. Click on Microsoft
3. DoubleClick on Client for Microsoft Networks
</verb></tscreen>
<p>
To install the TCP/IP Protocol:
<tscreen><verb>
1. DoubleClick on Protocol
2. Click on Microsoft
3. DoubleClick on TCP/IP
</verb></tscreen>
<p>
Windows 95 by default installs several protocols automatically. Remove
them by clicking on them and clicking the Remove button. Typically Win95 installs the Microsoft NetBeui protocol.
<p>
To setup TCP/IP click on TCP/IP, click on Properties, click on the tab IP address
<tscreen><verb>
Enter your IP address in the &quot;Specify an IP address &quot;
box as 172.17.0.5
In the Subnet Mask box enter 255.255.255.0
</verb></tscreen>
select the tab Gateway
<tscreen><verb>
Enter your gateway (router) address in the box New gateway
as 172.17.0.254
Click the Add button
</verb></tscreen>
The gateway address should now appear under the installed gateways box. Now Click OK.
<p>
You should get a message to reboot. Do so. You should now be able to use the Browser to connect to your HTTP Server.
<sect2>Windows NT<label id="MSWinNT">
<p>
This section details how to Install the TCP/IP client for WinNT 4.0.
Start Control Panel/ Network
<tscreen><verb>
Select the Adapter tab.
Click Add to add a new adapter (if you don't have one)
</verb></tscreen>
You should be prompted for your network adapter - select the appropriate one. To add the protocols.
<tscreen><verb>
Select the Protocols tab
Click Add
Select the TCP/IP protocol
Click OK
</verb></tscreen>
You will now be prompted to configure the TCP/IP protocol stack. You can always reconfigure this by highlighting the TCP/IP protocol and clicking the Properties button.
<tscreen><verb>
Select the tab IP Address
Mark the checkbox 'Specify an IP address'
In the IP address box enter 172.17.0.5
In the Subnet Mask box enter 255.255.255.0
Enter your gateway (router) address in the box Default Gateway
as 172.17.0.254
</verb></tscreen>
Click OK. The computer will ask you to restart. You can now use any Browser to connect to your HTTP Server.
<sect1>Setup TCP/IP on Macintosh<label id="MacClient">
<p>
If you are using the Macintosh for accessing your network, then
this section details how to install MacTCP for the PowerMacs.
<BF>Note: </BF>To enable you to refer to the Linux
server as <tt>http://linux.mydomain/</tt> instead of
<tt>http://172.16.0.1/</tt> in the WWW browser and all your intranet
commands you need to edit the <tt>hosts</tt> file. The format of the
hosts file is different from the one used in Unix. The Mac hosts file is
based on RFC-1035. You can add more entries for each of your other hosts
(Netware, Unix, WinNT) as well. The MacOS keeps its HOSTS file in the
<tt>Preferences folder</tt> under the <tt>System folder</tt>. Edit this file and add a line
for your Linux server as:
<tscreen><verb>
linux.mydomain A 172.16.0.1
netware.mydomain A 172.16.0.2
winNT.mydomain A 172.16.0.3
ws_1 A 172.16.0.5
</verb></tscreen>
<sect2>MacTCP<label id="MacTCP">
<p>
This section explains how to install MacTCP. Firstly
you must download the MacTCP files from Apple or install it from the Internet Connection CD.
To configure MacTCP, click the Apple Menu/ Control Panels/ TCP/IP. In the screen change the setting for 'Connect via:' to 'Ethernet'
<p>
Change the 'Configure' setting to 'Manually'
<tscreen><verb>
In the IP address box enter 172.17.0.5
In the Subnet Mask box enter 255.255.255.0
Enter your gateway (router) address in the box
Router address as 172.17.0.254
</verb></tscreen>
Click OK. You should now be able to use the Browser to connect to your HTTP Server.
<sect>Setting up the Intranet
<p>
An Intranet cannot be complete without sharing the resources on the different platforms. You will need support for other filesystems, so that you can access the data available on them. This document provides instructions to connect Linux to the following popular filesystems.
<itemize>
<item><ref id="NCPFS" name="NCP filesystem for Netware">
<item><ref id="SMBFS" name="SMB filesystem for Windows">
<item><ref id="NFS" name="NFS filesystem for Unix">
</itemize>
<p>
These filesystems can be compiled into the Linux kernel or added as modules, depending on the version of Linux. If you are not familiar with compiling the kernel you can refer to the Kernel HOWTO <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/Kernel-HOWTO.html" name="http://sunsite.unc.edu/mdw/HOWTO/Kernel-HOWTO.html"> and the Module HOWTO <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/Module-HOWTO.html" name="http://sunsite.unc.edu/mdw/HOWTO/Module-HOWTO.html"> for compiling the kernel with modules.
<p>
<sect1>NCPFS<label id="NCPFS">
<p>
To share the files on the Netware server you will need support for NCP (ncpfs). NCPFS works with kernel version 1.2.x and 1.3.71 upwards. It does not work with any earlier 1.3.x kernel. It cannot access the NDS database in Netware 4.x, but can make use of the bindery. If you are using Netware 4.x you can enable bindery support for specific containers using the command <tt>Set Bindery Context</tt> at the console as:
<tscreen><verb>
set Bindery Context = CORP.MYDOM;WEBUSER.MYDOM
</verb></tscreen>
In the above example two containers have bindery support enabled.
<p>
You will need to download the NCP filesystem utilities using the URL <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/filesystems/ncpfs/ncpfs.tgz" name="ftp://sunsite.unc.edu/pub/Linux/system/filesystems/ncpfs/ncpfs.tgz"> (currently ncpfs-2.0.10) from Sunsite.
<p>
<sect2>Installation
<p>
To install the ncpfs utilities, type
<tscreen><verb>
zcat ncpfs.tgz | tar xvf -
</verb></tscreen>
to expand the files into its own directory. In this case you will get a directory <tt>ncpfs-2.0.10</tt> Change your directory to this ncpfs directory before proceeding with the installation. Read the README and edit the Makefile if necessary.
<p>
The installation of ncpfs depends on the kernel version you are
using. For kernel 1.2, you should simply type 'make'. Subsequently typing 'make install' will install the executables and man pages.
<p>
If you use Kernel 1.3.71 or later, you might have to recompile your
kernel. With these kernels, the kernel part of ncpfs is already
included in the main source tree. To check if the kernel needs to be recompiled type
<tscreen><verb>
cat /proc/filesystems
</verb></tscreen>
It should show you a line saying that the kernel knows ncpfs.
<p>
If ncpfs is not there, you can either recompile the kernel or add ncpfs as a module. For recompiling the kernel you should type 'make config' and when it asks you for
<p>
<tt>The IPX protocol (CONFIG_IPX) [N/y/?]</tt>
<p>
simply answer 'y'. Probably you do not need the full internal net that
you are asked for next. Once the kernel is successfully installed, reboot, check <tt>/proc/filesystems</tt> and if everything is OK proceed with the installation of the ncpfs utilities. Change directory to the location holding your downloaded ncpfs files, and type 'make'. After the compilation is finished type 'make install' to install the various utilities and man pages.
<p>
<sect2>Mounting NCPFS
<p>
To check the installation type
<tscreen><verb>
ipx_configure --auto_interface=on --auto_primary=on
....wait for 10 seconds and type
slist
</verb></tscreen>
You should be able to see a list of your Netware servers. Now we are ready to share files from the Netware server.
<p>
Suppose we need to access HTML files from directory <tt>&bsol;home&bsol;htmldocs</tt> on volume VOL1: on the server MYDOM_NW, I recommend that you create a new user (say) 'EXPORT' with password 'EXP123' on this server to whom you grant appropriate access rights to this directory using SYSCON or NWADMIN.
<p>
On the Linux machine create a new directory <tt>/mnt/MYDOM_NW</tt>. Now type the command
<tscreen><verb>
ncpmount -S MYDOM_NW -U EXPORT -P EXP123 /mnt/MYDOM_NW
</verb></tscreen>
to mount the netware file system. Typing the command
<tscreen><verb>
ls /mnt/MYDOM_NW/vol1/home/htmldocs
</verb></tscreen>
will show you a list of all the files in <tt>MYDOM_NW/VOL1:&bsol;HOME&bsol;HTMLDOCS</tt> (using Netware file notation). If you have any problems please read the IPX HOWTO at <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/IPX-HOWTO.html" name="http://sunsite.unc.edu/mdw/HOWTO/IPX-HOWTO.html"> for more insights into the IPX system.
<sect1>SMBFS<label id="SMBFS">
<p>
To share the files on the Windows server you will need support for SMB (smbfs).
<p>
You will need to download the SMB filesystem utilities from <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/filesystems/smbfs/smbfs.tgz" name="ftp://sunsite.unc.edu/pub/Linux/system/filesystems/smbfs/smbfs.tgz"> (currently smbfs-2.0.1) from Sunsite.
<p>
<sect2>Installation
<p>
To install the smbfs utilities, type
<tscreen><verb>
zcat smbfs.tgz | tar xvf -
</verb></tscreen>
to expand the files into its own directory. In this case you will get a directory <tt>smbfs-2.0.1</tt> Change your directory to this smbfs directory before proceeding with the installation. Read the README and edit the Makefile if necessary.
<p>
The installation of smbfs depends on the kernel version you are
using. For kernel 1.2, you should simply type 'make'. Subsequently typing 'make install' will install the executables and man pages.
<p>
If you use Kernel 2.0 or later, you might have to recompile your
kernel. With these kernels, the kernel part of smbfs is already
included in the main source tree. To check if the kernel needs to be recompiled type
<tscreen><verb>
cat /proc/filesystems
</verb></tscreen>
It should show you a line saying that the kernel knows smbfs.
<p>
If smbfs is not there, you can either recompile the kernel or add smbfs as a module. For recompiling the kernel you should type 'make config' and when it asks you for
adding SMB filesystem support
simply answer yes. Once the kernel is successfully installed, reboot, check <tt>/proc/filesystems</tt> and if everything is OK proceed with the installation of the smbfs utilities. Change directory to the location holding your downloaded smbfs files, and type 'make'. After the compilation is finished type 'make install' to install the various utilities and man pages.
<p>
<sect2>Mounting SMBFS
<p>
In our example let us assume that the WinNT server is called 'MYDOM_NT' and is sharing its directory <tt>C:&bsol;PUB&bsol;HTMLDOCS</tt> with a share name of 'HTMLDOCS' without a password. On the Linux machine create a new directory <tt>/mnt/MYDOM_NT</tt>. Now type the command
<tscreen><verb>
smbmount //MYDOM_NT/HTMLDOCS /mnt/MYDOM_NT -n
</verb></tscreen>
<p>
to mount the SMB (windows share) file system. If this does not work try
<tscreen><verb>
smbmount //MYDOM_NT/COMMON /mnt/MYDOM_NT -n -I 172.16.0.3
</verb></tscreen>
Typing the command
<tscreen><verb>
ls /mnt/MYDOM_NT
</verb></tscreen>
will show you a list of all the files in <tt>bsol;bsol;MYDOM_NT&bsol;PUB&bsol;HTMLDOCS</tt> (using Windows file notation).
<p>
<sect1>NFS<label id="NFS">
<p>
First you will need a kernel with the NFS file system either compiled in or available as a module.
<p>
Suppose you have a Unix host running NFS with the name MYDOM_UNIX and an IP address of 172.16.0.4. You can check the directories that are being exported (shared) by this host by typing the command
<tscreen><verb>
showmount -e 172.16.0.4
</verb></tscreen>
Once we know the exported directories you can mount them by entering a appropriate mount command. I recommend that you create a subdirectory under '/mnt' (say) 'MYDOM_UNIX' and use that as your mount point.
<tscreen><verb>
mount -o rsize=1024,wsize=1024 172.16.0.4:/pub/htmldocs /mnt/MYDOM_UNIX
</verb></tscreen>
The rsize and wsize may have to be changed depending on your environment.
<p>
If you have any problems please read the NFS HOWTO at <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/NFS-HOWTO.html" name="http://sunsite.unc.edu/mdw/HOWTO/NFS-HOWTO.html"> for more insights into the NFS system.
<p>
<sect>Accessing the Web<label id="AccessHTML">
<p>
Now that we have setup the HTTP server, the clients and interconnected the Linux server with the other servers, we need to make some small adjustments on the Linux server to be able to access these mounted filesystems from the Web Browser.
<sect1>Accessing the mounted filesystems
<p>
To access the mounted directories in your HTML pages you have two methods:
<itemize>
<item>Create a link in DocumentRoot (<tt>/usr/local/etc/httpd/htdocs</tt>) to refer to the mounted directory as
<tscreen><verb>
ln -s /mnt/MYDOM_NW/vol1/home/htmldocs netware
or
ln -s /mnt/MYDOM_NT winNT
or
ln -s /mnt/MYDOM_UNIX unix
</verb></tscreen>
<item>to edit the file <tt>srm.conf</tt> in your <tt>/usr/local/etc/httpd/conf</tt> directory and add a new alias.
</itemize>
<tscreen><verb>
# Alias fakename realname
Alias /icons/ /usr/local/etc/httpd/icons/
# alias for netware server
Alias /netware/ /mnt/MYDOM_NW/vol1/home/htmldocs/
Alias /winNT/ /mnt/MYDOM_NT/
Alias /unix/ /mnt/MYDOM_UNIX
</verb></tscreen>
And restart your HTTPd. You can access the documents on the netware server by referring to them as <tt>http://linux.mydomain/netware/index.htm</tt> for the netware files and similar notations for the others.
<sect1>Connecting to the Internet
<p>
You can finally connect your Intranet to the Internet to access E-Mail and all the wonderful information out there. I propose to write a brief note on how to do this in a future revision. Detailed explanations are available in the ISP Hookup HOWTO from <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/ISP-Hookup-HOWTO.html" name="http://sunsite.unc.edu/mdw/HOWTO/ISP-Hookup-HOWTO.html"> and Diald mini HOWTO at <htmlurl url="http://sunsite.unc.edu/mdw/HOWTO/mini/Diald" name="http://sunsite.unc.edu/mdw/HOWTO/mini/Diald"> for setting up these connections.
<sect1>Other uses
<p>
The HTTP server can be used in the office to provide transparent access to information residing on different servers, at several locations and directories. The data can be simple documents in Word, Lotus spreadsheets, or complex databases.
<p>
The application of this technology is being typically used as follows:-
<P>
<itemize>
<item>Publishing corporate documents<p>
These documents can include newsletters, annual reports, maps, company facilities, price lists, product information literature, and any document which is of value within the corporate entity.
<item>Access into searchable directories<p>
Rapid access to corporate phone books and the like. This data can be mirrored at a Web site or, via CGI scripts, the Web server can serve as a gateway to back-end pre-existing or new applications. This means that, using the same standard access mechanisms, information can be made more widely available and in a simpler manner.
This means that it can be used to create an interface with RDBMS like ORACLE and SYBASE for generating real-time information. Here is a list of links to such sites on the Web.
<p>
- Web Access - <htmlurl url="http://cscsun1.larc.nasa.gov/~beowulf/db/web&lowbar;access.html" name="http://cscsun1.larc.nasa.gov/~beowulf/db/web&lowbar;access.html">
- CGI gateways - <htmlurl url="HTTP://www.w3.org/hypertext/WWW/RDBGate/Overview.html" name="HTTP://www.w3.org/hypertext/WWW/RDBGate/Overview.html">
<item>Corporate/Department/Individual pages<p>
As cultures change within organistions to the point where even each department moves towards their own individual mission statements, the Intranet technology provides the ideal medium to communicate current information to the Department or Individual. Powerful search engines provide the means for people to find the group or individual who has the answers to the continuous questions which arise in the normal day-to-day course of doing business.
<item>Simple Groupware applications<p>
With HTML forms support, sites can provide sign-up sheets, surveys and simple scheduling.
<item>Software distribution<p>
Administrators can use the Intranet to deliver software and up-dates on-demand to users across the corporate network . This can be done with 'Java' which allows the creation and transparent distribution of objects on-demand rather than just data or applications. This is indeed possible more easily with the newer versions of Linux which has builtin support for Java.
<item>Mail<p>
With the move to the use of Intranet mail products with standard and simple methods for attachment of documents, sound, vision and other multimedia between individuals, mail is being pushed further forward as a simple, de facto communications method. Mail is essentially individual to individual, or individual to small group, communication. Several utilities are available on the Linux platform to setup an E-mail system like <bf>sendmail, pop3d, imapd</bf>.
<item>User Interface<p>
The Intranet technology is evolving so rapidly that the tools available, in particular HTML, can be used to dramatically change the way we interface with systems. With HTML you can build an Interface which is only limited by the creators imagination. The beauty about using Intranet technologies for this is that it is so simple. Clicking a hyperlink from HTML can take you to another page, it could ring an alarm, run a yearend procedure or anything else that a computer program can do.
</itemize>
<sect>More things to do
<P>
Here is a list of other interesting things to do with your Linux Intranet server. All the software mentioned below is freeware or shareware.
<itemize>
<item>Browse the Linux server using Network Neighbourhood in Win95/ NT; Setup a WINS like NBT server. Check out the SAMBA Web page at <htmlurl url="http://lake.canberra.edu.au/pub/samba/samba.html" name="http://lake.canberra.edu.au/pub/samba/samba.html">
<item>Implement a search engine on your Intranet. Connect to ht://Dig at <htmlurl url="http://htdig.sdsu.edu/" name="http://htdig.sdsu.edu/">
<item>Use CUSeeMe by setting up a local reflector. Refer to their page at Cornell <htmlurl url="http://cu-seeme.cornell.edu/" name="http://cu-seeme.cornell.edu/">
<item>Setup Web Conferencing. Use COW from <htmlurl url="http://thecity.sfsu.edu/COW/" name="http://thecity.sfsu.edu/COW/">
<item>Deploy a SQL database. Refer to the mSQL Home page at <htmlurl url="http://Hughes.com.au/" name="http://Hughes.com.au/">
<item>Setup FTP,Gopher,Finger,Bootp servers on the Netware server. Get them at <htmlurl url="http://mft.ucs.ed.ac.uk/" name="http://mft.ucs.ed.ac.uk/">
<item>Emulate a Netware server. Check out the NCP Utilities at <htmlurl url="ftp://sunsite.unc.edu/pub/Linux/system/filesystems/ncpfs/" name="ftp://sunsite.unc.edu/pub/Linux/system/filesystems/ncpfs/">
</itemize>
If you find other interesting things to do with your Linux Intranet server, please feel free to mail me.
<sect>Credits and Legalities
<p>
<sect1>Thanks
<p>
Thanks to the people at NCSA for providing such excellent documentation,
David Anderson and all others for trying out this HOWTO and sending in their comments. The details on Netware/IP are courtesy Romel Flores (rom@mnl.sequel.net).
<p>
<sect1>Copyright and License
<P>
This document is copyrighted &copy; 1996,1997 Pramod Karnad.
<P>
This document is distributed under the terms of the GNU Free Documentation License.
You should have received a copy along with it. If not, it is available from
<url url="http://www.fsf.org/licenses/fdl.html">.
<P>
</article>