dennis112
09-16-2002, 01:21 PM
After much difficulty I figured out how to install Swat and make it work in RedHat7.3. Most of this info should apply to other linux distros also.
Apparently RH7.3 does not install full support for Samba nor Swat by default. Even if you install Samba, Swat is not automatically installed. You will need to install it seperately. You can first see if Samba is installed by typing:
rpm -q samba.
If it is installed, good. If not, do the next few steps to get it going:
You will need to install the rpm for Samba (found on the 2nd of the 3 install disks): First mount your cdrom, CD to the RH RPM directory and then:
rpm -ivh samba*
In my case, parts of samba were already installed and this prevented a regular install so instead I had to force it by using:
rpm -i --force samba*
You will need to edit the smb.conf file that was installed by Samba in order to get it to work. This article is not specifically on making Samba work, and I suggest checking out other articles on how how to edit the conf file and other particulars with getting Samba running so you can use its shares. Once you install samba, be sure to make sure you turn it on (smb) in services configurator (must be run from root) and reboot if you don't know how to restart the service manually.
Now for the Swat installation. In RH7.3 theSwat RPM is called samba-swat and it was found on the 3rd disk of RH7.3. Other distros may just call it "swat" and you should use that instead of samba-swat in the below exambles. First, see if swat is already installed:
rpm -q samba-swat
If it is not there, install it using:
rpm -ivh samba-swat
Once installed, you still have a couple of items to clean up. First you should check out the swat manual that can be found at:
http://us2.samba.org/samba/docs/man/swat.8.html
It is not entirely accurate for RH7.3, but the steps are nearly the same.
In /etc/services you need to add a line at the bottom of the file, under the heading # local services, like this:
swat 901/tcp # Needed for swat
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX
NOTE: If you are NOT using a newer version of RedHat or a similar distro that uses the /etc/xinetd.conf file, you will need to edit the /etc/inetd.conf file (which is not found in RedHat7.3) and add the line found below to the bottom of the file. (You will either have xinetd.conf or inetd.conf, but shouldn't have both.)
swat stream tcp nowait.400 root /usr/sbin/swat swat
See where I put the swat directory info? It should point to the executable. Do a search for the file to be sure were it is located. Mine was found in the /usr/sbin/ directory.The double swat at the end is not a typo.
Again, the above line is not needed if your linux uses the xinetd.conf file instead. See the swat manual for additional help with inetd.conf.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX
Next you need to find where the actual swat executable file is located. Do a search for the file. Mine was located in the /usr/sbin/ directory.
Now you "may" need to create a new text file ( use your favorite text editor) called "swat" UNLESS THE FILE ALREADY EXISTS. The file should be created (or found) in the /etc/xinetd.d/ directory.
In your /etc/xinetd.d/swat file add the following info exactly as shown, including the funny parenthesis things:
## /etc/xinetd.d/swat
service swat
{
port = 901
socket_type = stream
wait = no
only_from = localhost
user = root
server = /usr/sbin/swat
log_on_failure += USERID
disable = No
}
Save the file.
NOTE: the server= line must point to your actual swat executable file. (server = /usr/sbin/swat is where mine is in RH7.3. Yours could be different, depending on the distro. server = /usr/local/samba/bin/swat seems to work on some so be sure to verify it!)
NOTE: the line "only_from = localhost" is optional and I suggest leaving it out of the file until after you get Swat to work without it. Not knowing this cost me a day of research and may be why many have had problems getting swat to work. Without it, you will be able to enter swat from any computer on the same network (including the linux box).
Now go to services configurator and be sure to check the swat box in order for it to load. You should also make sure that either xinetd or inetd are also checked (again, this is system dependant on which one you have). Reboot (or restart the service, if you know how). Start your favorite browser.
You should now have a working version of swat if you type http://(server):901 with (server) being the ip# assigned to your linux installation. For example I use http://127.0.0.1:901 when on my linux box and http://192.168.0.5:901 on my windows boxes. Although I could also use http://192.168.0.5:901 on my linux box, http://127.0.0.1:901 works much faster.
Once you first see the swat password screen, jump for joy!:D
Dennis
Apparently RH7.3 does not install full support for Samba nor Swat by default. Even if you install Samba, Swat is not automatically installed. You will need to install it seperately. You can first see if Samba is installed by typing:
rpm -q samba.
If it is installed, good. If not, do the next few steps to get it going:
You will need to install the rpm for Samba (found on the 2nd of the 3 install disks): First mount your cdrom, CD to the RH RPM directory and then:
rpm -ivh samba*
In my case, parts of samba were already installed and this prevented a regular install so instead I had to force it by using:
rpm -i --force samba*
You will need to edit the smb.conf file that was installed by Samba in order to get it to work. This article is not specifically on making Samba work, and I suggest checking out other articles on how how to edit the conf file and other particulars with getting Samba running so you can use its shares. Once you install samba, be sure to make sure you turn it on (smb) in services configurator (must be run from root) and reboot if you don't know how to restart the service manually.
Now for the Swat installation. In RH7.3 theSwat RPM is called samba-swat and it was found on the 3rd disk of RH7.3. Other distros may just call it "swat" and you should use that instead of samba-swat in the below exambles. First, see if swat is already installed:
rpm -q samba-swat
If it is not there, install it using:
rpm -ivh samba-swat
Once installed, you still have a couple of items to clean up. First you should check out the swat manual that can be found at:
http://us2.samba.org/samba/docs/man/swat.8.html
It is not entirely accurate for RH7.3, but the steps are nearly the same.
In /etc/services you need to add a line at the bottom of the file, under the heading # local services, like this:
swat 901/tcp # Needed for swat
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX
NOTE: If you are NOT using a newer version of RedHat or a similar distro that uses the /etc/xinetd.conf file, you will need to edit the /etc/inetd.conf file (which is not found in RedHat7.3) and add the line found below to the bottom of the file. (You will either have xinetd.conf or inetd.conf, but shouldn't have both.)
swat stream tcp nowait.400 root /usr/sbin/swat swat
See where I put the swat directory info? It should point to the executable. Do a search for the file to be sure were it is located. Mine was found in the /usr/sbin/ directory.The double swat at the end is not a typo.
Again, the above line is not needed if your linux uses the xinetd.conf file instead. See the swat manual for additional help with inetd.conf.
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXX
Next you need to find where the actual swat executable file is located. Do a search for the file. Mine was located in the /usr/sbin/ directory.
Now you "may" need to create a new text file ( use your favorite text editor) called "swat" UNLESS THE FILE ALREADY EXISTS. The file should be created (or found) in the /etc/xinetd.d/ directory.
In your /etc/xinetd.d/swat file add the following info exactly as shown, including the funny parenthesis things:
## /etc/xinetd.d/swat
service swat
{
port = 901
socket_type = stream
wait = no
only_from = localhost
user = root
server = /usr/sbin/swat
log_on_failure += USERID
disable = No
}
Save the file.
NOTE: the server= line must point to your actual swat executable file. (server = /usr/sbin/swat is where mine is in RH7.3. Yours could be different, depending on the distro. server = /usr/local/samba/bin/swat seems to work on some so be sure to verify it!)
NOTE: the line "only_from = localhost" is optional and I suggest leaving it out of the file until after you get Swat to work without it. Not knowing this cost me a day of research and may be why many have had problems getting swat to work. Without it, you will be able to enter swat from any computer on the same network (including the linux box).
Now go to services configurator and be sure to check the swat box in order for it to load. You should also make sure that either xinetd or inetd are also checked (again, this is system dependant on which one you have). Reboot (or restart the service, if you know how). Start your favorite browser.
You should now have a working version of swat if you type http://(server):901 with (server) being the ip# assigned to your linux installation. For example I use http://127.0.0.1:901 when on my linux box and http://192.168.0.5:901 on my windows boxes. Although I could also use http://192.168.0.5:901 on my linux box, http://127.0.0.1:901 works much faster.
Once you first see the swat password screen, jump for joy!:D
Dennis