Services
Poseidon - Sun Ultra 2 - Services
This server needs to provide the following network services: DNS, DHCP, Email, file server (NFS et Samba), web server (Apache 2.2 and ColdFusion MX 7) and database (MySQL4 or 5).
This is the setup of the various services.
Initial Configuration
Webmin on the SUN Ultra 2 workstation
Some utilities are used on the network to manage and administer some servers. It can make administration tasks easier.
- SSH is installed on all servers to replace telnet and ftp with similar but more secure utilities. SSH is installed by default with Solaris 10.
- Webmin is one tool that can be used to administer servers. It doesn't replace the command line on Unix or Linux servers, but it can help a lot.
Webmin is available at webmin.com, with a package ready for Solaris. Webmin needs Perl 5, also installed by default with Solaris 10. Once installed, you can access it with a web browser at http://serveurIP:10000.
# gunzip webmin-1.450.pkg.gz
# pkgadd -d webmin-1.450.pkg
Webmin helps managing DNS, NFS, Samba, Apache and mySQL amongst other services.
mv /usr/ucb/cc /usr/ucb/suncc
ln -s /usr/sfw/bin/gcc /usr/ucb/cc
DNS Installation
This server manage the DNS service in the lab network. It is the master of the lab zone.
- With Webmin, go to 'Servers' -> 'BIND DNS Server'.
- Go to 'Forwarding and Transfers' to setup the DNS server used to forward requests if the local zone can not resolve the name. It is typically your ISP's DNS.
- Create a master zone for the test network (hug-lab.local in the lab network)
- Click on the icon of the newly created zone and add you records.
- Click on 'Apply Configuration' to apply the changes.
DHCP Installation
This server also serves DHCP requests from the lab network.
Install the DHCP service
- At the console, tyoe in the following command to create the ressource table and configuration file. The DHCP service will start automatically at every boot.
# dhcpconfig -D -r SUNWbinfiles -p /var/dhcp
Created DHCP configuration file.
Created dhcptab.
Added "Locale" macro to dhcptab.
Added server macro to dhcptab - Poseidon
DHCP server started.
#
Add the networks to serve
The networks the DHCP service needs to supply IP addresses to need to be configured. There's only one on the test lab, with IP addresses 10.0.0.0 and 24bits network mask.
- Type 'pntadm -C xx.xx.xx.xx' where xx.xx.xx.xx is the network addresses (10.0.0.0). Type 'pntadm -L' to check the zone was created.
- Update the /etc/netmasks file with the network mask for the zone created.
- Enable the network interface used to supply the IP addresses in the /etc/inet/dhcpsvc.conf file by adding an INTERFACES line with the name of the network interface (hme0).
# pntadm -C 10.0.0.0
# pntadm -L
10.0.0.0
# cat /etc/netmasks
...
10.0.0.0 255.255.255.0
...
# cat /etc/inet/dhcpsvc.conf
DAEMON_ENABLE=TRUE
RESOURCE=SUNWbinfiles
RUN_MODE=server
PATH=/var/dhcp
CONVER=1
INTERFACES=hme0
#
Manage zones
To manage zones/networks, you can use the command line with dhcpconfig. The grapical interface is handier.
You need to configure a linux/unix workstation to accept connections from the Ultra 2 on the X server. I used the SGI Octane Unix workstation. Type on a command line 'xhost + IPadr', where IPadr is the IP address or the name of the client (the Ultra 2 here).
ZEUS 1% xhost + Poseidon
From the linux/unix graphic workstation, connect on the server with telnet or ssh, and add the DISPLAY variable to point on the X server.
Start the dhcpmgr programm to manage the DHCP service. It will start in graphical mode on the linux/unix workstation.
# DISPLAY=Zeus:0.0
# export DISPLAY
# /usr/sadm/admin/bin/dhcpmgr
The zone created at step 2 should be listed. Add the addresses to provide, the go to macro to add the options, such as gateway, DNS, ...
dhcpmgr with options
File Server Installation
NFS allows sharing files with linux or unix clients, Samba is used to share files with Windows clients.
The 2 services are installed by default with Solaris 10. They just need to be configured. Once again, webmin can help:
NFS
- With Webmin, go to 'Networking' -> 'NFS Shares'.
- Configure the folders you want to share. ('/data/shared' is shared on the lab network)
- Click on 'Apply Changes' to validate the changes.
Samba
- With Webmin, go to 'Servers' -> 'Samba Windows File Sharing'.
- Configure the Samba users (would match Windows users)
- Add the folders you want to share (/data/shared)
- Click on 'Restart Samba Servers' enable the changes.
The 2 services are very efficient. They allow copying or sharing files easily between different platforms. The speed is limited by the network speed (about 11MB/s in the lab network).
Web Server Installation
Apache 2.2 is used for the web service on this server.
ColdFusion 7 and PHP 5 will also be installed.
Apache 2.2
Solaris 10 installed with Apache 1.3 and 2.0, but the services will stay disabled.
The easy solution is to download a package to install Apache 2.2 for Solaris 10, on Sparc paltform. It is possible to compile Apache, but it's longuer and didn't add any benefit to the setup in the lab network.
- Go to www.sunfreeware.com and select the right Apache package for your version of Solaris and hardware paltform.
- Save apache-2.2.x---.tar.gz in a folder on the server.
- Decompress the file with 'gunzip apache-2.2.x---.local.gz'.
- Install the package with 'pkgadd -d apache-2.2.x---.local'.
Repeat steps 1 to 4 for each package.
- Once installed, configure the 'Apache Webserver' module in webmin.
Apache 2.2 is installed in /usr/local/apache2 - Edit the '/usr/local/apache2/conf/httpd.conf' file and chenage the lignes 'DocumentRoot' with the root folder of the websites ('/data/www' on the Ultra 2) and 'ServerName' with the Ultra2 name.
Coldfusion MX 7
Coldfusion is an application that allows to quickly create and deploy web applications. It is a multi-platform application written in Java, running on J2EE JRun4 server.
The CFML language is quick to learn and is 'tag' based, like HTML.
Coldfusion (initially Allaire, then Macromedia and eventually Adobe) is freely available on http://www.adobe.com/products/coldfusion/ in developer version. Version 7 was chosen for this platform.
- Download the Coldfusion file (coldfusion-702-sol.bin for this server) in a folder on the server.
- SSH or telnet the server, go to the folder where the file was saved and change its permission so it becomes executable: 'chmod 777 coldfusion-702-sol.bin'.
- Run the file ('./coldfusion-702-sol.bin') and follow the screen instructions. (Coldfusion is installed in /opt/coldfusionmx7 on the Ultra 2)
- The Apache connector included with the installation is not compatible with Apache 2.2. The integrated web server must be selected for now. The Apache connector will be configured later.
- Finish the installation.
...
You have successfully completed the first step in installing Macromedia
ColdFusion MX 7.
To continue with your installation, go to /opt/coldfusionmx7/bin and type
"./coldfusion start" to start your server.
Once the server is started log in to the Configuration Wizard at
http://[machinename]:8500/CFIDE/administrator/index.cfm
PRESS <ENTER> TO EXIT THE INSTALLER:
#
- Once finished, start Coldfusion with '/opt/coldfusionmx7/bin/coldfusion start'
- With a web browser, go to the administration page of Coldfusion and let the installation complete:
http://Poseidon.hug-lab.local:8500/CFIDE/administrator/index.cfm - Stop Coldfusion with '/opt/coldfusionmx7/bin/coldfusion stop' and Apache with '/usr/local/apache2/bin/apachectl stop'.
- Before configuring the connector between Coldfusion and Apache, a hot fix for Coldfusion 7.02 needs to be installed. It includes a connector for Apache 2.2.
It is available here. You can also get it from this site.
Extract the file wsconfig.jar from the zip file and put it in the '/opt/coldfusionmx7/runtime/lib' folder. (replace the existing one). - Change the install script for the Apache connector to configure it for this server, it is located here: '/opt/coldfusionmx7/bin/connectors/apache_connector.sh'.
(Apache is installed in /usr/local/apache2)
#!/bin/sh
#
# Configure the Apache connector.
# -dir should be the *directory* which contains httpd.conf
# -bin should be the path to the apache *executable*
# -script should be the path to the script which is used to
# start/stop apache
#
../../runtime/bin/wsconfig \
-server coldfusion \
-ws apache \
-dir /usr/local/apache2/conf \
-bin /usr/local/apache2/bin/httpd \
-script /usr/local/apache2/bin/apachectl \
-coldfusion
exit $#
...
# ./apache_connector.sh
- Copy the 'CFIDE' and 'cfdocs' folders from '/opt/coldfusionmx7/wwwroot' into the root folder of Apache 2.2 (Same folder than in step 6 of the Apache installation. '/data/www' for this server).
- Restart Coldfusion and Apache with '/opt/coldfusionmx7/bin/coldfusion start' then '/usr/local/apache2/bin/apachectl start'.
# cp -R /opt/coldfusionmx7/wwwroot/CFIDE /data/www/
# cp -R /opt/coldfusionmx7/wwwroot/cfdocs /data/www/
# /opt/coldfusionmx7/bin/coldfusion start
...
# /usr/local/apache2/bin/apachectl start
- Check that everything works properly by navigating the administration page of Coldfusion on the Apache server:
http://Poseidon.hug-lab.local/CFIDE/administrator/index.cfm
To connect Coldfusion to MySQL5, add the Java JDBC connector for MySQL:
- Download the J connector from MySQL.com in a folder on the server.
- Extract the files with 'gunzip -c mysql-connector-java-5.x.x.tar.gz | tar -xf '.
- Install the connector in Coldfusion MX 7 by copying the .jar file: 'cp ./mysql-connector-java-5.x.x/mysql-connector-java-5.x.x-bin.jar /opt/coldfusionmx7/runtime/servers/lib/'.
- Restart Coldfusion with '/opt/coldfusionmx7/bin/coldfusion restart'.
- Add a DSN in Coldfusion Administrator by choosing Other.
- Fill in the JDBC URL line: 'jdbc:mysql://[host]:[port]/[database]'.
- The Driver Class: 'com.mysql.jdbc.Driver'.
- The Driver Name: 'MySQL 5.x'.
- Add the credentials for the user to connect to the database.
- Apply by clicking on Submit.
MySQL 5 DSN Source in Coldfusion Administrator
mySQL Database server
MySQL is the most popular open source database engine: efficient, reliable and easy to implement.
mySQL 4 is installed with Solaris 10, and just needs to be configured. Here are the steps for this.
mySQL 4
- Create a mysql group with 'groupadd mysql'
- Create a mysql user, member of the mysql group with 'useradd –g mysql –d /export/home/mysql –m –c "MySQL account" mysql'
Add a password for the mysql user with 'passwd mysql'
# groupadd mysql
# useradd –g mysql –d /export/home/mysql –m –c "MySQL account" mysql
64 blocks
# passwd mysql
New Password:
Re-enter new Password:
passwd: password successfully changed for mysql
#
- Create a folder for the databases (on the second hard drive on this server) with 'mkdir /data/mysqldata'
- Go to the'/usr/sfw/bin' folder and create the default databases with the script './mysql_install_db'
- Copy the databases created in the folder where the databases will be hosted: 'cp -R /var/mysql/mysql /data/mysqldata'
- Update the rights on the mysql folders: 'chown -R mysql /data/mysqldata' and 'chgrp -R mysql /data/mysqldata'
- Update the /etc/my.cnf file by adding or changing the following lines:
[mysqld]
datadir=/data/mysqldata
socket=/tmp/mysql.sock
port=3306
user=mysql - Start mysql with '/usr/sfw/sbin/mysqld_safe --user=mysql &' change the root password with '/usr/sfw/bin/mysqladmin -u root password xxxx' and '/usr/sfw/bin/mysqladmin -u root -h hostname password xxxxx'
When the steps above are executed as root, it is possible to get an error the first time mysql starts. It is a file permission issue. Repeat setp 6 and start the service again as in step 8.
# mkdir /data/mysqldata
# /usr/sfw/bin/mysql_install_db
# cp -R /var/mysql/mysql /data/mysqldata
# chown -R mysql /data/mysqldata
# chgrp -R mysql /data/mysqldata
...
# /usr/sfw/sbin/mysqld_safe --user=mysql &
# /usr/sfw/bin/mysqladmin -u root password xxxx
# /usr/sfw/bin/mysqladmin -u root -h Poseidon password xxxxx
#
- Configure MySQL so it starts automatically at boot time.
The mysql.server script needs to be updated with the databases files location (modify the line 'datadir=/var/mysql' to 'datadir=/data/mysqldata').
# cp /etc/sfw/mysql/mysql.server /etc/init.d/mysql
# ln -s /etc/init.d/mysql /etc/rc0.d/K21mysql
# ln -s /etc/init.d/mysql /etc/rc3.d/K21mysql
#
- Webmin can manage mysql with the 'mySQL database server' module. It just needs to be configured.
mySQL 5.1
- Download the package for Solaris 10 (Sparc, 64-bit) from the MySQL website http://www.mysql.com in a folder on the server.
Create a group and user for the mySql services, as described in steps 1 and 2 for MySQL 4.
- Decompress the file with 'gunzip -c mysql-5.1.xx-solaris10-sparc-64bit.pkg.gz'.
- Install the package with 'pkgadd -d mysql-5.1.xx-solaris10-sparc-64bit.pkg'.
- Copy the configuration file with 'cp /opt/mysql/mysql/support-files/my-medium.cnf /etc/my.cnf'.
# gunzip -c mysql-5.1.31-solaris10-sparc-64bit.pkg.gz
# pkgadd -d mysql-5.1.31-solaris10-sparc-64bit.pkg
# pkgadd -d mysql-5.1.31-solaris10-sparc-64bit.pkg
The following packages are available:
1 mysql MySQL Community Server (GPL)
(sun4u) 5.1.31
Select package(s) you wish to process (or 'all' to process all packages). (default: all) [?,??,q]:
Processing package instance <mysql> from </data/shared/Downloads/mysql-5.1.31-solaris10-sparc-64bit.pkg>
MySQL Community Server (GPL)(sun4u) 5.1.31
Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Using </opt/mysql> as the package base directory.
## Processing package information.
## Processing system information.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.
This package contains scripts which will be executed with super-user
permission during the process of installing this package.
Do you want to continue with the installation of <mysql> [y,n,?] y
Installing MySQL Community Server (GPL) as <mysql>
## Installing part 1 of 1.
/opt/mysql/mysql/COPYING
...
Installation of <mysql> was successful.
# cp /opt/mysql/mysql/support-files/my-medium.cnf /etc/my.cnf
- Create a folder for the databases (on the second disk if available) with the following command: 'mkdir /data/mysqldata'.
- Apply the proper permissions on the mysql folders with: 'chown -R mysql /data/mysqldata' and 'chgrp -R mysql /data/mysqldata'
- Update the /etc/my.cnf file by adding or modifying the following lines:
[mysqld]
datadir=/data/mysqldata
socket=/tmp/mysql.sock
port=3306
user=mysql - Go to the '/opt/mysql/mysql/scripts' folder and create the default database file with the script: './mysql_install_db'.
- Start mysql with '/opt/mysql/mysqlbin/mysqld_safe --user=mysql &', change the root password with '/opt/mysql/mysql/bin/mysqladmin -u root password xxxx' and '/opt/mysql/mysql/bin/mysqladmin -u root -h hostname password xxxxx'
# mkdir /data/mysqldata
# chown -R mysql /data/mysqldata
# chgrp -R mysql /data/mysqldata
...
# /opt/mysql/mysql/scripts/mysql_install_db
...
# /opt/mysql/mysql/bin/mysqld_safe --user=mysql &
# /opt/mysql/mysql/bin/mysqladmin -u root password xxxx
# /opt/mysql/mysql/bin/mysqladmin -u root -h Poseidon password xxxxx
#
- Configure MySQL so it starts automatically at boot time.
The '/opt/mysql/mysql/support-files/mysql.server' script needs to be updated with the databases files location (modify the line 'datadir=/var/mysql' to 'datadir=/data/mysqldata').
# cp /opt/mysql/mysql/support-files/mysql.server /etc/init.d/mysql
# ln -s /etc/init.d/mysql /etc/rc0.d/K21mysql
# ln -s /etc/init.d/mysql /etc/rc3.d/K21mysql
#
- Webmin can manage mysql with the 'mySQL database server' module. It just needs to be configured.



