Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Apache, MySQL

Apache MySQL PHP Solaris 8 Installation

Submitted by on November 21, 2005 – 11:03 am 7 Comments

A sample procedure for installing PHP, MySQL and Apache2 on Solaris 8.

FROM: http://ampubsvc.com/~meljr/a2m4p5s8.html
BY: Mel Lester Jr.

This page briefly documents the installation of Apache 2.0.xx, MySQL 4.0.xx and PHP 5.0.x on Sparc Solaris 8.
Disclaimer
Rapid revision is the nature of Open Source products and the versions I refer to in this document are probably already outdated. Therefore, I am not sharing this information with the promise that I will keep it current or am in any way obligated for any problems you may encounter. Because there was not much in the way of Solaris specific integration information available, I have decided to share what has worked for me in this instance. You are welcome to make use of this information at your own risk. Please exercise caution — especially if you are unsure of the consequences of issuing certain commands with Systems Administrator priviledges. Most of the command examples can be cut and pasted, but you should Read The Fine Manual pages if you are not familiar with the possible consequences.
Assumptions:

* Specific version numbers will probably have changed.
* Installations are done using ksh as superuser (root).
* lines starting with #: are literal examples of root commands.
* Variable parameters that may be specific to your installation are shown in itallics.
* Sparc Solaris 8 installed with most recent recommended patches:
#: uname -a
SunOS hostname 5.8 Generic_117000-03 sun4u sparc SUNW,UltraAX-i2
* A source or build directory exists on a filesystem with plenty of free space:
#: mkdir /build
#: cd /build

Steps:

1. Verify all of the following SUNW* developer packages have been installed:
SUNWarc
SUNWbtool
SUNWhea
SUNWlibm
SUNWsprot
SUNWtoo

Sample command line to determine if package SUNWarc is installed:
#: pkginfo | grep SUNWarc
system SUNWarc Archive Libraries
system SUNWarcx Archive Libraries (64-bit)

Missing packagages may be found on the Solaris 8 installation CDs
2. The $PATH environmental variable for root should begin with the following:
/usr/local/bin
/usr/local/sbin
/usr/ccs/bin

#: echo $PATH
/usr/local/bin:/usr/local/sbin:/usr/ccs/bin:/usr/sbin:/usr/bin
3. The following baseline tools are needed for this installation and are available as easily installed packages from sunfreeware.com:
* perl (a suitable version is usually already installed)
#: perl -v
This is perl, version 5.005_03 built for sun4-solaris
* gunzip or gzip (a suitable version is usually already installed)
#: gunzip -V
gunzip 1.2.4 (18 Aug 93)
* libiconv (downloaded current version of package from sunfreeware.com)
#: gunzip libiconv-1.8-sol8-sparc-local.gz
#: pkgadd -d libiconv-1.8-sol8-sparc-local
* gcc (downloaded current version of package from sunfreeware.com)
#: gunzip gcc-3.4.1-sol8-sparc-local.gz
#: pkgadd -d gcc-3.4.1-sol8-sparc-local
#: gcc –version
gcc (GCC) 3.4.1
* libgcc (should be installed as part of the gcc package – located in /usr/local/lib)
o Now, set these Environmental Variables:
#: CXX=`which gcc`; export CXX
#: CXXFLAGS=”-O3 -felide-constructors -fno-exceptions -fno-rtti”
#: export CXXFLAGS
#: CC=`which gcc`; export CC
#: CFLAGS=”-O3″; export CFLAGS
#: LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib:/usr/local/ssl/lib
#: export LD_LIBRARY_PATH
* gmake (downloaded current version of package from sunfreeware.com)
#: gunzip make-3.80-sol8-sparc-local.gz
#: pkgadd -d make-3.80-sol8-sparc-local

