Posted by: Anil | April 9, 2007

Getting started guide

THIS PAGE HAS BEEN MOVED TO WIKI.ENTIC.NET!

THIS PAGE HAS BEEN MOVED TO WIKI.ENTIC.NET!

THIS PAGE HAS BEEN MOVED TO WIKI.ENTIC.NET!

THIS PAGE HAS BEEN MOVED TO WIKI.ENTIC.NET!

Table of contents

Solaris Beginner’s Guide

SMF

SMF is a framework for managing the services that run on your Solaris server. To get started you only need to know two commands: svcs and svcadm. Running just “svcs -a” will show all the services that are either enabled or disabled.

root@vds3:/# svcs ftp
STATE          STIME    FMRI
online         11:20:48 svc:/network/ftp:default
root@vds3:/#

That command shows FTP is running. To disable FTP to your server, you would do:

root@vds3:/# svcadm disable ftp
root@vds3:/# svcs ftp
STATE          STIME    FMRI
disabled       11:43:56 svc:/network/ftp:default
root@vds3:/#

Filesystem layout
When you first login to your server, the filesystem looks confusing. Don’t panic. This is because of how your server inherits parts of the filesystem from the global OS. This is a good thing, this allows Your Server to be managed by us, with ease.

root@vds3:/# df -h
Filesystem             size   used  avail capacity  Mounted on
/                      5.0G  1010M   4.0G    20%    /
/dev                   5.0G  1010M   4.0G    20%    /dev
/lib                    13G   5.8G   6.6G    47%    /lib
/opt/SUNWspro           13G   5.8G   6.6G    47%    /opt/SUNWspro
/opt/coolstack         5.0G  1010M   4.0G    20%    /opt/coolstack
/opt/sfw                13G   5.8G   6.6G    47%    /opt/sfw
/platform               13G   5.8G   6.6G    47%    /platform
/sbin                   13G   5.8G   6.6G    47%    /sbin
/usr                    13G   5.8G   6.6G    47%    /usr
/usr/local             5.0G  1010M   4.0G    20%    /usr/local
proc                     0K     0K     0K     0%    /proc
ctfs                     0K     0K     0K     0%    /system/contract
mnttab                   0K     0K     0K     0%    /etc/mnttab
objfs                    0K     0K     0K     0%    /system/object
swap                    10G   304K    10G     1%    /etc/svc/volatile
/usr/lib/libc/libc_hwcap1.so.1
                        13G   5.8G   6.6G    47%    /lib/libc.so.1
fd                       0K     0K     0K     0%    /dev/fd
swap                    10G     4K    10G     1%    /tmp
swap                    10G    12K    10G     1%    /var/run

Some of the filesystems like /lib, /sbin, /usr, are inherited files from the parent OS. These file systems are read-only. If we ever update something like /bin/bash with a new patch, Your Server will automatically get this updated because it is inherited. The benefit is that You don’t have to manage core Solaris software, we’ll do it for you!

At the same time, you of course have full write access to /, /etc, /tmp, /opt, and /usr/local where you can make any customizations to Your Server.

HTTP Server (with PHP support)

Your server has two versions of HTTP servers installed, Apache2 and Lighttpd. Both of them are based on Solaris Cool Stack. We recommend using these instead of building your own. The DocumentRoot for Lighttpd is: /opt/coolstack/lighttpd/htdocs. For CoolStack Apache2, its: /opt/coolstack/apache2/htdocs. This is where you’ll need to put your web pages.

To enable CoolStack lighttpd:

root@vds3:/# svcadm enable CSKlighttpd
root@vds3:/# svcs *lighttpd*
STATE          STIME    FMRI
online          7:28:49 svc:/network/csk-lighttpd:CSKlighttpd
root@vds3:/#

Now you can goto http://vds3.entic.net, and you should see the lighttpd serving pages. You can also visit http://vds3.entic.net/phpinfo.php for PHP information.

You can follow similar steps for Apache2. Remember, the DocumenRoot for Apache2 is in a different place for Lighttpd.

Databases

We currently provide two databases, PostgreSQL and MySQL that are integrated with SMF. The binaries for sqlite3 also exist in /usr/local/bin, if needed.

PostgreSQL is the native Solaris database. It is disabled by default. Your Server actually comes with PostgreSQL 8.1 and 8.2. 8.2 is the preferred database and is shown here. Your “admin” user account is configured to have full access to the PostgreSQL database. You can manage your PostgreSQL server using that account, root access is not needed.

Initialize

Before you can use PostgreSQL, you need to initalize it. The following command is run as root.

root@vds3:/# su - admin -c "pfexec /usr/postgres/8.2/bin/initdb /var/postgres/8.2/data" ...

