Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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:
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.
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:
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.
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?
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.
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.
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.
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
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.