Advertisment

Linux for Enterprise: Setting up Network Services 

author-image
PCQ Bureau
New Update

To set up the standard server services, we will use a Web-based package called Webmin that ships with PCQLinux 2004. We assume that you have done a server installation. To start Webmin, issue the following command.

Advertisment

service webmin start



Key in the following URL in your Web browser (Mozilla or Konqueror): https://127.0.0.1:10000.

Log in using root as username and the corresponding password (of the root user on the machine). If you get an authentication error, try log in without a password and make sure that you set a password after log in, by clicking on Webmin>Webmin Users>root. 

Note: We assume that during the PCQLinux 2004 installation, you would have installed the packages corresponding to the network services. If not, you will find the RPMs for the packages on the PCQLinux CDs, which can be installed through a rpm —ivh command. You can find the RPM packages in the subdirectory PCQLinux/RPMS on the CDs. The table below specifies the service names, corresponding packages and the CDs carrying the

packages.

Advertisment
Service Package CD

No. 
DHCP dhcp 3
DNS bind 1
Samba samba-common,

samba
1
 Apache httpd 1

DHCP



To allocate dynamic IPs to other machines in the network, click on Servers>DHCP Server>Add a new subnet. Assuming that you are setting up a DHCP for a C class private network on 192.168.1.0, type in the following details in the respective text boxes.







Network address: 192.168.1.0



Netmask: 255.255.255.0


Address ranges: 192.168.1.5 192.168.1.254








Using the address range you specify the IP addresses that you want the DHCP server to assign to machines. Click on ‘Edit Client Options’. For ‘Default Routers’ and ‘DNS Servers’, fill in the IP addresses of the gateway (router) for your network and the IP of the DNS server (local or an Internet DNS server). Click on Save and then on ‘Start Server’ on the window titled DHCP Server. 





Domain Name Server



Suppose you are running an intranet sever on your network having the IP address 192.168.1.5 and you want your network users to access the Web server through a name such as www.pcqlabs.net instead of the IP address.



Here is how to do it from Webmin. Click on Servers>Bind DNS Server. Select the option ‘Setup name server for internal non-internet use only’ and click on the ‘Create primary configuration file’ button. In the subsequent screen, click on ‘Create a new master zone’. Fill in the following details.







Domain name/network: pcqlabs.net



email address : admin@pcqlabs.net







Click on Create. An icon labeled pcqlabs.net will show up on the Bind DNS Server screen. Click on the pcqlabs.net icon and then click on the icon labeled Address. Fill in the
following.


Advertisment

Name: www



Address: 192.168.1.5





To set up DNS servers to resolve Internet website addresses, click on the ‘Forwarding and Transfers’ icon under the section ‘Global Server Options’ in the main window.

Webmin provides an intuitive Web-based interface to configure various services on PCQLinux 2004 

For ‘Servers to forward queries to’, fill in the IP address of the DNS server of your ISP or another public DNS server, say 202.54.96.1 (this is the IP address of VSNL’s DNS server). 

Advertisment

Samba (Windows file server)



Click on Server>Samba Windows File Sharing>Windows Networking. For Workgroup enter PCQLabs and for Server name (Netbios name) enter PCQServer. Click on Save. Next, click on ‘Create a new file share’. For Share name, enter any string. For ‘Directory to share’, click on ‘...’ button and browse to select the Linux directory you want to share. By default the share is a read only. To allow write permissions, click on Security and Access Control and select Yes for the Writable option.

Click on Save. 

You must define the users who are allowed access to the share you’ve just created. A Samba user is different from a Linux user (who has a user account on the Linux machine). However, Webmin has a one-click option to create a Samba user corresponding to each Linux user. We will use the same to define our Samba users.

First, add some Linux user accounts (which will be used for authentication while accessing a share) using useradd and passwd command or through Webmin (System>Users and Groups).

Advertisment

Next, click on Authentication. Select Yes for ‘Use encrypted passwords’. Click on Save. Click on ‘Convert Unix users to Samba users’. Type in a password for the newly created users and then click on the ‘Convert Users’ button. On the main screen, click on ‘Restart Samba Servers’. 

Apache (Web server)



By default, Apache Web server on PCQLinux serves HTML pages from the directory /var/www/html (called the document root) when someone accesses the URL http:///. This is the default and the only existing site on Apache. 

To host multiple sites on Apache Web server, click on Servers>Apache WebServer. Scroll down to the section ‘Create a New Virtual Server’. For IP address, specify an IP address say 192.168.1.10 other than the default IP address of the PCQLinux machine. For Document Root, click on the ‘...’ button, browse and select the Web directory containing the pages for the new site. Make sure that the Web directory has proper read and write permissions. Click on Create. 

Advertisment

Next, on Wemin click on Networking>Network Configuration>Network Interfaces>Add a new interface. For name enter eth0:0. For IP address enter 192.168.1.10. Click on Create. 

Go to a Linux console or terminal window and restart the Apache Web server as:






service httpd restart





Henceforth, you should be able to access the new website at http://192.168.1.10


What we have just accomplished is called IP-based virtual hosting wherein we specify a separate IP address for a new website. Name-based virtual hosting is also possible with Apache. For an in-depth, refer to the PCQuest article, Virtual Hosting on Apache (page 66, April 2002,

PCQuest). 

Shekhar Govindarajan

Advertisment