Linuxathome.net - Linux news and help for home broadband internet users
 Home | Files | Case Mods | Reviews | Forum | Search | Links | RDF Feed | Contact
Sections

Installation Guide
Setting Up
Internet Sharing
Port Forwarding
Services Config
Installing Programs
Game Servers
Using IPTables
Useful Commands
Kernel Upgrading
System Recovery
Red Hat 7.2 Setup
OpenBSD Setup
BPA Login Setup
PPPoE Setup
Add New Hardware
Using PPTP VPN
VMware ESX Cmds
Our RC5 Team
Folding@Home
Help Support Us

 
Articles
Linux Security
NetStats FAQ
Linux KIS Trojan
CAT5/LAN Cables
Domain Names
Presario RH Install APC Debian DVD
 
Slashdot.org
  • Privacy Complaint Targets Google Over Unsolicited Ad Emails
  • Psychedelics Help People With Alcoholism Drink Less
  • Japan Signals Return To Nuclear Power To Stabilize Energy Supply
  • Korea Shatters Its Own Record for World's Lowest Fertility Rate
  • New Aluminum-Sulfur Battery Tech Offers Full Charging In Under a Minute
  • New York State Bill Would Require Speed Limiting Tech In New Cars
  • Notorious DRM Company Takes Aim At Switch Piracy
  • Hackers Are Breaking Into and Emptying Cash App Accounts
  • New Film 'BlackBerry' To Explore Rise and Fall of Canadian Smartphone
  • Chattanooga, Tennessee offers America's First Community-Wide 25 Gig Internet Service
  • California To Ban the Sale of New Gasoline Cars
  • Experts Warn of Widespread Exploitation Involving Hikvision Cameras
  • Google Pixel Sees Huge Sales Growth, Has 2% of North American Market
  • Bay Area Startup Wants To Make Call Center Workers Sound 'White and American'
  • Biden is Canceling Up To $10K in Student Loans, $20K For Pell Grant Recipients
  •  
    Affiliates

    TweakTown.com
    ZGeek.com
    pebkac-consulting.com.au

      Services

      As with any server, there are some basic programs / services that you will want to get running. This page covers just a few of the essentials that you would require for a home LAN, for any more you should be able, by now, to get running on your own, if not there are always guides and documentation provided on-line that cover in-depth detail on Linux programs. We might add more programs to this page later on as we see fit.
     

      Instructions

     
    FTP

    The FTP Daemon packaged with Red Hat 6.2 is WU.FTPD (if you would like to install ProFTPd instead then please visit the Programs Section). And this should work straight away without any problems, you won't need to set it up only customize it and add new user accounts etc. To test your ftp you can either use your favourite FTP client or you can simply load up your web browser and enter ftp://<ip_address>/, this will load the ftp and prompt you for a login name and password.

    The anonymous account will log into the directory /home/ftp and the user accounts will log into the appropriate home directories for each user. The groups, users and password information is contained in the /home/ftp/etc/ directory.

    If you want to change the port on which your FTP server is running then you will need to edit the /etc/services file, specifically these two lines:

    ftp-data  20/tcp
    ftp       21/tcp

    The ftp line is the port/protocol of which your FTP server listens for connections, while the ftp-data is the port that your ftp uses for running commands. The ftp-data port should always be one port number below the ftp port number you want to use. e.g. If you want to run your FTP on port 1234 then you should change the above lines to:

    ftp-data  1233/tcp
    ftp       1234/tcp

    To shutdown your FTP (its not a good idea to run it 24/7 as that is against the Optus@Home AUP) then all you need to do is type in the following:

    /usr/sbin/ftpshut now

    This will create a files called /etc/shutmsg and /home/ftp/etc/shutmsg which basically disables both your normal FTP and your anonymous FTP. To restart your FTP services once again all you need to do is delete the above files and the FTPs will be up and running. You can either remove these files manually or use the command that is built into the system:

    usr/sbin/ftprestart

    This will then display the following message (which means your FTPs are now running again):

    ftprestart: /home/ftp/etc/shutmsg removed.
    ftprestart: /etc/shutmsg removed.

     

    HTTP

    The HTTP Daemon packaged by default with Red Hat 6.2 (and most distributions for that matter) is Apache. The apache server should work straight out of the box. i.e. it is automatically setup during the installation process. To test it if works simply open up a web browser and type in your Optus@Home IP Address, e.g. http://<ip_address>/. If your Apache web server works correctly you should see a page similar to this example. If your server doesn't then you will probably need to change some configuration options.

    To modify your Apache setup you must edit the file /etc/httpd/conf/httpd.conf, this file contains the configuration details of the Apache web server. All the options in this file are clearly described in some detail so it should be straight forward to edit.

    To start and stop your Apache web server you will have to run the main Apache executable and pass it the appropriate option. The executable file is /etc/httpd/conf/apachectl, and this is its usage details:

    usage: ./apachectl (start|stop|restart|fullstatus|status|graceful|configtest|help)

    start - start httpd
    stop - stop httpd
    restart - restart httpd if running by sending a SIGHUP or start if not running
    fullstatus - dump a full status screen; requires lynx and mod_status enabled
    status - dump a short status screen; requires lynx and mod_status enabled
    graceful - do a graceful restart by sending a SIGUSR1 or start if not running
    configtest - do a configuration syntax test
    help - this screen

    When you have your own site ready or you want to post some files on you Apache web server all the html files go in the /home/httpd/html/ directory, while all your cgi and perl scripts go in the /home/httpd/cgi-bin/ directory. Remember cgi and perl files must be executable so you will want to chmod them with the appropriate values.

    This is a custom UPTIME cgi script that is useful for all those out there who want to show off there box's, simply create a file called uptime.cgi and chmod o+x uptime.cgi, here is the code for the script (you will need to change the 203.164.?.? to your Optus@Home IP Address):

    #!/bin/csh
    # Uptime CGI Script
    # Coded by Mayhem (C)2000

    echo "Content-type:text/html\n"
    echo "<HTML><HEAD><TITLE>SERVER UPTIME (C) 2000"
    echo "</TITLE></HEAD><BODY><H1><CENTER>"
    echo "Server Uptime for: <FONT COLOR=blue> 203.164.?.? </FONT></H1>"
    echo "<HR><BR><B><CENTER>"
    echo `uptime`
    echo "</B><BR><BR><HR><BR>"
    echo "<A HREF="/index.html"> [ HOME ] </A><BR><BR>"
    echo "Copyright (C) 2000, Mayhem. All Rights Reserved."
    echo "</CENTER></BODY></HTML>"

    If you want to configure your Apache server to allow SSI (Server Side Includes - such as text CGI counters) then go to this page as it details exactly how to do it. This will allow you do so server side commands and therefore increase the capabilities of your web server.

    Apache has a nice feature by which users of your Linuxbox can have their own html directory on your site, in order for them to do this they will need to create a html directory in their home directory (e.g. /home/joe/html/) and this will need to be given the appropriate permissions, chmod 755 html/ (it may be a good idea to see what the naming convention in your version of Apache is, sometimes their html directory might need to be public_html).

    Along with this you might also want to give you users a cgi-bin directory of their own, so that they can run their own scripts, this will require you to add the following line into your httpd.conf file (directly following the line ScriptAlias /cgi-bin/ "/home/httpd/cgi-bin/"):

    ScriptAliasMatch ^/~([^/]*)/cgi-bin/(.*) /home/$1/cgi-bin/$2

    This will now allow you users to have a cgi-bin directory similar to their html directory (e.g. /home/joe/cgi-bin/script.cgi can now be called http://www.yourdomain.com/~joe/cgi-bin/script.cgi as long as the permissions for the directory and script are setup correctly).

     

    SAMBA

    Samba allows Windows machines on your network see your Linux machine on the network and also give you options to share folders and file with them.

    By default when samba starts it will share the user home directories, i.e. /home/<username>/, to the users only (i.e. they will require to supply a password) and a common directory which is /tmp/.

    To start and stop the SAMBA (SMB as it is abbreviated) server you need to run this program /usr/sbin/samba, the options that it has are described by running it without any arguments (options).

    Usage: ./samba {start|stop|restart|status}

    To create a Samba share you will need to edit your /etc/smb.conf file. If you scroll down to the bottom you will see something similar to this:

    #============================ Share Definitions ==============================
    [homes]
    comment = Home Directories
    browseable = no
    writable = no
    available = no
    public = no
    only user = no

    # Un-comment the following and create the netlogon directory for Domain Logons
    ; [netlogon]
    ; comment = Network Logon Service
    ; path = /home/netlogon
    ; guest ok = yes
    ; writable = no
    ; share modes = no

    # Un-comment the following to provide a specific roving profile share
    # the default is to use the user's home directory
    ;[Profiles]
    ; path = /home/profiles
    ; browseable = no
    ; guest ok = yes

    # NOTE: If you have a BSD-style print system there is no need to
    # specifically define each individual printer
    [printers]
    comment = All Printers
    path = /var/spool/samba
    browseable = no

    # Set public = yes to allow user 'guest account' to print
    public = no
    writable = no
    printable = no
    available = no

    Now to create the new share you want to add something similar to the following.

    [SERVER]
    comment = LINUXBOX SERVER FILE SHARE
    path = /tmp
    available = yes
    browseable = yes
    public = yes
    guest only = no
    writable = yes
    only user = no

    This will create a shared folder called SERVER with the comment "LINUXBOX SERVER FILE SHARE" that will be fully accessible by anyone on your network

    Alternatively if your not sure or not game to try it yourself, simply log into the Linux server and run linuxconf and then scroll the menu's until you find the Samba options.

    Another really good way of setting up Samba is the following (my personal config file):

    [homes]
         comment = Home Directory of %U
         writable = yes
         browseable = no

    [printers]
         comment = All Printers
         path = /var/spool/samba
         browseable = no
         # Set public = yes to allow user 'guest account' to print
         public = yes
         writable = no
         printable = no
         available = yes

    [shared]
         comment = Linuxbox Shared Files
         path = /shared/
         browseable = yes
         public = yes
         writable = yes

    [home]
         valid users = admin
         comment = All User Home Directories
         path = /home/
         public = no
         writable = yes
         printable = no

     

    DNS

    For all of you how want to get serious about your server or want to make precautions if your ISP Domain Name Service (DNS) goes down, which would prevent your from loading webpages unless you have the specific IP, then you will probably want to install your own DNS server. If you didn't select to install this with Linux then this little how-to will help you get it up and running in no time.

    The DNS server that we use here is called BIND (named) and can be downloaded from http://www.isc.org/products/BIND/, the version used here is a little old but you should try and used the latest version on your system and it can be installed in a similar manor. This was setup on Red Hat 6.2 using an RPM version, but the usual steps for setting up for the tarball version (.tar.gz) can be applied and then setup followed from here.

    Once you have the file on your system then extract (install) it using RPM, e.g. rpm -ivh bind-8.2.2_P5-9.i386.rpm, once this is done you will will need to setup a configuration file for it, this can be done in two ways, either using Webmin (if installed) to generate the file for you or you can create one manually by pico /etc/named.conf and placing the following text into the file:

    options {
        directory "/etc";
        pid-file "/var/run/named.pid";
        };

    zone "." {
        type hint;
        file "/etc/db.cache";
        };

    Now that you have set up named it is time to fire it up, this can be done by typing /usr/sbin/named -u named. There is only two things to do now, the first is to run netconf and in "Name server specification (DNS)" clear all the field (except the X at the top) and in the field "IP of name server 1" put your WAN IP Address e.g. 203.164.xxx.xxx, save the changes and quit (NOTE:You might want to put your ISP DNS addresses in the 2 and 3 fields to help speed up things, or even put yours last if you want it only as a backup). Now that this is done you may want to test to make sure its working, to test this simply type in nslookup www.linuxathome.net, you should get something like this:

    Server: co3xxxxxxx-a.belrs1.nsw.optushome.com.au
    Address: 203.164.xxx.xxx

    Non-authoritative answer:
    Name: www.linuxathome.net
    Address: 216.34.13.245

    Basically your interested in the first two fields at the top, the first should be your hostname (fullname with domain) and the second your actual IP Address. If this is correct then your done, you will probably notice that your connection has slowed down a bit, don't worry this is perfectly normal as you have just setup your DNS it will have to learn ("cache") all the addresses you visit and build up its database, this should go back to normal after a week or so depending on how much you use your connection.

    Since you have just updated your Server you might want to adjust your client machines and tell them to use your IP Address (WAN) as the DNS server for your network (once again you might want to have your ISP DNS as backups to speed things up).

     

     
    SENDMAIL
    Unfortunately since Optus@Home block port 25 (which is the Sendmail port) we have been unable to test if Sendmail works, maybe in the near future we will have access to a machine where we can play around with Sendmail. Sorry for the inconvenience, please visit the Sendmail site for more information on how to set it up, http://www.sendmail.org/.
     
    DHCPD

    Due to the nature of networks people are always attaching new machines, friends bringing laptops etc and thus it is a bit or a daunting tasks to keep setting up individual machines with the necessary settings to connect to your network and access the Internet, this is where DHCP Daemon comes in rather handy, you can setup your server to assign IP addresses dynamically and statically so when machines on your network are attached and boot up they receive the necessary information.

    In order to set this up make sure you have installed DHCPD otherwise you can simply download the rpm or tarball and install it. Firstly you will need to edit /etc/dhcpd.conf and make it look something similar to the following:

    # Custom DHCPD Configuration File
    # Copyright (C) 2000, Mayhem.
    # www.linuxathome.net
    
    
    server-name "linuxbox";
    
    group {
            default-lease-time 3600;
            max-lease-time 3600;
            option subnet-mask 255.255.255.0;
            option broadcast-address 192.168.0.255;
            option routers 192.168.0.1;
            option domain-name-servers 203.164.20.10, 203.164.20.11;
            option domain-name "nsw.optushome.com.au";
    
            subnet 192.168.0.0 netmask 255.255.255.0 {
                    range 192.168.0.3 192.168.0.10;
                    }
    
            host mayhem {
                    hardware ethernet 00:11:22:33:44:55;
                    fixed-address 192.168.0.2;
                    }
    }
    

    Basically this sets up your machine to send out an IP ADDRESS, the SUBNET MASK, DNS SERVER's and other necessary information for machines to communicate on your network.

    The section defined by host mayhem { ... } defines a rule where by the machine MAYHEM with the MAC ADDRESS 00:11:22:33:44:55 will always be given the IP 192.168.0.2, this is a static allocation of an IP address, you can define as many machines as you want by using similar statments in the configuration file.

    In this example the DHCP server will assign upto 10 IP addresses, 192.168.0.1 is for the server itself, 192.168.0.2 is for the machine MAYHEM and the rest are dynamically assigned when machines are connected. The leases for each IP address are setup to be for 1 hour only and you can adjust this value to suit your network.

    Once you have set up the DHCPD configuration then all you need to do is start the service by the command dhcpd eth1 where eth1 is the your internal network interface.

    Proudly Hosted By:
    Hosted by PEBKAC Consulting

    Please read our Legal Notice for information concerning our site and its content.
    All logos and trademarks in this site are property of their respective owner. All the rest © 2000 - 2016 by Linuxathome.net

    Reviews

    D-Link DI-704P
    VIA EPIA-M 9000
    Tux Applique
    Ricoh MP5125A
    AMD XP 2600+
    3DProphet 9000Pro
    Radeon 9700 Pro
    XTNDAccess IrDA
    Netgear FS-524s
    DSR2161 KVM
    Game TheaterXP & XPS-510 Speakers
    3D Prophet 4000XT
    AutoView 400
    Back-UPS CS 350
    Dual Neon Kit
    SwitchView KVM
    20x4 LCD Kit
    Window Kit

     
    Kuro5hin.org
    XML error: Attribute without value at line 2.
     
    Google Search
    Enter Keywords:

     
    Bash Jokes

    % man: why did you get a divorce?

    man:: Too many arguments.

     
    Virtualization, Virtual Machine & Virtual Server Consolidation - VMware

    The Community ENTerprise Operating System

    Get Slackware Linux

    Use OpenOffice.org

    Use Asterisk