The macosxhints Forums

The macosxhints Forums (http://hintsforums.macworld.com/index.php)
-   UNIX - General (http://hintsforums.macworld.com/forumdisplay.php?f=16)
-   -   Running SWAT in 10.2 (http://hintsforums.macworld.com/showthread.php?t=5095)

necrosis 08-29-2002 09:05 PM

Running SWAT in 10.2
 
Does anyone know how to get SWAT (the web front end for configuring SMB) running in 10.2? Going by what the man page says dosent seem to work.

silicondiode 08-29-2002 09:17 PM

there's a hint in the works.
 
go here:
http://www.macosxhints.com/article.p...70699#comments

but maybe someone could cover it here, for all of the impatient souls that have tried, unsuccessfully, to get SWAT running... (that would be me...)

:confused:

necrosis 08-30-2002 10:54 PM

errors
 
I did it like the instructions said but when I connect to http://localhost:901/ i get:

400 Server Error
chdir failed - the server is not configured correctly

anyone know why?

blugel 09-03-2002 07:42 PM

I didn't edit the xinetd.conf file but instead edited the services and inetd.conf files, as one would have done to enable SWAT in 10.1. I do not know if this is logistacally correct but it works fine. In the inetd.conf file, I added

swat stream tcp nowait.400 root /usr/sbin/swat swat

And in the services file, I added

swat 901/tcp


Hope this helps. If someone can tell me if and why this is wrong, what with xinetd being in 10.2 (dont know much about it), just let me know.

silicondiode 09-03-2002 07:54 PM

typos would make it now work, eh?
 
i did the same thing, but since i tried it at like, 3am, i typoed the whole thing and didn't look at it since... rebooting now.....

today's dumbass award goes to me...

BraindeadMac 09-03-2002 08:33 PM

I supplied a hint this morning doing just this. You just need to start swat from inetd or xinetd (xinetd being the newly preferred method according to Apple....).

I didn't save the text...so look for the hint soon.

bluehz 09-04-2002 12:04 AM

I would recommend Webmin. Great for administering all things OS X. Includes SMB configuration with SWAT.

blugel 09-04-2002 12:29 AM

OK, after some checking around, I realize i shouldnt have posted my last post. xinetd is a lot better than inetd and does not require you to even add anything to the service file. I found how to get swat working with xinetd and got it working for me. I found it on this page:
http://us6.samba.org/samba/docs/man/swat.8.html

just be sure to create the file using sudo or su

Hope this helps...moreso than my last post, heh

necrosis 09-05-2002 03:27 AM

still nothing...
 
Well, i rechecked all my code for the inetd.conf method and I still get:

400 Server Error
chdir failed - the server is not configured correctly

when i try and access SWAT...

I also tried the xinetd method and that did nothing.

tripple checked all premissions and settings, also this is on a brand new clean install of 10.2.

this is really driving me nuts, anyone got sugestions of a way to add windows shares without editing the smb.conf file manually?

silicondiode 09-05-2002 08:33 AM

double check the services file in /etc
 
if you haven't already make sure that:

Code:

swat 901/tcp
is in /etc/services. inetd.conf needs that too...

it works here, and from what i've read the hint is in the pipe, maybe we'll have proper documentation for the weekend...

bmorstad 09-05-2002 10:02 AM

Try this ...
 
I have found that inserting the line "groups = yes" into the swat file located in /etc/xinetd.d/swat seems to do the trick. I don't know why it works but some knowledgeable person out there may want to answer that. Also make sure that you change the server line to read "server = /usr/sbin/swat".

necrosis 09-05-2002 02:41 PM

Done both of those and still nothing:

"swat 901/tcp" in services file
"groups = yes" in swat file in xinetd.d folder
correct path in swat file in xinetd.d folder

nothing seams to work im still getting the:

400 Server Error
chdir failed - the server is not configured correctly

error.

when i do "ps ax | grep swat" its dosent show up
but when i do a nmap scan of my computer it says port 901 is open

k_getchell 12-31-2003 09:42 AM

I had this problem under 10.2. The way I solved it was to install the Mac OS X Developer tools for 10.2. Apparently not all the required files are installed for SWAT. Installing the Developer Tools seems to put the required files in the required places.

Not sure if this is accurate, but I think you'll find that it'll make SWAT work. Go to http://developer.apple.com (I think) to find the Developer Tools.

denn88 01-22-2004 03:46 AM

Not working on 10.2.8
 
I'm trying to get SWAT running on Mac OS X 10.2.8 but no luck so far.

Tried the hints posted above. When I do a 'ps -ax | grep swat' it shows up. I configured the '/etc/inetd.conf' file and added this line:

swat stream tcp nowait.400 root /usr/local/samba/bin/swat swat

I created the file '/etc/xinetd.d/swat' and inserted:

service swat
{
port = 901
socket_type = stream
wait = no
only_from = localhost
groups = yes
user = root
server = /usr/sbin/swat
log_on_failure += USERID
disable = No
}


And added this to '/etc/services':

swat 901/tcp

Did al 'sudo kill -HUP' on inetd, but still I get a 404 error in my browser.

jdera 01-22-2004 08:36 AM

Re: Not working on 10.2.8
 
Quote:

Originally posted by denn88
Did al 'sudo kill -HUP' on inetd, but still I get a 404 error in my browser.
For some reason, I would think that if the connection failed to swat, you wouldn't get a 404. How are you attempting to access swat from your browser?

denn88 01-22-2004 09:18 AM

Connecting to SWAT:

http://localhost:901/

Safari gave na error:

"Could not open the page"
Could not open the page “http://localhost:901/” because Safari could not load any data for this location.

The normal 404 error.

jdera 01-22-2004 09:22 AM

Quote:

Originally posted by denn88
Connecting to SWAT:

http://localhost:901/

Safari gave na error:

"Could not open the page"
Could not open the page “http://localhost:901/” because Safari could not load any data for this location.

The normal 404 error.
That's not a 404 error. A 404 error is when a document cannot be found on a server. This is an error with having issues connecting to the server itself. It would actually occur before a 404 could.

If you open Terminal and issue the command telnet localhost 901, do you get a connection refused or does it sit there waiting?

denn88 01-22-2004 09:56 AM

Nope Connection refused:
Code:

[Mm4:~] mm4% telnet localhost 901
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
[Mm4:~] mm4% ps -ax | grep swat
  713 std  R+    0:00.00 grep swat
[Mm4:~] mm4%

As you can see, it is running... I presume? I followed some hints to get SWAT to run but al of them let to this, no connection to SWAT in my browser.

jdera 01-22-2004 09:59 AM

Try http://127.0.0.1:901/

denn88 01-22-2004 10:38 AM

Nope, same error...

jdera 01-22-2004 10:46 AM

Okay... first off, reading back through, it looks like you have swat enabled in both inetd and xinetd. My first suggestion is to completely disable inetd by commenting out its entry in /System/Library/StartupItems/IPServices/IPServices, then restarting your machine. This will ensure that only xinetd is vying for the port in question.

Now, two things. 1) Make sure you have the DevTools installed. For some reason, I've seen all kinds of issues with swat if they are not installed. Might have something to do with a supporting library.

2) To make swat work on Panther, I had to add an entry to /etc/services that basically contains:

Code:

swat  901/tcp
Not sure if you'll have to do the same, but what I recommend is getting inetd out of the picture, then using the Console app to view /var/log/system.log as you try to connect. You should see something like:

Jan 22 10:42:54 localhost xinetd[316]: START: swat pid=4741 from=127.0.0.1

One last thing... do you have the root account enabled? If not, enable it. swat tries to authenticate as root. If the root account is disabled, that might cause issues.

stetner 01-22-2004 04:50 PM

Quote:

Originally posted by denn88
Nope Connection refused:
Code:

[Mm4:~] mm4% telnet localhost 901
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
[Mm4:~] mm4% ps -ax | grep swat
  713 std  R+    0:00.00 grep swat
[Mm4:~] mm4%

As you can see, it is running... I presume? I followed some hints to get SWAT to run but al of them let to this, no connection to SWAT in my browser.
Actually, no it is not (not that I know what swat is :) ) but you are seeing your grep command in the ps output, not your swat running. And if telnet is not connecting to that port, Safari won't either. I usually use
Code:

