Link to home
Start Free TrialLog in
Avatar of akp007
akp007Flag for Afghanistan

asked on

Apache restart - httpd: could not open document config file /etc/apache2/httpd.conf

Hi Experts -

I am getting the following error message when I am restarting the apache

httpd: could not open document config file /etc/apache2/httpd.conf

Can you please help

Regards
SOLUTION
Avatar of callpete
callpete
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What happened since it was working before ?
Provide us "ls -lah /etc/apache2/httpd.conf" and "find / -name httpd.conf" outputs please.
Avatar of Kerem ERSOY
Kerem ERSOY

akp007: if this is the same nagios server that you're trying to set-up CentOS keeps the settings in /etc/httpd/conf and /etc/httpd/conf.d

So search your files with the wrong path :

cd /etc/httpd
find . -exec grep -H "/etc/apache2/httpd.conf" {} \;

Will you post the output here ?
Avatar of akp007

ASKER

If you noticed my comments regarding Nagios earlier. I mentioned that I was little busy that's why I was not able to get to Nagios the whole day.

The current issue. I am trying to set up apache on a solaris. I downloaded the software and I have noticed there two apache folders. I just gave it try

apachectl -k start from both the folders. I got the same message.

I am going to remove every thing that belong to Apache and reinstall it from scracth

I need to setup apache, phppgadmin on the server.

Thanks for all the valuable suggestions,

Regards
It seesm that you've messed up with your default installation over the Solaris. The default configuration folder for apache in Solaris is: /etc/apache. The configuration file should be  http-standalone-ipp.conf

Avatar of akp007

ASKER

I have the file http-standalone-ipp.conf
it is is /etc/apache

regards
ScoreBoardFile /var/run/httpd-standalone-ipp.scoreboard
 
#
# In the standard configuration, the server will process httpd.conf (this
# file, specified by the -f command line option), srm.conf, and access.conf
# in that order.  The latter two files are now distributed empty, as it is
# recommended that all directives be kept in a single file for simplicity.
# The commented-out values below are the built-in defaults.  You can have the
# server ignore these files altogether by using "/dev/null" (for Unix) or
# "nul" (for Win32) for the arguments to the directives.
#
#ResourceConfig conf/srm.conf
#AccessConfig conf/access.conf
 
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300
 
#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On
 
#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100
 
#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15
 
#
# Server-pool size regulation.  Rather than making you guess how many
# server processes you need, Apache dynamically adapts to the load it
# sees --- that is, it tries to maintain enough server processes to
# handle the current load, plus a few spare servers to handle transient
# load spikes (e.g., multiple simultaneous requests from a single
# Netscape browser).
#
# It does this by periodically checking how many servers are waiting
# for a request.  If there are fewer than MinSpareServers, it creates
# a new spare.  If there are more than MaxSpareServers, some of the
# spares die off.  The default values are probably OK for most sites.
#
MinSpareServers 1
MaxSpareServers 2
 
#
# Number of servers to start initially --- should be a reasonable ballpark
# figure.
#
StartServers 1
 
#
# Limit on total number of servers running, i.e., limit on the number
# of clients who can simultaneously connect --- if this limit is ever
# reached, clients will be LOCKED OUT, so it should NOT BE SET TOO LOW.
# It is intended mainly as a brake to keep a runaway server from taking
# the system with it as it spirals down...
#
MaxClients 150
 
#
# MaxRequestsPerChild: the number of requests each child process is
# allowed to process before the child dies.  The child will exit so
# as to avoid problems after prolonged use when Apache (and maybe the
# libraries it uses) leak memory or other resources.  On most systems, this
# isn't really needed, but a few (such as Solaris) do have notable leaks
# in the libraries. For these platforms, set to something like 10000
# or so; a setting of 0 means unlimited.
#
# NOTE: This value does not include keepalive requests after the initial
#       request per connection. For example, if a child process handles
#       an initial request and 10 subsequent "keptalive" requests, it
#       would only count as 1 request towards this limit.
#
MaxRequestsPerChild 10
 
#
# Dynamic Shared Object (DSO) Support
#
# Dynamic Shared Object (DSO) Support
#
# To be able to use the functionality of a module which was built as a DSO you
# have to place corresponding `LoadModule' lines at this location so the
# directives contained in it are actually available _before_ they are used.
# Please read the file http://httpd.apache.org/docs/dso.html for more
# details about the DSO mechanism and run `httpd -l' for the list of already
# built-in (statically linked and thus always available) modules in your httpd
# binary.
#
# Note: The order in which modules are loaded is important.  Don't change
# the order below without expert advice.
#
LoadModule ipp_module libexec/mod_ipp.so
 
#  Reconstruction of the complete module list from all available modules
#  (static and shared ones) to achieve correct module execution order.
#  [WHENEVER YOU CHANGE THE LOADMODULE SECTION ABOVE UPDATE THIS, TOO]
ClearModuleList
AddModule mod_ipp.c
AddModule mod_so.c
 
### Section 2: 'Main' server configuration
#
# The directives in this section set up the values used by the 'main'
# server, which responds to any requests that aren't handled by a
# <VirtualHost> definition.  These values also provide defaults for
# any <VirtualHost> containers you may define later in the file.
#
# All of these directives may appear inside <VirtualHost> containers,
# in which case these default settings will be overridden for the
# virtual host being defined.
#
 
