Technical article 126458

What do I need to configure on my server to use such tools as the Windows MySQL Administrator and MySQL Query Browser or a Browser based Webmin to configure MySQL and Samba graphically?

OpenServer 6.0.0OpenServer 5.0.7UnixWare 7.1.4

Written · Last revised

Problem

What do I need to configure on my server to use such tools as the Windows MySQL Administrator and MySQL Query Browser or a Browser based Webmin to configure MySQL and Samba graphically?

Solution

This TA is written with a specific version of Webmin.  The versions
of Webmin tested with this TA are 1.270 (2006) 1.350 (2007) and 1.500
(2010).

MySQL Administrator and MySQL Query Browser are available from MySQL:

http://www.mysql.com/products/tools/
Webmin is available from http://www.webmin.com
To use these tools, it is suggested to install Webmin in order to
configure services such as Samba and MySQL.  This will also enable
you to easily configure your MySQL server to accept connections from
your Windows clients to access your MySQL services on your server.

This TA will take you through the installation of Webmin and show you how to configure it to allow access for your Windows MySQL Administrator and MySQL Query Browser programs.

Installation of Webmin:
----------------------
1. Download the latest tar.gz of Webmin from http://www.webmin.com
   to /usr/local/ on your server, if /usr/local doesn't exist,
   create it with:
# mkdir /usr/local

2. If you download the file using Windows as it quite often renames a tar.gz file to just .tar or .tar.tar

3. Uncompress the file with the following command:

# gunzip < filename | tar xvf -

For example, for the latest version at the time of writing:

# gunzip < webmin-1.270.tar.gz | tar xvf -

4. You should now have a directory in /usr/local/ that represents the Webmin filename, for example webmin-1.270.

5. Change directory to the Webmin directory with the command:

# cd webmin-1.270
6. OpenServer6 only:

Use the chsysinfo command to make OpenServer 6 appear as OpenServer 5.0.7 whilst you install Webmin.

# chsysinfo osr5
7. Install Webmin with the following command
# ./setup.sh

a. You will be asked a number of setup questions,:- b. Config file directory, take the default /etc/webmin c. Log file directory, take the default /var/webmin d. Full path to perl, take the default /usr/bin/perl e. You may be asked to install a version if the installation did not detect the operating system installed.

SCO UnixWare is option 79 and enter "714" for the version.

f. Web server port, take the default 10000 g. Login name, use the default user admin Login password, this is for the user in the previous step h. Use SSL y/n, choose yes i. Start Webmin at boot time, choose yes. j. Point a browser to https://hostname.domain.com:10000/ k. Depending on your name resolution you will have to specify the fully qualified hostname, or alternatively try the IP address.

9. For OpenServer6 only: Set chsysinfo back to OpenServer6

	# chsysinfo osr6
10.	Start / Stop scripts.

The Webmin install creates the script /etc/init.d/webmin but this doesn't start or stop Webmin during boot or shutdown.

To start Webmin you need to put /etc/webmin/start and /etc/webmin/stop into start and stop scripts:

a.	# cd /etc/rc2.d
b.      # ln /etc/init.d/webmin /etc/rc2.d/S99webmin
c.      # ln /etc/init.d/webmin /etc/rc0.d/K00webmin
To Test:
-------
1.	Point a browser to https://hostname.domain:10000

2. Login as the admin user you setup for Webmin during the installation

MySQL configuration in Webmin:
-----------------------------
1.	Point a browser to https://hostname.domain:10000

2. Login as the admin user you setup for Webmin during the installation

3. Click on the Servers option at the top of the page

4.	Click on MySQL

5. Click on Module Config in the upper left grey tab

6.    OpenServer6 Community Version of MySQL:
      --------------------------------------
	If you have downloaded the Community version of MySQL from
        MySQL, then:

The only field you should have to change is:-

Path to MySQL databases directory, change this to where the data is stored, for example, for v5.0.19 of MySQL:

/var/lib/mysql
For earlier versions:
/usr/local/mysql/data

However, many of the fields look for MySQL binaries in:

/usr/local/mysql

You may wish to change this for MySQL v5.0.19 to:

/opt/mysql/mysql
or run:
# ln -s /opt/mysql/mysql /usr/local/mysql
UnixWare 7.1.4 v5.0.19:
----------------------
  If you have downloaded v5.0.19 from SCO, then you will need to
  make the following changes:
Path to mysqlshow command     /usr/bin/mysqlshow
Path to mysqladmin command    /usr/bin/mysqladmin
Path to mysql command         /usr/bin/mysql
Path to mysqldump command     /usr/bin/mysqldump
Path to mysqlimport command   /usr/bin/mysqlimport
Command to start MySQL server /etc/rc2.d/S99mysql start
Command to stop MySQL server  /etc/rc0.d/K00mysql stop
Path to MySQL shared libraries directory  /usr/lib
Path to MySQL databases directory         /var/lib/mysql

7. Click save at the bottom of the page.

The initial password for the "root" user is blank.

8.    If you see:

Warning: The Perl modules DBI and DBD::mysql are not installed on your system, so Webmin will not be able to reliably access your MySQL database. Click here to install them now.

For OpenServer6 Only: Set the "chsysinfo" back to OpenServer5 for the installation and click on "Click Here".

The server will need access to:

Failed to install module : Failed to lookup IP address for www.cpan.org

For Install Action, click on "Make, Test and Install"

This will not work for UnixWare 7.1.4, MP3, currently because:

Executing /usr/bin/perl Makefile.PL  && make ..

Perl 5.006 required--this is only version 5.00404, stopped at Makefile.PL line 10. BEGIN failed--compilation aborted at Makefile.PL line 12.

MySQL:Adding remote access for other machines through Webmin:
------------------------------------------------------------
1.	You've downloaded MySQL Administrator and MySQL Query Brower
        managers for Windows from:
http://www.mysql.com/products/tools/

and you can't access the MySQL database running on the server.

You get MySQL Error Number 1130 Host " " is not allowed to connect to this MySQL server.

You see the same error if you run "telnet <server> 3306"

Use the PING option to ensure your client can ping the server.

2.	Point a browser to https://hostname.domain:10000

3. Login as the admin user you setup for Webmin during the installation

4. Click on the Servers option at the top of the page

5.	Click on MySQL
6.	Under Global Options, click on User Permissions
7.	Click on Create new user
8.	Username - root (although a "root" already exists, you need to
        create a new one for the specific Windows host you'd like to
        connect from).

9. Password - choose Set to but leave it blank unless you've changed it on the MySQL server.

10. Hosts - set this to your Windows clients hostname that the server can resolve.

Depending on your name resolution, this may work with just the hostname of the Windows client or it may require a fully qualified hostname or even just the IP address.

11.	Permissions - choose the permissions you wish to give the
        remote Windows Client user.   You will need to use the CTRL
        key to click more than one permission.
NOTE: This adds the user "root" with the Windows client host to the
      "user" table in the MySQL default database "mysql" on the
      server.  (ie. /var/lib/mysql/mysql/user.MYD).
Samba configuration in Webmin:
-----------------------------
1.	Point a browser to https://hostname.domain:10000

2. Login as the admin user you setup for Webmin during the installation

3. Click on the Servers option at the top of the page

4.	Click on Samba Windows File and Print

5. Click on Module Config in the upper left grey tab

6. These are the options used for this example, this may not suite your requirements, please tailor to suite:

a.	List of UNIX users not to add to the Samba password list, it
        is suggested to remove root if you need to set Samba up as a
        PDC

-499 daemon bin sys adm lp smtp uucp nuucp listen nobody noaccess nobody4

b. Location of the Samba configuration file: /etc/samba/smb.conf

c. Location of the Samba password file: /etc/samba/smbpassword

d.	Full path to smbstatus:
          /usr/bin/smbstatus
e.	Full path to smbpassword, this is the executable not the
        password store:
          /usr/bin/smbpasswd
f.	Full path to smbd:
          /usr/sbin/smbd
g.	Full path to nmbd:
          /usr/sbin/nmbd
h.	Full path to SWAT:
          /usr/sbin/swat
i.	Full path to smbgroupedit:

Note: This isn't a supported command on OpenServer 6

j.	Full path to pdbedit:
          /usr/bin/pdbedit

k. Full path to the net command: /usr/bin/smbnet

l.	Command to start Samba servers:
          Automatic

m. Command to stop Samba server: Just kill processes

7. Click save, this should return you to the Samba Webmin page and allow you to configure Samba using Webmin

adduser script:
--------------
  The Adduser script creates a Unix and Samba user and creates home
  directories.

A password is only added to Samba not for the Unix account, this will allow the user to access Samba but not telnet/rlogin.

1. Copy the adduser script to a place in root's path. Typically put it in /usr/bin or /local/bin for your own Administrator commands.

2.	The syntax for the command is:-

a. # adduser username b. # adduser user1 c. Enter a password for the user when prompted

---- cut here -----
  # This script creates an operating system machine account
  and a Samba machine account.
# usage - adduser machine
echo "Creating machine account $1 ..."
# Add the OS machine account
useradd -s /bin/false $1
# Add the Samba machine account
smbpasswd -a -m $1
----- end cut -----

addmachine script: ----------------- The Addmachine script creates a machine entry in Samba. This is only required when Samba is configured as a PDC. Passwords are not needed for machine accounts, you will, therefore, not be prompted for one like the Adduser script.

1. Copy the addmachine script to a place in root's path. Typically put it in /usr/bin or /local/bin for your own Administrator commands.

2.	The syntax for the command is:-
          a.	# addmachine machine_name$
          b.	# adduser winxp$
----- cut here -----
# This script simply creates an operating system account
  and a Samba account.
# usage - adduser username
echo "Creating user $1 ..."
# Add the OS account and create home directory
mkdir /home/$1
   mkdir /home/$1/Samba
chmod -R 755 /home/$1
	useradd -s /bin/false -d /home/$1 $1
			chown $1:group /home/$1
			     chown $1:group /home/$1/Samba
# Add the Samba account
smbpasswd -a $1
----- end cut -----
initGroups.sh:
-------------
  This file is taken straight from the AFPS to Samba
  migration guide which can be download from:
http://www.sco.com/support/docs/openserver/600/migration/.

The script creates the common Windows groups like Domains Admin and Domain users, and maps them to UNIX groups like root and users.

1. Copy the file to /tmp, change to the tmp directory 2. To run the file simply use the command 3. # sh ./initGroups.sh

---- cut here -----
#!/bin/sh
if [ -f /bin/smbnet ]
then
NET=/bin/smbnet
NOGROUP=nogroup
else
NET=/usr/lib/samba/bin/net
NOGROUP=nobody
fi
$NET groupmap cleanup
# First assign well known domain global groups
groupadd users
$NET groupmap modify ntgroup="Domain Admins"
unixgroup=root
$NET groupmap modify ntgroup="Domain Users"
unixgroup=users
$NET groupmap modify ntgroup="Domain Guests"
unixgroup=$NOGROUP
# Add the group for the machine accounts
groupadd machines
$NET groupmap add ntgroup="Domain Controllers"
unixgroup=machines type=d rid=515
$NET groupmap add ntgroup="Domain Computers"
unixgroup=machines type=d rid=516
# Add other Windows 2000 specific groups
$NET groupmap add ntgroup="Cert Publishers"
unixgroup=$NOGROUP type=d rid=518
$NET groupmap add ntgroup="Schema Admins"
unixgroup=$NOGROUP type=d rid=519
$NET groupmap add ntgroup="Enterprise Admins"
unixgroup=$NOGROUP type=d rid=520
# Assign builtin local groups
$NET groupmap modify ntgroup="Administrators"
unixgroup=root
$NET groupmap modify ntgroup="Users" unixgroup=users
$NET groupmap modify ntgroup="Guests" unixgroup=$NOGROUP
# Now create the operator groups, including the associated
UNIX group
groupadd operator
$NET groupmap modify ntgroup="Account Operators"
unixgroup=operator
$NET groupmap modify ntgroup="System Operators"
unixgroup=operator
$NET groupmap modify ntgroup="Print Operators"
unixgroup=operator
$NET groupmap modify ntgroup="Backup Operators"
unixgroup=operator
$NET groupmap modify ntgroup="Replicators"
unixgroup=operator
# Finally, add any of your own domain global and local
  groups
# groupadd engineer
# $NET groupmap add ntgroup="Engineering Team"
unixgroup=engineer type=d rid=1114
$NET groupmap list
---- end cut -----
NOTES:    Webmin is not supported by SCO and a number of options may not work
          as intended, for example, Using the SSH/Telnet Login will give the
          following error message:
Reason: java.net.ConnectException: Connection refused: connect
NOTES:    For information on MySQL's Support policies and products visit:
http://www.mysql.com/company/legal/supportpolicies/
NOTES:    Troubleshooting:
          ---------------
          If Webmin's "postinstall" script hangs, check the "ps -ef" listing.
          If there's a "crontab -e" process hung, then this can be killed off
          with a kill -15.

From the Xinuos technical article database, record 126458. Reproduced with permission. The original is at www.sco.com/ta/126458, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.