The database data files are in /var/postgres/8.2 and the configuration file is /var/postgres/8.2/data/postgresql.conf. You are all set now!

Starting PostgreSQL

To enable PostgreSQL, login to your “admin” account and then run:

admin@vds5:~% svcs *post*
STATE          STIME    FMRI
disabled       20:20:51 svc:/application/database/postgresql:version_81
disabled       20:53:23 svc:/application/database/postgresql:version_82
admin@vds5:~% /usr/sbin/svcadm enable svc:/application/database/postgresql:version_82

admin@vds5:~% svcs *post*
STATE          STIME    FMRI
disabled       20:20:51 svc:/application/database/postgresql:version_81
online         20:54:48 svc:/application/database/postgresql:version_82
admin@vds5:~%

Your “admin” account is actually setup with a role of the postgres user which allows for PostgreSQL database management without being root.


MySQL
is built with the Solaris CoolStack. The binaries are in /opt/coolstack/mysql_32bit/bin (You should set your PATH environment variable to search this directory first).

Initialize

root@vds3:/# groupadd mysql
root@vds3:/# useradd -c "MySQL Reserved UID" -d / -g mysql -s /usr/bin/false mysql
root@vds3:/# /opt/coolstack/mysql_32bit/bin/mysql_install_db
root@vds3:/# chown -R mysql:mysql /opt/coolstack/mysql_32bit/data
root@vds3:/# chmod -R 770 /opt/coolstack/mysql_32bit/data

root@vds3:/# /opt/coolstack/mysql_32bit/bin/mysqld_safe &
root@vds3:/# /opt/coolstack/mysql_32bit/bin/mysqladmin -u root password 'mydefaultpassword'
root@vds3:/# /opt/coolstack/mysql_32bit/share/mysql/mysql.server stop

The above commands setup mysql for the first time. You only need to do that once. Please be sure to pick your own password, replace mydefaultpassword with your own password.

The database data files are in /opt/coolstack/mysql_32bit/data.

Starting MySQL

root@vds3:/# svcs *mysql*
STATE          STIME    FMRI
disabled        9:34:39 svc:/network/csk-mysql32:default
root@vds3:/# svcadm enable svc:/network/csk-mysql32:default
root@vds3:/# svcs svc:/network/csk-mysql32:default
STATE          STIME    FMRI
online          9:35:15 svc:/network/csk-mysql32:default
root@vds3:/#

Webmin

For new users to Unix, you might want to use Webmin. Webmin allows web based management of your server. Webmin is installed by default, but is not configured.

root@vds3:/# cd /usr/local/webmin
root@vds3:/# ./setup.sh
***********************************************************************
*            Welcome to the Webmin setup script, version 1.400        *
***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.

Installing Webmin in /usr/local/webmin-1.400 ...

***********************************************************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.

Config file directory [/etc/webmin]: /usr/local/etc/webmin
...

When asked to enter Config file directory, be sure to type in /usr/local/etc/webmin. Be sure to read the last output of that command, it’ll tell you how to connect to webmin on your server.

Remove Customizations

Your server actually comes with minimal customizations done by Entic.net, otherwise it is standard Solaris 10 u4 build. For those power users who don’t want these minimal customizations, here is how to get your server back to the native Solaris OS.

Remove local software:

root@vds19:/# rm -rf /usr/local/*
root@vds19:/#

Remove Coolstack and its integration with SMF. Disable services that might be online:

root@vds19:/# svcs *csk*
STATE          STIME    FMRI
disabled       Nov_14   svc:/application/csk-tomcat:CSKtomcat
disabled       Nov_14   svc:/network/csk-lighttpd:CSKlighttpd
online         Nov_14   svc:/network/csk-mysql32:default
online         Nov_17   svc:/network/csk-http:CSKapache2
root@vds19:/# svcadm disable svc:/network/csk-mysql32:default
root@vds19:/# svcadm disable svc:/network/csk-http:CSKapache2
root@vds19:/# svccfg delete svc:/network/csk-http:CSKapache2
root@vds19:/# svccfg delete svc:/network/csk-lighttpd:CSKlighttpd
root@vds19:/# svccfg delete svc:/application/csk-tomcat:CSKtomcat
root@vds19:/# svccfg delete svc:/network/csk-mysql32:default
root@vds19:/# rm -rf /opt/coolstack/*

That should do it!

Java

Our Solaris 10 build comes with JDK 1.4, 1.5 and 1.6. These versions of all available in /usr/jdk. We recommend using Java from /usr/jdk/latest, which always points to the latest version of Java available on the system. If we upgrade to newer Java, the /usr/jdk/latest will updated to point to upgraded Java.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: