View previous topic :: View next topic |
Author |
Message |
petterg Guru
Joined: 25 Mar 2004 Posts: 500 Location: Oslo, Norway
|
Posted: Fri Apr 22, 2005 4:37 pm Post subject: [solved] Apache fail to start |
|
|
I've just installed gentoo on a new pc. I followed the gentoo handbook instalation guide.
Then I did "emerge mysql apache php mod_php"
Did the following change in apache2.conf:
Code: |
ServerName hostname.mydomain.net
|
and the following change to commonapache2.conf
Code: |
ServerAdmin me@mydomain.net
UseCanonicalName Off
LanguagePriority no en fr de
|
Everything else was left at default values.
Then when I try "/etc/init.d/apache2 start" I get
Code: | Starting apache [!!] |
Exit code is 1
No error messages in any log.
So I enabled the STARTUPERRORLOG in /etc/conf.d/apache2.
The only thing showing up in the logfile is "Syntax OK"
Any idea how to debug this?
I also tried to copy config files from my other pc running - that didn't change anything.
Last edited by petterg on Sun Apr 24, 2005 12:28 pm; edited 1 time in total |
|
Back to top |
|
|
mjbjr Guru
Joined: 02 Mar 2003 Posts: 301
|
Posted: Fri Apr 22, 2005 6:04 pm Post subject: Re: Apache fail to start |
|
|
petterg wrote: | I've just installed gentoo on a new pc. I followed the gentoo handbook instalation guide.
Then I did "emerge mysql apache php mod_php"
Did the following change in apache2.conf:
Code: |
ServerName hostname.mydomain.net
|
and the following change to commonapache2.conf
Code: |
ServerAdmin me@mydomain.net
UseCanonicalName Off
LanguagePriority no en fr de
|
Everything else was left at default values.
Then when I try "/etc/init.d/apache2 start" I get
Code: | Starting apache [!!] |
Exit code is 1
No error messages in any log.
So I enabled the STARTUPERRORLOG in /etc/conf.d/apache2.
The only thing showing up in the logfile is "Syntax OK"
Any idea how to debug this?
I also tried to copy config files from my other pc running - that didn't change anything. |
Well, since this is a new gentoo install... is everything else working OK?
Are you sure apache isn't running? If it's not running,
'ps aux | grep apache'
should just return
grep apache
Possibly, php/mod_php have screwed things up (?). If someone doesn't give a more definitive answer,
I'd unmerge the php stuff, though there's no guarantee that _that_ will be clean.
Personally, I'd never do a bulk emerge, especially for bigger more complicated server products like a db and
a web server.
While there are clues in your post that suggest you're not a noob, I'll throw in the following info from my
apache2 notes file, in case they may help:
apache startup - /usr/sbin/apache2ctl start/stop
graceful ways:
apachectl -k stop (kills children first, then httpd)
apachectl -k graceful << restart, kill children then httpd, then restarts
apachectl -k restart << restart, kill children doesn't kill httpd
epm -ql apache | less
*************************
2004.10.20
emerge, to fresh gentoo build, net-www/apache-2.0.52
/usr/sbin/apache2ctl (-k) start/stop
/etc/apache2/conf/apache2.conf - server-specific directives
/etc/apache2/conf/commonapache2.conf - directives that apply to all implementations
/etc/apache2/conf/mime.types
/etc/conf.d/apache2
/etc/init.d/apache2
/var/www/localhost/htdocs/index.html.en - default local web page
/var/www/localhost/icons/
/var/www/localhost/cgi-bin/printenv
/var/www/localhost/cgi-bin/test-cgi
/usr/lib/apache2/extramodules >> links to >> /usr/lib/apache2-extramodules
/usr/lib/apache2/conf >> links to >> /etc/apache2/conf
/usr/lib/apache2/logs >> links to >> /var/log/apache2
.
. |
|
Back to top |
|
|
Ghent99 n00b
Joined: 21 Apr 2005 Posts: 39 Location: Chicago, IL, USA
|
Posted: Fri Apr 22, 2005 6:12 pm Post subject: |
|
|
I've never used distro supplied webserver, (I always build my own) so forgive me if this suggestion isn't helpful:
Have you check the various system logs in /var/log for any entries during startup? If we can at least find something wrong we can find out how to correct it. _________________ - Ghent |
|
Back to top |
|
|
petterg Guru
Joined: 25 Mar 2004 Posts: 500 Location: Oslo, Norway
|
Posted: Sat Apr 23, 2005 10:55 am Post subject: |
|
|
ps aux shows that apache is not running.
I unemerged apache and mod_php. Deleted config files, and reemerged apache.
Still having the same problem.
There isn't very much else installed on the system. It's bootstarped, emerge sync, emerge system, emerge mysql apache php mod_php.
I haven't found anything else not working. |
|
Back to top |
|
|
C:\format C: n00b
Joined: 30 Jan 2005 Posts: 10 Location: USA
|
Posted: Sun Apr 24, 2005 2:58 am Post subject: |
|
|
Man, I'm having the same problem. I pretty much did what you did.
Code: | USE="apache2 mysql pam ssl xml xml2 php" emerge mysql apache php mod_php |
When I first encountered it I tried starting MySQL, which I was able to do. Then starting Apache didn't work. Same thing
Code: | # /etc/init.d/apache2 start
* Starting apache2... [ !! ] |
I've just been messing around with the config files. That's about all I can do (as I'm not an Apache developer nor do I maintain the apache2 package.
Do you think it's a bug?
If anybody else installed Apache2 the same way and has it working, maybe we could compare config files.
Note that I am also using the latest Gentoo upgrade 2005.0. I don't know if that has anything to do with it. Here's my emerge info:
Code: | # emerge --info
Portage 2.0.51.19 (default-linux/x86/2005.0, gcc-3.3.5-20050130, glibc-2.3.4.20041102-r1, 2.6.11-gentoo-r6 i686)
=================================================================
System uname: 2.6.11-gentoo-r6 i686 AMD Athlon(tm) XP 2200+
Gentoo Base System version 1.4.16
Python: dev-lang/python-2.3.4-r1 [2.3.4 (#1, Apr 17 2005, 03:51:40)]
dev-lang/python: 2.3.4-r1
sys-devel/autoconf: 2.13, 2.59-r6
sys-devel/automake: 1.5, 1.8.5-r3, 1.6.3, 1.7.9-r1, 1.4_p6, 1.9.4
sys-devel/binutils: 2.15.92.0.2-r7
sys-devel/libtool: 1.5.14
virtual/os-headers: 2.6.8.1-r2
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3.3/env /usr/kde/3.3/share/config /usr/kde/3.3/shutdown /usr/kde/3/share/config /usr/lib/X11/xkb /usr/share/config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs autoconfig ccache distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://mirrors.acm.cs.rpi.edu/gentoo/"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 X alsa apm arts avi berkdb bitmap-fonts cdr crypt cups curl dvd emboss encode esd fam foomaticdb fortran gd gdbm gif gpm gtk2 imagemagick imlib ipv6 jpeg kde libg++ libwww mad mikmod motif mp3 mpeg mysql ncurses nls nvidia ogg oggvorbis opengl oss pam pdflib perl png python qt quicktime readline samba sdl spell ssl svga tcpd tetex tiff truetype truetype-fonts type1-fonts vorbis xml2 xmms xv zlib"
Unset: ASFLAGS, CBUILD, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS |
_________________ "I like women. I don't understand them, but I like them."
-- Sean Connery |
|
Back to top |
|
|
C:\format C: n00b
Joined: 30 Jan 2005 Posts: 10 Location: USA
|
Posted: Sun Apr 24, 2005 3:35 am Post subject: Fixed it! |
|
|
HOLY CROW, I FIXED IT!
I was able to figure it out doing
Code: | # cat /var/log/apache2/error_log
[Sat Apr 23 00:31:44 2005] [alert] (EAI 2)Name or service not known: mod_unique_id: unable to find IPv4 address of "oxy"
Configuration Failed |
oxy is my hostname. So I added
to /etc/hosts and IT WORKED:
Code: | # /etc/init.d/apache2 start
* Starting apache2... [ ok ] |
What a stupid reason to not have a webserver to work! I feel like a moron for not having my own hostname in /etc/hosts in the first place, but I'm so happy to have a webserver now!
WHOO HOO!!!
Hope that fixes yours too, petterg.
-- the dudeman _________________ "I like women. I don't understand them, but I like them."
-- Sean Connery |
|
Back to top |
|
|
petterg Guru
Joined: 25 Mar 2004 Posts: 500 Location: Oslo, Norway
|
Posted: Sun Apr 24, 2005 12:27 pm Post subject: |
|
|
oh. urg!
That was it!
(I had my hostname in the hosts file - just didn't spell it right!)
Thanks a lot!
(Btw, how did you get that error message?) |
|
Back to top |
|
|
C:\format C: n00b
Joined: 30 Jan 2005 Posts: 10 Location: USA
|
Posted: Sun Apr 24, 2005 2:39 pm Post subject: |
|
|
I have the entry
ErrorLog logs/error_log
LogLevel warn
in my apache2.conf file. I'm assuming that tells Apache to generate the error messages I saw. Those were the default settings. I don't know why yours would not have given any error messages if you had the same settings.
Well, next step is to play around with all the stuff in the config files that I had been looking at for hours trying to diagnose this thing
-- the dudeman _________________ "I like women. I don't understand them, but I like them."
-- Sean Connery |
|
Back to top |
|
|
|
|
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
|
|