Monday, February 21, 2011



Apache on Solaris 10

Posted: 21 Feb 2011 05:55 AM PST

The apache web server is included with solaris 10. Follow these steps to enable it. 

Step 1: Create a working default apache config file

The apache server config files are in /etc/apache2. To quickly get up and running, you can just use the sample config file by doing the following:
cd /etc/apache2 cp httpd.conf-example httpd.conf 

Step 2: Enable the apache/httpd service

Check to see if apache is already running:
svcs -a | grep -i http 
You will probably see the following, indicating that apache is NOT running:
disabled       Apr_20   svc:/network/http:apache2 

Use the svcadm command to start the webserver. This will also make it automatically start if your machine reboots.
svcadm -v enable /network/http:apache2 
Use the following svcs command to make sure it worked:
svcs -p /network/http:apache2 STATE          STIME    FMRI online         15:32:44 svc:/network/http:apache2                15:32:44    28711 httpd                15:32:45    28712 httpd                15:32:45    28713 httpd                15:32:45    28714 httpd                15:32:45    28715 httpd                15:32:45    28716 httpd 
This is showing that the webserver is online and working. 

Step 3: Add your web content

Put your html webpage(index.html) in the /var/apache2/htdocs directory. If everything went OK, you should have a functioning apache webserver. 

Debugging / Troubleshooting

If the svcs -p command from the above step doesn't show a STATE of online, do the followig:
svcs -a | grep -i http 

You'll probably see that it's in maintenance mode:
maintenance    15:16:12 svc:/network/http:apache2 
For more detailed info run:
svcs -l http 
svcs -x http svc:/network/http:apache2 (Apache 2 HTTP server)  State: maintenance since May  8, 2007  3:16:12 PM EDT Reason: Start method failed repeatedly, last exited with status 1.    See:    See: httpd(8)    See: /var/svc/log/network-http:apache2.log Impact: This service is not running. 
Note that the second to last line tells you where the log file is, so take a look at that. Once you've fixed the problem, you can restart apache with:
svcadm restart /network/http:apache2 
If for some reason you want to shut off apache, use this:
svcadm disable /network/http:apache2  svcs -p /network/http:apache2 STATE          STIME    FMRI disabled       15:36:33 svc:/network/http:apache2 

svcs -l http fmri         svc:/network/http:apache2 name         Apache 2 HTTP server enabled      false state        disabled next_state   none state_time   May  8, 2007  3:36:33 PM EDT logfile      /var/svc/log/network-http:apache2.log restarter    svc:/system/svc/restarter:default contract_id dependency   require_all/error svc:/milestone/network:default (online) dependency   require_all/none svc:/system/filesystem/local:default (online) dependency   optional_all/error svc:/system/filesystem/autofs:default (online)

SSH on Solaris 10

Posted: 21 Feb 2011 05:46 AM PST

To generate your keys:

ssh-keygen -t dsa
ssh-keygen -t rda

Then, save the public (NOT the private keys!) keys that you just generated.

#cat  *.pub keys >> authorized_keys
The newly created authorized_keys file can then be copied to the destination system. This will allow you to log in without providing a password.

To stop and start sshd:

svcadm disable ssh
svcadm enable ssh

Debugging tips:

Server side debugging - Once ssh service is disabled (svcadm disable ssh), you can start manually in debug mode:

cd /usr/lib/ssh
./sshd -dd

./sshd -v will available command-line options

ssh -v will turn on client debugging

sshd config file for the entire server is in /etc/ssh/sshd_config

permissions on your home directory MUST be 750

Monday, February 14, 2011



Secure Your Passwords...

Posted: 14 Feb 2011 01:11 AM PST