LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-23-2004, 01:14 AM   #1
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Rep: Reputation: 30
problems starting apache


I decided to start messing around with apache tonight and having read some of the docs on www.apache.org I download the apache2-common debain package via apt. I then read through the whole httpd.conf file and edit it accordingly. Then I want to actually test my server but realize apache isn't started. So I try to start apache and get this error message:
Code:
[06:17 root@atheisticfaith anti]$ /usr/sbin/apache2ctl start
/usr/sbin/apache2ctl: line 79: /usr/sbin/apache2: No such file or directory
What do I have to do? And how can I make it start up on boot?

Thanks.
 
Old 05-23-2004, 12:51 PM   #2
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
Still no closer to the solution of any of this so... *bump*.
 
Old 05-23-2004, 01:59 PM   #3
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
I seem to be missing the http daemon. I thought that was supposed to come with apache2?
Anyways. I tried installing httpd via apt and got this:
Code:
Package httpd is a virtual package provided by:
  thy 0.9.0-1
  thttpd 2.23beta1-2.3
  roxen3 3.3.63-6
  mzscheme 1:207-2
  mathopd 1.5p3-2
  fnord 1.8-2
  dhttpd 1.02a-8
  caudium 2:1.2.33-2
  bozohttpd 20030313-1
  boa 0.94.13-5
  apache2-mpm-worker 2.0.49-1
  apache2-mpm-threadpool 2.0.49-1
  apache2-mpm-prefork 2.0.49-1
  apache2-mpm-perchild 2.0.49-1
  apache-ssl 1.3.29.0.2-7
  apache-perl 1.3.29.0.2-7
  apache 1.3.29.0.2-7
  aolserver4 4.0.1-6
  aolserver 3.5.6-4
You should explicitly select one to install.
So I decided to install apache2-mpm-threadpoll. It didn't install httpd when I did. And I'm still without an http daemon. Any suggestions?
 
Old 05-23-2004, 02:05 PM   #4
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Rep: Reputation: 30
Try running "locate httpd" and see what the results are. This should give you the exact location of the httpd server. If it isn't found, try getting the packages from the apache website and install them that way.
 
Old 05-23-2004, 04:20 PM   #5
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
Thanks for your reply.
I tried locating httpd but didn't find it so I downloaded the source from apache.org and installed it. I thought this would just give me the same problem but it did. Thanks.

One question though: I thought, after some reading, that apache relied on httpd.conf? Now I'm being asked for an apache2.conf file in my apache directory when I try to start apache. It didn't exist there so I did a locate on it and found it /usr/share/doc/apache2/examples. The file looks very similiar to my httpd.conf file... but still different. I guess I'll just go through another ~1000 lines trying to configure apache.
 
Old 05-23-2004, 05:33 PM   #6
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
OK. So I did that. And started apache by running "/usr/sbin/apache2ctl start" as root and got no errors. I then tried connecting to my IP and asked a friend to do it but it wouldn't show anything. So I run ps -Al to check if it isn't running and all I see is this:
Code:
[22:33 root@atheisticfaith anti]$ ps -Al
F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
4 S     0     1     0  0  76   0 -   382 schedu ?        00:00:04 init
1 S     0     2     1  0  94  19 -     0 ksofti ?        00:00:00 ksoftirqd/0
1 S     0     3     1  0  65 -10 -     0 worker ?        00:00:00 events/0
1 S     0     4     3  0  65 -10 -     0 worker ?        00:00:00 kblockd/0
1 S     0     5     3  0  80   0 -     0 pdflus ?        00:00:00 pdflush
1 S     0     6     3  0  75   0 -     0 pdflus ?        00:00:00 pdflush
1 S     0     8     3  0  70 -10 -     0 worker ?        00:00:00 aio/0
1 S     0     7     1  0  85   0 -     0 kswapd ?        00:00:00 kswapd0
1 S     0     9     1  0  81   0 -     0 serio_ ?        00:00:00 kseriod
1 S     0    10     1  0  75   0 -     0 kjourn ?        00:00:00 kjournald
1 S     0   128     1  0  75   0 -     0 kjourn ?        00:00:00 kjournald
1 S     0   129     1  0  78   0 -     0 kjourn ?        00:00:00 kjournald
5 S     0   242     1  0  76   0 -   396 schedu ?        00:00:00 syslogd
5 S     0   247     1  0  76   0 -   570 syslog ?        00:00:00 klogd
5 S     0   258     1  0  78   0 -   391 schedu ?        00:00:00 inetd
5 S     0   286     1  0  76   0 -  1415 schedu ?        00:00:00 nmbd
5 S     0   288     1  0  78   0 -  2043 schedu ?        00:00:00 smbd
5 S     0   294     1  0  75   0 -   856 schedu ?        00:00:00 sshd
5 S     0   303     1  0  76   0 -  1168 schedu ?        00:00:00 xfs
5 S     0   375     1  0  77   0 -   684 wait4  ?        00:00:00 bash
5 S     0   376   375  0  81   0 -   684 wait4  ?        00:00:00 bash
4 S     0   377   376  0  75   0 -  2244 schedu ?        00:00:00 Xprt
1 S     0   378   375  0  77   0 -   684 pipe_w ?        00:00:00 bash
1 S     1   471     1  0  76   0 -   429 schedu ?        00:00:00 atd
5 S     0   474     1  0  76   0 -   449 schedu ?        00:00:00 cron
4 S  1000   482     1  0  77   0 -   662 wait4  tty1     00:00:00 bash
4 S     0   483     1  0  77   0 -   382 schedu tty2     00:00:00 getty
4 S     0   484     1  0  76   0 -   382 schedu tty3     00:00:00 getty
4 S     0   485     1  0  76   0 -   382 schedu tty4     00:00:00 getty
4 S     0   486     1  0  76   0 -   382 schedu tty5     00:00:00 getty
4 S     0   487     1  0  76   0 -   382 schedu tty6     00:00:00 getty
0 S  1000   490   482  0  78   0 -   578 wait4  tty1     00:00:00 startx
0 S  1000   501   490  0  77   0 -   600 wait4  tty1     00:00:00 xinit
4 S     0   502   501  1  66 -10 - 39018 schedu ?        00:01:10 XFree86
0 S  1000   511   501  0  76   0 -  1291 schedu tty1     00:00:00 fluxbox
0 S  1000   512   511  0  75   0 -   683 schedu tty1     00:00:01 wmnd
0 S  1000   513   511  0  75   0 -   641 schedu tty1     00:00:00 cputnik
0 S  1000   515   511  0  75   0 - 23211 schedu ?        00:00:43 firefox-bin
0 S  1000   557     1  0  75   0 -  1351 schedu ?        00:00:00 gconfd-2
0 S  1000   584     1  0  75   0 - 10184 schedu ?        00:00:02 xmms
0 S  1000   588   511  0  76   0 -   793 schedu ?        00:00:00 aterm
0 S  1000   589   588  0  76   0 -   662 schedu pts/1    00:00:00 bash
0 S  1000   658   511  0  75   0 -   749 schedu ?        00:00:00 rxvt
0 S  1000   659   658  0  75   0 -   810 schedu pts/3    00:00:00 bash
0 S  1000   746     1  0  75   0 -  5866 schedu ?        00:00:01 xchat
0 S  1000   835     1  0  75   0 -  4594 schedu ?        00:00:06 gaim
0 S  1000   843   511  0  75   0 -   826 schedu ?        00:00:00 aterm
0 S  1000   844   843  0  75   0 -   666 wait4  pts/8    00:00:00 bash
4 S     0   856   844  0  75   0 -   811 wait4  pts/8    00:00:00 bash
4 R     0   889   856  0  77   0 -   583 -      pts/8    00:00:00 ps
Why is apache not in there? Do I have to do something else to start up or what?

Thanks for you help.
 
Old 05-23-2004, 09:45 PM   #7
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Rep: Reputation: 30
Well, you can try running netstat -a to see if it's running too, but it doesn't look like it is anyway. Maybe you should try running the actual httpd server directly, without using apache2ctl. You may get an error if you do this, which can help point us in the direction of the problem. Also, aren't you supposed to use "graceful" when starting apache through apachectl?

I remember that when I set up my first apache server, I was getting socket bind errors. If we get an error, hopefully we can get a concrete lock onto what the problem is.
 
Old 05-23-2004, 10:12 PM   #8
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
Inexactitude, thanks for your help.

When I run "netstat -a" it shows no sign of apache or httpd.
Not being exactly sure of how I run the httpd server directly I run "locate httpd" and get only these results:
Code:
[03:09 anti@atheisticfaith anti]$ locate httpd
/usr/share/doc/apache-common/examples/httpd.conf-dist
/usr/share/doc/apache2/examples/httpd-std.conf.gz
/usr/lib/apache2/modules/httpd.exp
/etc/apache2/httpd.conf
Kinda looks like I don't even have httpd... I did compile httpd-2.0.49 from apache.org according to the installation instructions in INSTALL though. Any idea what I'm forgetting/doing wrong?
Oh, and what do you mean by "graceful"?
I'm sounding like a total newbie here, which I am so I guess it's ok...
Again, I appreciate you trying to help me.
 
Old 05-24-2004, 07:56 PM   #9
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
This is turning out to be some phat headache. Anyways. I searched around on apache.org and found no information what so ever as to where I could get httpd it self. I then decide to take the fourth look at the installation instructions that came with apache just to be sure I was setting things up the right way. I found out that nothing had changed since I read them the third time so I was nowhere near the solution of my problem. While in the untarred apache2 directory though I did an ls and noticed an executable named... yeah, you guess it, httpd. I then become root and try running it but get the following output:
Code:
[00:53 root@atheisticfaith httpd-2.0.49]$ httpd 
lt-httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Once again I try to search the docs that came with apache2 for instructions about what to do with the httpd executable but find nothing...
Any ideas? Anyone? Please?
 
Old 05-25-2004, 07:26 PM   #10
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Rep: Reputation: 30
Well, just run make install in the directory where you have the httpd binary, and reconfigure your conf file. You may still get the make sock problem. I've had it before, but I can't remember how I fixed it. I'll look it up and get an answer.
 
Old 05-27-2004, 03:29 PM   #11
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
My only real problem right now seems to be the fact that apache doesn't start any server processes. I have these lines in apache2.conf though:
Code:
<IfModule worker.c>
StartServers         2
MaxClients         150
MinSpareThreads     25
MaxSpareThreads     75
ThreadsPerChild     25
MaxRequestsPerChild  0
</IfModule>
I've been running "/usr/sbin/apache2ctl start" to start apache and it seems to start just fine. It doesn't give any errors when it starts on boot either.
Any idea of what I could do would be greatly appreciated.
 
Old 05-27-2004, 04:00 PM   #12
Inexactitude
Member
 
Registered: Oct 2003
Distribution: Slackware 12.2, Ubuntu 9.04
Posts: 477

Rep: Reputation: 30
This is pretty strange. Maybe you can try running starting httpd with -v or -d to see if that will give you any errors.

I'll do some research on this and see if I can get anything for you.
 
Old 05-27-2004, 05:20 PM   #13
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
Ah. Thanks for your reply. I think we've almost got it. ^^
Here's the output from "httpd -v":
Code:
[22:13 root@atheisticfaith anti]$ httpd -v                           
Server version: Apache/2.0.49
Server built:   May 23 2004 20:04:04
And when I ran "httpd -d" it outputted the help file since it requires an argument to specify the new ServerRoot. I think it's the server root that's causing at least some of these troubles since I installed apache2 in /etc/apache2/ instead of the default /usr/local/apache2/.
I then tried to run "httpd -d /etc/apache/" but got this:
Code:
[22:14 root@atheisticfaith anti]$ httpd -d /etc/apache2/ 
lt-httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
Then I tried pointing httpd to my apache2 conf file with "httpd -f /etc/apache2/apache2.conf" and got this output when listen was set to 0.0.0.0:80 (the default):
Code:
[22:12 root@atheisticfaith anti]$ httpd -f /etc/apache2/apache2.conf 
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
And this when it was set to listen only to port 80 on my router (which by the way is open for tcp and udp):
Code:
httpd -f /etc/apache2/apache2.conf 
(99)Cannot assign requested address: make_sock: could not bind to address 192.168.0.254:80
no listening sockets available, shutting down
Unable to open logs
Which actually is exactly the same (apart from the IPs) which I didn't realize before pasting it here. o_O
Which should I use? 0.0.0.0:80 or 192.168.0.254:80 (my router)?
Another perhaps relevant information: I set my domain name to my IP. Not the local one but the net one. Was that not the right thing to do? I can't really think of anything else that might have cause this.
 
Old 05-27-2004, 06:54 PM   #14
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
atheist

K.I.S Keep It Simple

Apache should run straight out of the box without any modification to httpd.conf, don't suppose you made a backup copy ?

Try this

# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
Listen 80

And server name

# If your host doesn't have a registered DNS name, enter its IP address here.
# You will have to access it by its address anyway, and this will make
# redirections work in a sensible way.
#
ServerName localhost

Now Stop and Restart apache, if there are no errors, open your web browser,
http://localhost:80 should give you the default apache web page

No guarantees but worth a try

Pete
 
Old 05-28-2004, 07:27 AM   #15
atheist
Member
 
Registered: Sep 2003
Location: Iceland
Distribution: Debian Lenny - Kernel 2.6.22.8
Posts: 331

Original Poster
Rep: Reputation: 30
Thanks for trying to help.

Here's the output I get after following your instructions:
Code:
[12:29 root@atheisticfaith anti]$ /usr/sbin/apache2ctl stop
httpd (no pid file) not running
[12:29 root@atheisticfaith anti]$ /usr/sbin/apache2ctl start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
I'm not quite sure what this means. Address already in use and no listening sockets available?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache not starting ilnli Linux - General 1 06-29-2005 05:15 AM
Apache not starting up! vmnrao Linux - General 7 09-06-2004 06:14 PM
Starting Apache mattp Slackware - Installation 5 03-14-2004 10:58 PM
Apache not starting athompso Linux - Software 1 11-15-2002 11:33 PM
Problems starting Apache rverlander Linux - General 3 07-19-2002 03:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration