Showing posts with label Solaris x86. Show all posts
Showing posts with label Solaris x86. Show all posts

Sunday 30 November 2014

Installing & Configuring Apache 2.2 (64bit) on Solaris x86-64 Box

This post is divided into 3 sections: Installation, Configuration & Verification. 



So let's start the process.........


Installing Apache22-64bit-

  1. To install apache22, we need the source code & than need to build it. This will generate the binaries.
  2. Download the source code from http://httpd.apache.org/download.cgi#apache22 to your Solaris Sparc box.
  3. Now we need to 'export' some settings, i.e. per-requisites before we start the build process:
    1. export LD_LIBRARY_PATH=/usr/sfw/lib/amd64:/usr/local/lib/amd64
    2. export PATH=/usr/sfw/bin:/usr/ccs/bin:/usr/local/ccs/bin:/usr/local/bin:$PATH
    3. # if you want it 64 bits:
      1. export CFLAGS=”-m64″
    4. # if you want it 32 bits:
      1. # export CFLAGS=”-m32″
    5. export LDFLAGS=”-L/usr/sfw/lib/amd64″
    6.  
      4.  Unzip the downloaded apache22 source code.
      5.  Change the directory, move to the unzipped folder.
      6.  Now we need to configure the environment for building the source code, for this it is 
           required to execute the 'configure' script present in the directory.

           For eg: /scratch/ckukreja/apache22 is the directory where you have unzipped the 
                       source code
                       
                       bash$>ls -ltr configure

      7.  Execute the 'configure'  script.
           ./configure --with-included-apr --enable-so --prefix=/scratch/ckukreja/apache64



      8. Now we need to build & install the binaries. Do the following:
    • make



    • make install

     9. Now go to the directory where you have install apache22
    • Move to bin folder and execute the 'file' command on httpd executable file.
                 bash$> cd /home/ckukreja/apache22/bin 
                 bash$> file httpd
    • 'file httpd' - It's output will show you the type of file is it. Here it should show 64bit, if not than the binaries are of 32bit. Check the steps again.
    


Configure Apache22 on Solaris Sparc Box:

 As you have installed the apache22 on your Solaris Machine. Now it is required to configure it before we start the server.
  1. Go to the apache22 installation directory. Move to conf folder.
         bash$> cd /home/ckukreja/apache22/conf  
     2. Open httpd.conf file to edit it. 

          bash$> vi httpd.conf
    • Change the port from '80' to the one you want. Like we use '8080'.
    • By default username & group are configured as 'daemon'. Change them to the one you are logged in with.
    • Save the changes & close the file.

      3. Now come out of the conf folder & change your directory to bin folder.
          
         bash$>cd /scratch/ckukreja/apache64/bin

      4. Execute the apachectl executable. It will start the httpd server process.
    • ./apachectl -k  start

Verify the installation & configuration steps:

Try to access the default resource present on apache22 server like index.html.
Syntax: http://<hostname>:<port>/index.html
Eg: http://hostname:8080/index.html

It will display the "It Works!!!"



So guys you are done with the Installation & Configuration of Apache22-64bit on your Solaris x86-64 Machine..........!!!!!!!!!!!!!! :-)


Enjoy :-)

Saturday 5 July 2014

coreadm - core file administration

coreadm command for Solaris:

You must be wondering what this coreadm command does. It is really a powerful tool that helps the administrator to look at the cores generation way.

Actually there are times when we found that our core files is getting generated with the name "core" in the process running directory. And if the process is generating cores in quick succession than the same file is getting overwritten all the time.

Thus it will become tough for us to debug the core..............

So in such cases we can actually make the core file get generated with a name pattern and this can be possible with the coreadm command in Solaris OS (x86 or SPARC).

Execute the command without any option will display the current settings done for the core files generation.

bash-3.2$ coreadm
     global core file pattern:
     global core file content: default
     init core file pattern: core
     init core file content: default
     global core dumps: disabled
     per-process core dumps: enabled
     global setid core dumps: disabled
     per-process setid core dumps: disabled
     global core dump logging: disabled


When i executed the command on my Solaris Sparc box above output is shown. It shows that core file generation per-process is enabled but the core file name pattern (in init core file pattern) is "core" only. Thus with this setting the same file will be overwritten all the time.

So as to set the name pattern for per-process, follwoing is the command:

  • bash-3.2$ coreadm -i core.%f.%p.%t
Here %f - file/process name
         %p - process pid
         %t - default timestamp

To confirm above made settings, execute below mentioned command:
  • bash-3.2$ coreadm $$
          27756:  core.%f.%p.%t   default
It shows the set core file name pattern.

Thus now-onwards you will notice that core files will be generated with a name pattern.
Like - "core.httpd.worker.4298.1404300544"

So coreadm makes our life easy....................

Enjoy :-)