Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache won't start after upgrade [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
cyclocross
n00b
n00b


Joined: 05 Sep 2003
Posts: 55
Location: Minneapolis USA

PostPosted: Fri Sep 07, 2007 3:10 am    Post subject: apache won't start after upgrade [SOLVED] Reply with quote

after I got the upgrade and merged the config files, when i try to start or restart I get:

/etc/init.d/apache2 restart
* Apache2 has detected a syntax error in your configuration files:
Usage: /usr/sbin/apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files


Of course it's not telling me *which* config file has the problem. Any ideas?

Thanks


Last edited by cyclocross on Fri Sep 14, 2007 2:02 am; edited 1 time in total
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2060
Location: San Jose, CA

PostPosted: Fri Sep 07, 2007 6:02 am    Post subject: Reply with quote

Did you make sure to do a 'dispatch-conf' or 'etc-update'?

The start script changed for version 2.2.

Raydude
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
zeek
Guru
Guru


Joined: 16 Nov 2002
Posts: 480
Location: Bantayan Island

PostPosted: Fri Sep 07, 2007 6:21 am    Post subject: Reply with quote

I had a similar problem. I didn't have -D DEFAULT_VHOST set in /etc/conf.d/apache2.
Back to top
View user's profile Send private message
RayDude
Advocate
Advocate


Joined: 29 May 2004
Posts: 2060
Location: San Jose, CA

PostPosted: Fri Sep 07, 2007 6:48 am    Post subject: Reply with quote

I was missing "Listen *:80" on one install.

But I got a different error message.

Raydude
_________________
Some day there will only be free software.
Back to top
View user's profile Send private message
cyclocross
n00b
n00b


Joined: 05 Sep 2003
Posts: 55
Location: Minneapolis USA

PostPosted: Fri Sep 07, 2007 12:24 pm    Post subject: Reply with quote

I do have -D DEFAULT_VHOST in /etc/conf.d/apache2

I did do a etc-update, but it's possible that i messed that up. Is there a way to re-merge the config files?

Thanks
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5934

PostPosted: Fri Sep 07, 2007 12:42 pm    Post subject: Reply with quote

cyclocross wrote:
I do have -D DEFAULT_VHOST in /etc/conf.d/apache2

I did do a etc-update, but it's possible that i messed that up. Is there a way to re-merge the config files?

Thanks


if you overwrote the old file, its gone. 8O
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
cyclocross
n00b
n00b


Joined: 05 Sep 2003
Posts: 55
Location: Minneapolis USA

PostPosted: Fri Sep 07, 2007 12:56 pm    Post subject: Reply with quote

I can re-edit the new files if I need to, but I need the new config files to be pulled in. I tried emerge -C apache, then re-emerge but it left the config files. I think my best option is to replace apache and start again. How can i do that so that it removes the config files as well.

Thanks
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5934

PostPosted: Fri Sep 07, 2007 1:01 pm    Post subject: Reply with quote

emerge -C apache
rm -rf /etc/apache
emerge apache

:?:

cheers
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
cyclocross
n00b
n00b


Joined: 05 Sep 2003
Posts: 55
Location: Minneapolis USA

PostPosted: Thu Sep 13, 2007 11:18 pm    Post subject: Reply with quote

Quote:
emerge -C apache
rm -rf /etc/apache
emerge apache


This is odd. After doing the above, I get the same issue:
/etc/init.d/apache2 start
* Apache2 has detected a syntax error in your configuration files:
Usage: /usr/sbin/apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|graceful-stop|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t -D DUMP_MODULES : show all loaded modules
-M : a synonym for -t -D DUMP_MODULES
-t : run syntax check for config files


Is there something else that could be installed that would cause this problem?

Thanks
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Fri Sep 14, 2007 1:00 am    Post subject: Reply with quote

Post the content of /etc/conf.d/apache2


// SteveB
Back to top
View user's profile Send private message
cyclocross
n00b
n00b


Joined: 05 Sep 2003
Posts: 55
Location: Minneapolis USA

PostPosted: Fri Sep 14, 2007 1:05 am    Post subject: Reply with quote

Here's my /etc/conf.d/apache2


# /etc/conf.d/apache2: config file for /etc/init.d/apache2

# When you install a module it is easy to activate or deactivate the modules
# and other features of apache using the APACHE2_OPTS line. Every module should
# install a configuration in /etc/apache2/modules.d. In that file will be an
# <IfDefine NNN> where NNN is the option to enable that module.
# Here are the options available in the default configuration:
#
# CACHE Enables mod_cache
# MEM_CACHE Enables default configuration mod_mem_cache
# DAV Enables mod_dav
# DEFAULT_VHOST Enables name-based virtual hosts, with the default
# virtual host being in /var/www/localhost/htdocs
# ERRORDOCS Enables default error documents for many languages.
# INFO Enables mod_info, a useful module for debugging
# LANGUAGE Enables content-negotiation based on language and charset.
# LDAP Enables mod_ldap (available if USE=ldap)
# AUTH_LDAP Enables authentication through mod_ldap (available if USE=ldap)
# MANUAL Enables /manual/ to be the apache manual (available if USE=docs)
# PROXY Enables mod_proxy
# SSL Enables SSL (available if USE=ssl)
# SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable this
# when you enable SSL unless you know what you are doing)
# SUEXEC Enables running CGI scripts (in USERDIR) through suexec.
# USERDIR Enables /~username mapping to /home/username/public_html
#
# Warning: You need one of DEFAULT_VHOST or SSL_DEFAULT_VHOST, otherwise apache
# will not listen for incomming connections on any port.
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC SVN_AUTHZ AUTH_PAM"

# Extended options for advanced uses of Apache ONLY
# You don't need to edit these unless you are doing crazy Apache stuff
# As not having them set correctly, or feeding in an incorrect configuration
# via them will result in Apache failing to start
# YOU HAVE BEEN WARNED.

# ServerRoot setting
#SERVERROOT=/usr/lib/apache2

# Configuration file location
# - If this does NOT start with a '/', then it is treated relative to
# $SERVERROOT by Apache
#CONFIGFILE=/etc/apache2/httpd.conf

# Location to log startup errors to
# They are normally dumped to your terminal.
#STARTUPERRORLOG="/var/log/apache2/startuperror.log"

# A command that outputs a formatted text version of the HTML at the URL
# of the command line. Designed for lynx, however other programs may work.
#LYNX="lynx -dump"

# The URL to your server's mod_status status page.
# Required for status and fullstatus
#STATUSURL="http://localhost/server-status"

# Method to use when reloading the server
# Valid options are 'restart' and 'graceful'
# See http://httpd.apache.org/docs/2.2/stopping.html for information on
# what they do and how they differ.
#RELOAD_TYPE="graceful"
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Fri Sep 14, 2007 1:13 am    Post subject: Reply with quote

Well... this is wrong:
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC SVN_AUTHZ AUTH_PAM"
It should be:
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC -D SVN_AUTHZ -D AUTH_PAM"


Try changing it and tell us if this worked?


// SteveB
Back to top
View user's profile Send private message
cyclocross
n00b
n00b


Joined: 05 Sep 2003
Posts: 55
Location: Minneapolis USA

PostPosted: Fri Sep 14, 2007 1:22 am    Post subject: Reply with quote

Changed it, but same error. :cry:

# /etc/conf.d/apache2: config file for /etc/init.d/apache2

# When you install a module it is easy to activate or deactivate the modules
# and other features of apache using the APACHE2_OPTS line. Every module should
# install a configuration in /etc/apache2/modules.d. In that file will be an
# <IfDefine NNN> where NNN is the option to enable that module.
# Here are the options available in the default configuration:
#
# CACHE Enables mod_cache
# MEM_CACHE Enables default configuration mod_mem_cache
# DAV Enables mod_dav
# DEFAULT_VHOST Enables name-based virtual hosts, with the default
# virtual host being in /var/www/localhost/htdocs
# ERRORDOCS Enables default error documents for many languages.
# INFO Enables mod_info, a useful module for debugging
# LANGUAGE Enables content-negotiation based on language and charset.
# LDAP Enables mod_ldap (available if USE=ldap)
# AUTH_LDAP Enables authentication through mod_ldap (available if USE=ldap)
# MANUAL Enables /manual/ to be the apache manual (available if USE=docs)
# PROXY Enables mod_proxy
# SSL Enables SSL (available if USE=ssl)
# SSL_DEFAULT_VHOST Enables default vhost for SSL (you should enable this
# when you enable SSL unless you know what you are doing)
# SUEXEC Enables running CGI scripts (in USERDIR) through suexec.
# USERDIR Enables /~username mapping to /home/username/public_html
#
# Warning: You need one of DEFAULT_VHOST or SSL_DEFAULT_VHOST, otherwise apache
# will not listen for incomming connections on any port.
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC SVN_AUTHZ -D AUTH_PAM"
# Extended options for advanced uses of Apache ONLY
# You don't need to edit these unless you are doing crazy Apache stuff
# As not having them set correctly, or feeding in an incorrect configuration
# via them will result in Apache failing to start
# YOU HAVE BEEN WARNED.

# ServerRoot setting
#SERVERROOT=/usr/lib/apache2

# Configuration file location
# - If this does NOT start with a '/', then it is treated relative to
# $SERVERROOT by Apache
#CONFIGFILE=/etc/apache2/httpd.conf

# Location to log startup errors to
# They are normally dumped to your terminal.
#STARTUPERRORLOG="/var/log/apache2/startuperror.log"

# A command that outputs a formatted text version of the HTML at the URL
# of the command line. Designed for lynx, however other programs may work.
#LYNX="lynx -dump"

# The URL to your server's mod_status status page.
# Required for status and fullstatus
#STATUSURL="http://localhost/server-status"

# Method to use when reloading the server
# Valid options are 'restart' and 'graceful'
# See http://httpd.apache.org/docs/2.2/stopping.html for information on
# what they do and how they differ.
#RELOAD_TYPE="graceful"
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Fri Sep 14, 2007 1:43 am    Post subject: Reply with quote

NO! You did not! At least not all. This is still wrong:
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC SVN_AUTHZ -D AUTH_PAM"


See that SVN_AUTHZ? Please add an -D infront of it! The full corrected line should be:
Code:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D LANGUAGE -D SSL -D SSL_DEFAULT_VHOST -D SUEXEC -D SVN_AUTHZ -D AUTH_PAM"


// SteveB
Back to top
View user's profile Send private message
cyclocross
n00b
n00b


Joined: 05 Sep 2003
Posts: 55
Location: Minneapolis USA

PostPosted: Fri Sep 14, 2007 2:01 am    Post subject: Reply with quote

Thanks SteveB!!! :D nice catch on the APACHE2_OPTS.
Back to top
View user's profile Send private message
steveb
Advocate
Advocate


Joined: 18 Sep 2002
Posts: 4564

PostPosted: Fri Sep 14, 2007 2:03 am    Post subject: Reply with quote

:D
Back to top
View user's profile Send private message
DancesWithWords
Guru
Guru


Joined: 29 Jun 2002
Posts: 347
Location: ottawa, canada

PostPosted: Tue Dec 04, 2007 2:58 am    Post subject: Vhost or Not to Vhost Reply with quote

steveb wrote:
:D


Steve got a question for you. I've slowly address all the problems I've had with my computer, which finally resulted in a complete install. However I run into a question. I never used vhost in my old installation is it necessary in apache 2.2.6? If not how and where to I put my old setting to get my system up and running. I've just finish a fresh clean install of Apache with no changes. In my old http.conf I had permission/restriction for apache and ServerName mywebsite.com. Where in the new config files do I put that? My inclination was to put it in httpd.conf.

--
bruce
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum