[H-GEN] samba-swat

Tony Nugent tony at linuxworks.com.au
Tue Mar 12 09:33:50 EST 2002


[ Humbug *General* list - semi-serious discussions about Humbug and  ]
[ Unix-related topics.  Please observe the list's charter.           ]
[ Worthwhile understanding: http://www.humbug.org.au/netiquette.html ]

On Tue Mar 12 2002 at 11:35, Paul Cornford wrote:

> I cannot seem to get samba-swat working in order to edit smb.conf. There
> is no urgency here as I have been editing it manually for years. I have
> tried inserting "server_args = -s /etc/samba/smb.conf" into
> /etc/xinetd.d/swat, but it hasn't fixed the problem. I am using Samba
> 2.2.1a-4 on a RH 7.2 machine. I tried upgrading to the latest Samba
> version but it made no difference. When I try accessing
> "http://localhost:901" as root as per the man page using Netscape 6.2
> all I get is "info.netscape.com could not be found"...etc.
> "http://127.0.0.1:901" gives me "Connection refused". Anyone got any ideas?
> 
> Regards,
> 
> Paul Cornford.

Connection refused almost always means that nothing is listening on
the host:port you are trying to connect to.

swat is a configuration tool that works by using a http protocol
interface (and a "cgi-like" server backend) on a local port
different to the usual http port 80.

It works very nicely for what it does, certainly useful.  (But imho
it does not replace a good understanding of "man smb.conf", and like
all gui tools, it has limitations).

Some tricks that might help to get it working...

Make sure that swat is actually installed, I've seen that happen
before :-)

Make sure that you have this entry in /etc/services...

swat	901/tcp		# Samba Web Administration Tool

And this at the top of /etc/hosts to force resolution of "localhost"
to the correct ("desired") address:

127.0.0.1	localhost.localdomain	localhost lcoalhostname.fqdn localhostname

  (Specifying your local machine name like is a hack that forces it
  to resolve to 127.0.0.1.  this is useful for situations where the
  IP addresses on other network interfaces are not permanent, and/or
  may resolve to other names, or DNS
  may not always result your hostname.  It certainly helps with
  keeping X apps happy and working sanely with xauth etc).

  (Ever seen sendmail or lpd etc hang for long periods on startup?
  It they are trying to resolve the IP address of your local machine
  name, then this trick will fix that).

Once you have configured xinted with a swat file, restart or reload
it so that xinetd will listed on port 901 (and run swat if there
are any incoming connections to that port).

On redhat box you can turn it on (or off) at bootup by default with
"chkconfig swat on" (similar for other xinetd services).

To check what network ports on your local system have servers
listening to them, try this: netstat -plut (or -plutn).

xinetd is usually compiled with libwrap, so if you are denying
everything by default in /etc/hosts.deny (you should), then add this
to /etc/hosts.allow (along with other entries that you want to
allow)...

swat: localhost
[ .. entries for allowd access to other daemons, see man hosts.allow .. ]

  Connections that are terminated by libwrap usually give a
  null-output "connection terminated" error, not "connection
  refused".  So wrappers isn't your immediate problem, but something
  to watch out for.

Once this is right, then you should now be able to connect to the
swat config tool:

	netscape http://localhost:901/

and up will pop the samba configuration wizard interface.  (Very
often the trailing `/' helps, I'm not sure why, perhaps it forces
the browser to see it as a definite deliminator for the host:port
part of the url).

Personally, I much prefer a text editor for hacking smb.conf...  :)

Cheers
Tony

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.



More information about the General mailing list