After you install the GNU counterpart of a Solaris program (e.g. tar and make), be sure that your $PATH environmental variable selects the GNU version first.
#: make –version
GNU Make 3.80
* gnu tar (make sure /usr/local/bin is found early in root’s $PATH)
#: gunzip tar-1.14-sol8-sparc-local.gz
#: pkgadd -d tar-1.14-sol8-sparc-local
#: tar –version
tar (GNU tar) 1.14
* flex (downloaded current version of package from sunfreeware.com)
#: gunzip flex-2.5.31-sol8-sparc-local.gz
#: pkgadd -d flex-2.5.31-sol8-sparc-local
#: flex –version
flex 2.5.31
* bison (downloaded current version of package from sunfreeware.com)
#: gunzip bison-1.875d-sol8-sparc-local.gz
#: pkgadd -d bison-1.875d-sol8-sparc-local
#: bison –version
bison (GNU Bison) 1.875d
* m4 (downloaded current version of package from sunfreeware.com)
#: gunzip m4-1.4.1-sol8-sparc-local.gz
#: pkgadd -d m4-1.4.1-sol8-sparc-local
#: m4 –version
GNU m4 1.4.1
* autoconf (downloaded current version of package from sunfreeware.com)
#: gunzip autoconf-2.59-sol8-sparc-local.gz
#: pkgadd -d autoconf-2.59-sol8-sparc-local
#: autoconf –version
autoconf (GNU Autoconf) 2.59
* automake (downloaded current version of package from sunfreeware.com)
#: gunzip automake-1.8b-sol8-sparc-local.gz
#: pkgadd -d automake-1.8b-sol8-sparc-local
#: pkginfo | grep -i automake
application SMCautom automake
* GNU sed (downloaded current version of package from sunfreeware.com)
#: gunzip sed-4.0-sol8-sparc-local.gz
#: pkgadd -d sed-4.0-sol8-sparc-local
#: sed –version
GNU sed version 4.0
* upgrade zlib to version 1.1.4 or greater. (downloaded current version of package from sunfreeware.com)
#: gunzip zlib-1.2.1-sol8-sparc-local.gz
#: pkgadd -d zlib-1.2.1-sol8-sparc-local

Test the installation of baseline tools by builing libxml2 from source:
Download the latest version from: ftp://xmlsoft.org/
#: gunzip -dc libxml2-2.6.11.tar.gz | tar xvpf –
#: cd libxml2-2.6.11
#: ./configure
#: make
#: make install
4. Add /dev/random functionality to Solaris 8 if it doesn’t already exist.
A /kernel/drv/random patch is available from SunSolve Patch Access. An earlier versions of this patch created /dev/random. To find the SPARC/Solaris 8 patch, type 112438-03 into the SunSolve Patch Access “Enter a PatchID” search window and click the Find Patch button. This will take you to the page where the patch is described and where the patch download links are. Download the patch and install it as indicated in the instructions.
#: cd /build
#: unzip 112438-03.zip
#: patchadd ./112438-03
You will probably need to reboot your system.
#: reboot — -r

#: cd /build

If this doesn’t work (/kernel/drv/random isn’t created or patch doesn’t install for some reason), here is an alternative:
download ANDIrand-0.7-5.8-sparc-1 from: http://www.cosy.sbg.ac.at/~andi/SUNrand/
#: pkgadd -d ANDIrand-0.7-5.8-sparc-1

If /dev/random still doesn’t exist, but /kernel/drv/random does:
#: ln -s /kernel/drv/random /dev/random
5. OpenSSL Installation
Download the latest OPENSSL source: http://www.openssl.org/
#: gunzip -c openssl-0.9.7d.tar.gz | tar xvpf –
#: cd openssl-0.9.7d
#: cp Makefile Makefile.orig

#: vi Makefile
replace “RANLIB=/usr/bin/ranlib” with “RANLIB=/usr/ccs/bin/ranlib”
* If you successfully implemented /dev/random, add the line:
“DEVRANDOM= /dev/random”
* OR
“DEVRANDOM= /kernel/drv/random”

Make sure “PERL=” is set to the fully qualified path of perl program.
Save changes and exit vi

#: ./config –prefix=/usr/local/ssl -fPIC
#: make
#: make test
#: make install
#: cd ..

6. MySQL installation
* Create a pseudo user to run mysql:
#: cd /build
#: groupadd mysql
#: useradd -g mysql mysql
* Download the latest MySQL binary for Solaris 8 from: http://www.mysql.com/
#: gunzip mysql-standard-4.0.20-sun-solaris2.8-sparc.tar.gz
#: cd /usr/local
#: tar xvpf /build/mysql-standard-4.0.20-sun-solaris2.8-sparc.tar
* To complete the installation of binary MySQL:
#: ln -s mysql-standard-4.0.20-sun-solaris2.8-sparc mysql
#: cd mysql
#: scripts/mysql_install_db –user=mysql
#: chown -R root /usr/local/mysql
#: chown -R mysql /usr/local/mysql/data
#: chgrp -R mysql /usr/local/mysql
#: cp support-files/my-medium.cnf /etc/my.cnf
* Try to start the MySQL server:
#: cd /usr/local/mysql/bin
#: ./mysqld_safe –user=mysql&
* Set the root MySQL user password and run a few quick tests:
#: ./mysqladmin -u root password ‘new-password’
#: ./mysqladmin -u root -h hostname password ‘new-password’
* Test the server:
#: ./mysqlshow -p
Enter password: new-password

+———–+
| Databases |
+———–+
| mysql |
| test |
+———–+

#: ./mysql -u root -p
Enter password: new-password

Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 3 to server version: 4.0.20-standard
Type ‘help;’ or ‘h’ for help. Type ‘c’ to clear the buffer.

mysql> show databases;
+———–+
| Databases |
+———–+
| mysql |
| test |
+———–+
2 rows in set (0.00 sec)

mysql> quit;
Bye

* If you would like MySQL to start and stop automatically:
#: cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
#: ln /etc/init.d/mysql /etc/rc3.d/S99mysql
#: ln /etc/init.d/mysql /etc/rc3.d/K01mysql
7. Apache 2 installation
#: cd /build
* Download the latest source from: http://httpd.apache.org
#: gzip -d httpd-2.0.50.tar.gz
#: tar xvpf httpd-2.0.50.tar
#: cd httpd-2.0.50
#: ./configure –enable-so –with-layout=Apache –enable-ssl
#: make
#: make install
* Edit the Apache configuration file
#: cd /usr/local/apache2
#: vi conf/httpd.conf
o Change the following line:
Group #-1
o to:
Group nobody
* Test start the Apache Server
#: /usr/local/apache2/bin/apachectl start
* Create the SSL Key and Certificate
#: cd /usr/local/ssl/bin
#: ./openssl genrsa -des3 1024 > /usr/local/apache2/conf/localhost.key
Generating RSA private key, 1024 bit long modulus
…….++++++
…………………..++++++
e is 65537 (0x10001)
Enter pass phrase: somephrase
Verifying – Enter pass phrase: somephrase
#: ./openssl req -new -key /usr/local/apache2/conf/localhost.key >
/usr/local/apache2/conf/localhost.csr
#: ./openssl req -x509 -days 3650 -key
/usr/local/apache2/conf/localhost.key
-in /usr/local/apache2/conf/localhost.csr >
/usr/local/apache2/conf/localhost.crt
* Modify the ssl.conf file to use your certificate.
#: cd /usr/local/apache2/conf
#: vi ssl.conf
o Find the following lines in the ssl.conf file:
DocumentRoot “/usr/local/apache2/htdocs”
ServerName new.host.name:443
SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt
SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key
o Change the respective lines so that they are as follows:
DocumentRoot “/usr/local/apache2/htdocs-secure”
ServerName localhost:443
SSLCertificateFile /usr/local/apache2/conf/localhost.crt
SSLCertificateKeyFile /usr/local/apache2/conf/localhost.key

#: mkdir /usr/local/apache2/htdocs-secure
* Create a simple home page (e.g. Home, Secure Home)
#: vi /usr/local/apache2/htdocs-secure/index.html
Save index.html and exit vi
#: chmod a+rx /usr/local/apache2/htdocs-secure/
#: chmod a+r /usr/local/apache2/htdocs-secure/index.html
* Remove the encryption from the RSA private key
#: cd /usr/local/apache2/conf
#: cp localhost.key server.key.org
#: /usr/local/ssl/bin/openssl rsa -in server.key.org -out localhost.key
#: chmod 400 localhost.key
* Test the Apache https server.
#: /usr/local/apache2/bin/apachectl stop
#: /usr/local/apache2/bin/apachectl startssl
* Note: when the machine is rebooted, Apache will not be restarted automatically. You can manually restart Apache using:
#: /usr/local/apache2/bin/apachectl startssl
or, alternatively, this process can be made automatic by writing a script in the /etc/init.d directory and linking it to the appropriate places in /etc/rc2.d and /etc/rc3.d. See the MySQL installation notes for an example.
8. PHP 5 installation
#: cd /build
* Download the latest production version of PHP from http://www.php.net
#: gzip -d php-5.0.0.tar.gz
#: tar xvpf php-5.0.0.tar
#: cd php-5.0.0
./configure –with-apxs2=/usr/local/apache2/bin/apxs
–with-mysql=/usr/local/mysql/
–enable-dbase –with-libxml-dir=/usr/local/include/libxml2
#: make
#: make install
#: cp php.ini-dist /usr/local/lib/php.ini
* Edit the Apache configuration file to deploy PHP
#: vi /usr/local/apache2/conf/httpd.conf
o Add the following line to the AddType section:
AddType application/x-httpd-php .php
o check for the following line and add it if necessary:
LoadModule php5_module modules/libphp5.so
o Save and exit vi
* Restart Apache to load PHP
#: /usr/local/apache2/bin/apachectl restart

If you made it this far, mission accomplished!
Copyright © 2004 Mel Lester Jr. All rights reserved.

Print Friendly, PDF & Email

7 Comments »

  • hey, thanks for this post here, I found it very helpful. i’ve been setting up the netbeans open solaris environment to develop php and mysql on my local machine. i’ve been having serious trouble with the pre-built NBWebstack environment (Netbeans Web Stack). All the reviews I read said how great netbeans 7.0 beta was, so I’ve been fighting with it to get it installed on my machine. this is really my first exposure to solaris and i’m finding it very different from linux. hopefully this blog stays here a long time because i’ll probably be referring back to it later on…

  • Motordom says:

    I know it is a UNIX operating system, and that it came out very recently. I have some questions about it. Is it open source/free? How does it work? What can it do? What skill level do you need to use it? What is the GUI like? And I am doing a science fair project about what operating system is the best. I already have Windows, Mac, and Linux down, now all I need is to find an OS to represent UNIX. If you have any other suggestions tell me.

  • Hannah says:

    I already added the driver in eclipse.
    On tutorials it says I should be able to right click and see an “Apache Derby” menu item, but I don’t see “Apache Derby”. This is on a Mac by the way with eclipse IDE for EE developers Helios

  • nasty1 says:

    in class i am working on an assignment where i need to translate C to SPARC assembly.
    The C code is something like this:

    for (blahblahblah) {
    if (blahblahblah) {
    if (blahblahblah) {
    break;
    }}}

    Can someone give me the instruction or if no such instruction exists, an example of how i would implement a break in SPARC?

  • Arminator says:

    I am new to Sun Solaris 10, I am currently using it on my intel computer. I want to mount CD ROM on my computer. How can do that , please give full detail as I know very less about Solaris or Unix.

    More details –
    1. I am trying to load simple CD ROMs probabily in CDFS format
    2. How to make mounting automatic.
    3. Make sure i am using intel CPU not Sparc CPU.

    The best answer will get 13 points (10 for best and 3 thumbs up)

  • lets roll says:

    im trying to get photo shop software thats free and is easy to use.

  • The Dark Knight says:

    I need to get a list of all users that belong to a particular UNIX group. I have tried ‘getent group | grep but the resulting list didn’t include everyone, thoug quite large.
    uname -a gives this on the system: SunOS 5.8 Generic_117350-34 sparc SUNW,Sun-Fire-880

    Thanks everyone!

Leave a Reply

%d bloggers like this: