Solved

Method "start" exited with status 1

Posted on 2010-11-28
25
2,192 Views
Last Modified: 2012-05-10
I removed from Solaris all previous installation of Apache and install last release 2.2.17 into /usr/local
But Apache doesn't go online and stay in the maintenance status.
Log show this:
[ ¿¿¿¿. 28 17:39:25 Executing start method ("/lib/svc/method/http-apache2 start") ]
/lib/svc/method/http-apache2: /usr/apache2/bin/apachectl: not found
[ ¿¿¿¿. 28 17:39:25 Method "start" exited with status 1 ]
Why it cant find apachectl?
 
find / -name "apachectl"#
/usr/local/apache2/bin/apachectl

Open in new window

0
Comment
Question by:gbcbr
  • 15
  • 9
25 Comments
 

Author Comment

by:gbcbr
ID: 34225798
Why it try to look at /usr/apache2 if in httpd.conf ServerRoot "/usr/local/apache2"
0
 

Author Comment

by:gbcbr
ID: 34226035
When I try to start it manually
# /usr/local/apache2/bin/apachectl start
ld.so.1: httpd: fatal: libiconv.so.2: open failed: No such file or directory
Killed

Open in new window

0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34227056
Your smf script in /lib/svc/method/http-apache2 (probably left over from a previous apache2 installation) must have a reference to /usr/apache2/bin/apachectl.  You can edit /lib/svc/method/http-apache2 to change that to your new location (/usr/local/apache2/bin/apachectl).

However, you will first need to address your libiconv.so.2 problem.
Do you have libiconv installed?  It's pretty easy to get it and install it (http://www.gnu.org/software/libiconv/).  And then you can re-try a manual start of apache.

If this doesn't completely fix your problem, let us know how you compiled apache 2.2.17 (the contents of your config.nice might be a good place to start).
0
 
LVL 1

Expert Comment

by:Praveen_Venkat
ID: 34228068
Use find / -type f -name "Apachectl"
0
 

Author Comment

by:gbcbr
ID: 34228467
Please advice what is the possible problem with gnu and gcc configuring
# /usr/local/libiconv-1.13/configure --prefix=/usr/local
checking for a BSD-compatible install... /usr/local/libiconv-1.13/build-aux/install-sh -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/local/libiconv-1.13/build-aux/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether make sets $(MAKE)... no
checking whether make sets $(MAKE)... (cached) no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
# /usr/local/gcc-4.4.2/configure --prefix=/usr/local
checking build system type... i386-pc-solaris2.10
checking host system type... i386-pc-solaris2.10
checking target system type... i386-pc-solaris2.10
checking for a BSD-compatible install... /usr/local/gcc-4.4.2/install-sh -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... no
checking for cc... cc
checking for C compiler default output file name... configure: error: in `/usr/local':
configure: error: C compiler cannot create executables
See `config.log' for more details.

Open in new window

0
 

Author Comment

by:gbcbr
ID: 34229197
These are log files config-gcc.log config-gnu.log
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34232268
You should add /usr/sfw/bin to your PATH, since you are on Solaris 10.  You may find that gcc already exists in /usr/sfw/bin/gcc.  If gcc isn't there, and you have the Solaris 10 install disks, you can look for the packages SUNWgcc and SUNWgccruntime.  But doing a manual pkgadd installation of gcc may not be easy, due to dependencies.

So let's start with:  Do you have /usr/sfw/bin/gcc ?


Alternatively, and maybe easier if you don't already have /usr/sfw/bin/gcc -- you can download a gcc package from http://sunfreeware.com/   These packages generally install into /usr/local.
Or you can use Blastwave:  http://www.blastwave.org/, which can help with the installation of dependencies as well, and generally installs into /opt/csw.

Of course, if you need to download and install packages at all, then you may be able to avoid having to compile things entirely.  You could try, for instance, just installing the sunfreeware packages for libintl, libgcc, and libiconv.  Then maybe your apache installation would be happy.  :-)
0
 

Author Comment

by:gbcbr
ID: 34236834
>> Do you have /usr/sfw/bin/gcc ?
yes, I found it in /usr/sfw/bin/gcc

Also I add these two packages, add /usr/sfw/bin to the PATH, succesfully make config libiconv and correct script at /lib/svc/method/http-apache2
But it still in maintenance stsus.
I see on libiconv site:
$ ./configure --prefix=/usr/local
$ make
$ make install
I don't undestand last two commands.
I found into /usr/local file Makefile it confuse me
# svcadm disable apache2
# svcadm enable apache2
# svcs -l apache2
fmri         svc:/network/http:apache2
name         Apache 2 HTTP server
enabled      true
state        maintenance
next_state   none
state_time   30 ¿¿¿¿¿¿ 2010 ¿.  9:46:17 EET
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 (online)
dependency   optional_all/error svc:/system/filesystem/autofs:default (online)

Open in new window

0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34237697
That's really good news so far.

The 'make' command uses the Makefile generated by the './configure --prefix=/usr/local' command, and does the compiling of libiconv; then 'make install' uses the Makefile to install the compiled libiconv parts into the right places on your system.

With that done, we can proceed to look at apache further.
Does a manual start of apache work now?

If so, try:
svcadm clear apache2
svcadm enable apache2

If it's still in maintenance, let's see the output of
svcs -x apache2
as well as the contents of the logfile /var/svc/log/network-http:apache2.log
0
 

Author Comment

by:gbcbr
ID: 34237802
but I can' t execute these commands
# make
make: not found
# /usr/local make
/usr/local: cannot execute
# /usr/local Makefile
/usr/local: cannot execute

Open in new window

0
 

Author Comment

by:gbcbr
ID: 34238676
What else?
# /usr/ccs/bin/make
builddir="`pwd`"; cd libcharset && make all && make install-lib libdir="$builddir/lib" includedir="$builddir/lib"
sh: make: not found
*** Error code 1
make: Fatal error: Command failed for target `lib/localcharset.h'
# /usr/ccs/bin/make -f /usr/local/Makefile
builddir="`pwd`"; cd libcharset && make all && make install-lib libdir="$builddir/lib" includedir="$builddir/lib"
sh: make: not found
*** Error code 1
make: Fatal error: Command failed for target `lib/localcharset.h'
# /usr/ccs/bin/make -f makefile /usr/local
make: Fatal error: Can't find `makefile': No such file or directory
# /usr/ccs/bin/make -f makefile /usr/local/Makefile
make: Fatal error: Can't find `makefile': No such file or directory
# /usr/ccs/bin/make -f
Usage : make [ -f makefile ][ -K statefile ]... [ -d ][ -dd ][ -D ][ -DD ]
             [ -e ][ -i ][ -k ][ -n ][ -p ][ -P ][ -q ][ -r ][ -s ][ -S ][ -t ]
             [ -u ][ -w ][ -V ][ target... ][ macro=value... ][ "macro +=value"... ]
make: Fatal error: Missing argument after `-f'
# /usr/ccs/bin/make -f makefile
make: Fatal error: Can't find `makefile': No such file or directory
# /usr/ccs/bin/make -f makefile /usr/local/makefile
make: Fatal error: Can't find `makefile': No such file or directory

Open in new window

0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34246092
You should add /usr/ccs/bin to your PATH, so that just typing 'make' will find it.
It looks like you're using the default shell /bin/sh (correct me if I'm wrong), so try this:

PATH=${PATH}:/usr/ccs/bin
echo $PATH
which make

When you run 'make', it looks for Makefile in your current directory.
So for libiconv, you will cd into the libiconv source directory before running make.


All this make me suspect that maybe you didn't compile Apache 2.2.17 from source, though.  Did you?  When you say you installed 2.2.17 into /usr/local, how did you go about doing this?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:gbcbr
ID: 34248465
<< you didn't compile Apache 2.2.17 from source >>
no I made
# pkgadd -d usr/local/apache-2.2.15-sol10-x86-local
0
 

Author Comment

by:gbcbr
ID: 34248568
sorry # pkgadd -d usr/local/apache-2.2.17-sol10-x86-local
I add the PATH
# PATH=${PATH}:/usr/ccs/bin
# echo $PATH
/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/ucb:/usr/sfw/bin::/usr/ccs/bin
# which make
/usr/ccs/bin/make

but when I start make  
# cd /usr/local/libiconv-1.13
# make
make: Fatal error: No arguments to build
# ls
ABOUT-NLS        configure        doc              libcharset       os2              src              woe32dll
aclocal.m4       configure.ac     extras           m4               po               srclib
AUTHORS          COPYING          gnulib-local     Makefile.devel   PORTS            srcm4
autogen.sh       COPYING.LIB      HACKING          Makefile.in      preload          tests
build-aux        DEPENDENCIES     include          man              README           THANKS
ChangeLog        DESIGN           INSTALL.generic  NEWS             README.djgpp     tools
config.h.in      djgpp            lib              NOTES            README.woe32     windows
#

Open in new window

0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34249327
Ah, this is illuminating.  :-)
FYI, make doesn't work because there's no Makefile, which indicates that "./configure --prefix=/usr/local" hasn't been successfully run.

But -- the fact that you installed apache-2.2.17-sol10-x86-local using pkgadd looks like you probably got this package from sunfreeware.com.  Is that right?
sunfreeware indicates (find apache-2.2.17 on http://www.sunfreeware.com/programlistintel10.html) the various dependencies, also available as packages.

I recommend getting rid of the libiconv source that you downloaded, and that you download the sunfreeware package for libiconv, as well as the others:  expat, openldap, sasl, zlib, openssl
and install them, if they are not already installed.

Then apache should work.
0
 

Author Comment

by:gbcbr
ID: 34249470

My point of view that the best medicine from the dandruff is the guillotine.
If I'll delete all previous installations from /usr/local and start from the beginning with
httpd-2.2.17.tar.gz
libiconv-1.13. tar.gz
gcc-4.2.2.tar.gz
because I already download them before, please advice from which point I have to start to finalize proper installation.
Let's say PATH already establised, so everything have to go canonically.
0
 
LVL 12

Accepted Solution

by:
larsrohr earned 500 total points
ID: 34251033
I really would lean toward installation from the sunfreeware.com packages, actually, which would mean downloading and installing these packages using pkg_add:
expat-2.0.1-sol10-x86-local
libintl-3.4.0-sol10-x86-local
libiconv-1.13.1-sol10-x86-local
libtool-2.4-sol10-x86-local
openssl-1.0.0b-sol10-x86-local
db-4.7.25.NC-sol10-x86-local
sasl-2.1.21-sol10-x86-local
zlib-1.2.5-sol10-x86-local
apache-2.2.17-sol10-x86-local

That's already quite a bit of work, and doesn't even involve compiling.
Don't worry about gcc -- the one you have in /usr/sfw/bin/gcc should be just fine.

To compile all these from source would require some trial and error, and isn't for the faint of heart.  You would still need the source code for some of those other parts, e.g. at least:
cyrus-sasl-2.1.23.tar.gz
db-4.8.30.tar.gz
expat-2.0.1.tar.gz
httpd-2.2.17.tar.gz
libiconv-1.13.1.tar.gz
openldap-2.4.23.tar.gz
openssl-0.9.8o.tar.gz

Compiling all these from source would be going down a long, dark road.  I have a script for this that works on *my* systems, but the options I use at each configure may not be the same ones you need.  The package installation would be a much better approach.
0
 

Author Comment

by:gbcbr
ID: 34251234
So, I have to download all of these pkd's from sunfreeware  and install them?
It's  not easy way to make compiling of original httpd-xxxx from apache?
Or, this compiling doesn't bring all defendants anyway?
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34251494
Yes, I'd recommend downloading the packages from sunfreeware and installing them.

Compiling doesn't bring in the dependencies automatically -- each dependency would need to be compiled independently before apache could be compiled.  So installing the sunfreeware packages will be much, much simpler.
0
 

Author Comment

by:gbcbr
ID: 34255375
I install all pakages + openldap-2.4.9 and gcc-4.5.1 but still I have two error messages:
 
# svcadm clear apache2
# svcadm enable apache2
# svcs -l apache2
fmri         svc:/network/http:apache2
name         Apache 2 HTTP server
enabled      true
state        maintenance
next_state   none
state_time    2 ¿¿¿¿¿¿¿ 2010 ¿. 10:05:44 EET
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 (online)
dependency   optional_all/error svc:/system/filesystem/autofs:default (online)
# /usr/local/apache2/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using 10.1.1.7 for ServerName
httpd (pid 18641) already running

Open in new window

and in log file
[ ¿¿¿.  2 10:05:28 Executing start method ("/lib/svc/method/http-apache2 start") ]
ld.so.1: httpd: fatal: libgcc_s.so.1: open failed: No such file or directory
Killed
[ ¿¿¿.  2 10:05:28 Method "start" exited with status 137 ]
[ ¿¿¿.  2 10:05:44 Leaving maintenance because clear requested. ]
[ ¿¿¿.  2 10:05:44 Enabled. ]
[ ¿¿¿.  2 10:05:44 Executing start method ("/lib/svc/method/http-apache2 start") ]
ld.so.1: httpd: fatal: libgcc_s.so.1: open failed: No such file or directory
Killed
[ ¿¿¿.  2 10:05:44 Method "start" exited with status 137 ]
0
 

Author Comment

by:gbcbr
ID: 34257658
I install also libgcc package into /usr/local as all previous packages and add to the PATH
 
PATH=/usr/sbin:/usr/bin:/usr/openwin/bin:/usr/ucb:/usr/sfw/bin::/usr/ccs/bin:/usr/local/bin:/usr/local/sbin

Open in new window

I have now everything installed into /usr/local and proper PATH, corrected script, but no progress.
Even I can't start it manually,
 
# /usr/local/apache2/bin/apachectl start
httpd: Could not reliably determine the server's fully qualified domain name, using 10.1.1.7 for ServerName

Open in new window

10.1.1.7 is the address of server, but in /etc/apache2/httpd.conf ServerName http://localhost:80
Looks like apache doesn't see any enviroment and play itself what it want
APACHE_HOME=/usr/local/apache2
CONF_FILE=/etc/apache2/httpd.conf
PIDFILE=/var/run/apache2/httpd.pid
But I don't have PIDFILE in this directory, maybe problem it this?
0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34265382
It looks like you now have everything you need installed.
I would say that it's probably just a matter of getting your httpd.conf right.

The ServerName directive can be set to be:
ServerName localhost

Open in new window


Or, it can be set to another name if there's a more appropriate hostname for your machine.
But "ServerName http://localhost:80" isn't the right syntax for the httpd.conf file.
Do you have the httpd.conf used in previous installations of apache on this machine?

Note that you can test for a running process with:
 ps -eaf |grep httpd
0
 

Author Comment

by:gbcbr
ID: 34267807
This is very strange:
# ps -eaf | grep httpd
    root 26411     1   0  ¿¿¿. 02 ?           0:02 /usr/local/apache2/bin/httpd -k start
  daemon 26414 26411   0  ¿¿¿. 02 ?           0:00 /usr/local/apache2/bin/httpd -k start
  daemon 26416 26411   0  ¿¿¿. 02 ?           0:00 /usr/local/apache2/bin/httpd -k start
  daemon 26412 26411   0  ¿¿¿. 02 ?           0:00 /usr/local/apache2/bin/httpd -k start
  daemon 26413 26411   0  ¿¿¿. 02 ?           0:00 /usr/local/apache2/bin/httpd -k start
    root 20214  1853   0 18:09:19 pts/4       0:00 grep httpd
    root  7410     1   0  ¿¿¿. 02 ?           0:50 gedit file:///etc/apache2/httpd.conf
  daemon 26415 26411   0  ¿¿¿. 02 ?           0:00 /usr/local/apache2/bin/httpd -k start
# which httpd
no httpd in /usr/sbin /usr/bin /usr/openwin/bin /usr/ucb /usr/sfw/bin . /usr/ccs/bin /usr/local/bin /usr/local/sbin
# locate httpd
locate: not found

Open in new window

0
 
LVL 12

Expert Comment

by:larsrohr
ID: 34269094
No, that's okay.  It shows that apache is running.  Try http://localhost from a browser on that machine.

'which httpd' won't find httpd, because /usr/local/apache2/bin is not part of your PATH, and there's no reason for that to be part of your PATH.
(and by the way, it's recommended that you don't have "." as part of your PATH -- but that's another question...)

'locate' is not normally part of Solaris -- that's more commonly found on Linux or FreeBSD.
0
 

Author Closing Comment

by:gbcbr
ID: 34272969
Thank you very much, I hope this will be very useful for many people new with apache
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now