apache2 problem sun solaris 10

I installed on m sun solaris 10, just the core sdistribution

I installed packages:

systemSUNWapch2dApache Web Server V2 Documentation

systemSUNWapch2rApache Web Server V2 (root)

systemSUNWapch2uApache Web Server V2 (usr)

But when i try to enable apache

svcadm enable apache2

i get:

svcadm: Pattern 'apache2' doesn't match any instances

i looked all day in doc's the internet, but no good solution.

Who has got the answer for me.

[507 byte] By [Bezerk] at [2007-11-25 22:51:40]
# 1
hey rebooting a unix box worked?svcs -a | grep apache2no showed disabled ?before rebooting i didn't show up.Strange!!
Bezerk at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2

Likewise, I have that problem.

Heres what I found, but no luck searching for an answer.

[ May 4 18:36:04 Enabled. ]

[ May 4 18:36:04 Executing start method ("/lib/svc/method/http-apache2 start")

]

[ May 4 18:36:04 Method "start" exited with status 96 ]

[ May 4 18:36:30 Leaving maintenance because disable requested. ]

[ May 4 18:36:30 Disabled. ]

bash-3.00# svcs -dv apache2

STATE NSTATESTIMECTIDFMRI

online - 18:38:22- svc:/network/loopback:default

online - 18:38:30- svc:/network/physical:default

bash-3.00# svcs apache2

STATE STIMEFMRI

maintenance18:38:31 svc:/network/http:apache2

Obviously Im missing something but, please be patient, Im a newbie on Solaris. Can do most basic things but really wanted to get hands dirty and learn.

Part of me just wants to compile the source and be done, but this should be easy to fix.

-fyoory

fyoory at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 3
try:/usr/sbin/svcadm clear network/http:/apache2
tomg at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 4

I found that it isn't just clearing that works.

If you look at the logs indicated in "svcs -x apache2" after a reboot, at least on my freshly installed Solaris 10, the startup script had problems creating /var/run/apache2 because it saw /var/run as a read only filesystem.

What I did was edit the apache2 start file in /lib/svc/method (I'm not where I have access, so I don't have the exact filename) and put a 'sleep 5' just prior to the line "mkdir -p /var/run/apache2".

Now my apache2 instance comes up cleanly on reboots. I've been meaning to open a service request to report this bug.

BPS

bpschuck at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 5

-With Apache startup, you can try to ensure that your httpd configuration files are configured properly.

-You can also ensure that your network services, including apache web server http services, are up and running at boot time in your rc directory.

-This is my experience from doing work with Linux. I'm also a Solaris 10 newbie, but have had experience and training with solaris 8.

-The best thing for you to do is go to www.apache.org and see how to properly config your httpd content files and to ensure how to config and start the services on startup.

Black_Majic at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 6

when I use apache (v.1)

# /etc/init.d/apache start

it works.

But when I type

#/usr/apache2/bin/apachectl start

It shows:

/usr/apache2/bin/apachectl: /usr/apache2/bin/httpd: not found

Then I chech /usr/apache2/bin, it is true lacking such a file.

should I rebuild apache2 and httpd ?

joinfire at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 7

Heya,

The maintenance state of apache2 and the log file from "svcs -x apache2"

both indicate absence of properly mounted /usr which I have solved by hacking in another dependencie into SMF xml file for apache2:

# diff /var/svc/manifest/network/http-apache2.xml /root/var_svc_manifest_network_http-apache2.xml_ORIGINAL

24,30d23

<<dependency name='filesystem'

< grouping='require_all'

< restart_on='error'

< type='service'>

< <service_fmri value='svc:/system/filesystem/usr:default'/>

<</dependency>

Now everything is working,

and probably hiding in resolution to [invisible to me] bug 6270245.

slava at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 8

Actually

svc:/system/filesystem/local:default

is even more proper instead of /usr

if apache2 docroot directory is on other mounts.

# diff /var/svc/manifest/network/http-apache2.xml /root/var_svc_manifest_network_http-apache2.xml_ORIGINAL

24,30d23

<<dependency name='filesystem'

< grouping='require_all'

< restart_on='error'

< type='service'>

< <service_fmri value='svc:/system/filesystem/local:default'/>

<</dependency>

slava at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 9

Well,

actually modifications to SMF xml config file were only useful so far,

then apache would still get stuck looking for our docRoot files which were not on / or /usr or /var.

After trying "sleep 2" in start method all is coming up fine after reboots.

What a BLAH BUG!

slava at 2007-7-5 17:07:08 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...