#
# If your ServerType directive (set earlier in the 'Global Environment'
# section) is set to "inetd", the next few directives don't have any
# If your ServerType directive (set earlier in the 'Global Environment'
# section) is set to "inetd", the next few directives don't have any
# effect since their settings are defined by the inetd configuration.
# Skip ahead to the ServerAdmin directive.
#
 
#
# Port: The port to which the standalone server listens. For
# ports < 1023, you will need httpd to be run as root initially.
#
Port 631
 
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
#  . On SCO (ODT 3) use "User nouser" and "Group nogroup".
#  . On HPUX you may not be able to use shared memory as nobody, and the
#    suggested workaround is to create a user www and use that user.
#  NOTE that some kernels refuse to setgid(Group) or semctl(IPC_SET)
#  when the value of (unsigned)Group is above 60000;
#  don't use Group nobody on these systems!
#
User lp
Group lp
 
#
# ServerAdmin: Your address, where problems with the server should be
# e-mailed.  This address appears on some server-generated pages, such
# as error documents.
#
ServerAdmin lp@localhost
 
#
# ServerName allows you to set a host name which is sent back to clients for
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
# your server if it's different than the one the program would get (i.e., use
# "www" instead of the host's real name).
#
# Note: You cannot just invent host names and hope they work. The name you
# define here must be a valid DNS name for your host. If you don't understand
# this, ask your network administrator.
# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address (e.g., http://123.45.67.89/)
# anyway, and this will make redirections work in a sensible way.
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
#Servername printserver.some_company.com
 
DefaultType application/ipp
 
ErrorLog        /var/lp/logs/ipp-errors
LogLevel        warn
 
# mod_ipp specific configuration
<IfModule mod_ipp.c>
 
        <Location />
                # ipp-conformance automatic     # default
                # ipp-default-user nobody
                ipp-default-service lpsched
                ipp-operation all on
                #       Enable Authentication, requires appropriate modules
                #       loaded
                # AuthType Basic
                # AuthName "IPP Server"
                # AuthUserFile /etc/ipp-users
                # Require valid-user
        </Location>
</IfModule>
#
# 127.0.0.1 is the TCP/IP local loop-back address, often named localhost. Your
# machine always knows itself by this address. If you use Apache strictly for
# local testing and development, you may use 127.0.0.1 as the server name.
#
#Servername printserver.some_company.com
 
DefaultType application/ipp
 
ErrorLog        /var/lp/logs/ipp-errors
LogLevel        warn
 
# mod_ipp specific configuration
<IfModule mod_ipp.c>
 
        <Location />
                # ipp-conformance automatic     # default
                # ipp-default-user nobody
                ipp-default-service lpsched
                ipp-operation all on
                #       Enable Authentication, requires appropriate modules
                #       loaded
                # AuthType Basic
                # AuthName "IPP Server"
                # AuthUserFile /etc/ipp-users
                # Require valid-user
        </Location>
</IfModule>

Open in new window

Avatar of akp007

ASKER

I have removed all the instances of apache2 on the server. So now I have only the apche , which comes with Solaris.

I found apachectl in /usr/apache/bin/
I did the following
# pwd
/usr/apache/bin
# ./apachectl restart
./apachectl restart: httpd not running, trying to start
fopen: No such file or directory
httpd: could not open document config file /etc/apache/httpd.conf
./apachectl restart: httpd could not be started
#


Regards
It does not seem to be that it is from the default isntallation of apache.

Will you post
svcs -a | grep apache

output here ??
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of akp007

ASKER

$ svcs -a | grep apache
legacy_run     Sep_30   lrc:/etc/rc3_d/S50apache
disabled       Sep_30   svc:/network/http:apache2
atadev02:/usr/local/apache2:$

regards
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of akp007

ASKER

i did run the command

I got the following message
# svcadm enable apache2
# svcs | grep -i apache2
maintenance    13:59:55 svc:/network/http:apache2

It's not online yet.

Regards
Avatar of akp007

ASKER

I just checked the logfile for network-http:apache2.log"

i found the following info
[ Aug 28 13:59:55 Enabled. ]
[ Aug 28 13:59:55 Executing start method ("/lib/svc/method/http-apache2 start") ]
[ Aug 28 13:59:55 Method "start" exited with status 96 ]
~

regards
Avatar of akp007

ASKER

Hi All -

                      I would like to reinstall the apache on the sun I have leaving the existing as it is . Because I need to install php and phppgadmin also on the same server.  I appreicate all your suggestions. I got some errors while doing the Make and I found the I needed 10.5.08 to fix those errors. I am going to close the current discussion. Is that fair enough? Please suggest



Regards
Avatar of akp007

ASKER

thanks for all the suggestions. As I mentioned I am going to install the apache standalone and will seek your assistance for any errors that I come accross

Regards
Avatar of akp007

ASKER

I could able to make the existing apache working . What i did was
cp /etc/apache2/httpd.conf-example /etc/apache2/httpd.conf
and then edited the file to change the ip address from 127.0.0.1 to our server  and
/usr/apache/bin/apachectl -k start

It started working.. thanks again for all your valuable suggestions