$ ps -auxww | grep [x]inetd
root      445  0.0  0.0    27484    264  ??  Ss  Sat11AM  0:02.31 xinetd -inetd_compat -pidfile /var/run/xinetd.pid
$ ps -auxww | grep [x]foobar
$

to be safe. using the 'ww' extends the output so you see as much info as possible no matter what size the terminal is, and the '[x]' pattern will make it miss the grep command itself.


You can see what ports are being listened on with:
Code:

$ netstat -na | grep LISTEN
tcp46      0      0  *.22                  *.*                    LISTEN
tcp4      0      0  *.995                  *.*                    LISTEN
tcp4      0      0  *.110                  *.*                    LISTEN
tcp4      0      0  *.993                  *.*                    LISTEN
tcp4      0      0  *.143                  *.*                    LISTEN
...
...


gatorparrots 01-23-2004 02:05 AM

Quote:

Originally posted by stetner
You can see what ports are being listened on with:
Code:

$ netstat -na | grep LISTEN
tcp46      0      0  *.22                  *.*                    LISTEN
tcp4      0      0  *.995                  *.*                    LISTEN
tcp4      0      0  *.110                  *.*                    LISTEN
tcp4      0      0  *.993                  *.*                    LISTEN
tcp4      0      0  *.143                  *.*                    LISTEN


If you have root access, lsof is also a good utility in cases like this:
sudo lsof -i :901

denn88 01-23-2004 03:09 AM

SWAT is running and I'm accessing it in Safari. Like 'jdera' wrote:

Comment the 'inetd' line in this file and reboot:
'/System/Library/StartupItems/IPServices/IPServices'

Though I already tried some of the other suggestions before this one, putting 'swat 901/tcp' in the '/etc/services' file etc. This was the final piece of the SWAT puzzle...

Even learned some new Unix things along the way, thanx for the help guys!!


All times are GMT -5. The time now is 06:13 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.