LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   starting and stopping apache (https://www.linuxquestions.org/questions/linux-newbie-8/starting-and-stopping-apache-832592/)

_007 09-16-2010 10:45 AM

starting and stopping apache
 
Hello everyone,
I am new to LQ and hoping to get some help. I have just installed Ubuntu 10.04 and it works fine. Next, I attempted to install Apache 2.2.16 server on the machine. I was able to get Apache installed but I cant't get it to start. The command I used to get it to start is "apachectl -k start" and got the response "command not found". Then I used the absolute path which is "/home/Administrator/Downloads/apache/bin/apachectl -k start" and got the response"httpd: could not reliably determine ther server's fully qualified domain name, using 127.0.1.1 for ServerName(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening to sockets available, shutting down". Please advise me on what to do. My eyes hurt from looking at the screen for so long trying different options and reading almost all the apache install instructions that exists. Just ready to have it up and running.

_007

AlucardZero 09-16-2010 10:47 AM

Quote:

httpd: could not reliably determine ther server's fully qualified domain name, using 127.0.1.1 for ServerName
Harmless.
Quote:

(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening to sockets available, shutting down
Did you run apachectl as root?

_007 09-16-2010 10:50 AM

Yes, I tried it as root already using the same command "apachectl -k start".

bathory 09-16-2010 11:16 AM

Are you sure there is no other webserver running and listening on port 80?
Run:
Code:

netstat -tanpl|grep 80
to see if that's the case. Then stop the other webserver and run as root:
Code:

/home/Administrator/Downloads/apache/bin/apachectl -k start

_007 09-16-2010 01:15 PM

I ran the netstat -tanpl|grep 80 and the results were:

tcp 1 0 192.168.1.4:57256 91.189.89.31:80 CLOSE_WAIT 1836/gvfsd-http

There are 6 lines like this. Not sure what it means, however, I ran as root and got the message:
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

I didn't install any other servers.

bathory 09-16-2010 01:27 PM

Quote:

There are 6 lines like this. Not sure what it means, however, I ran as root and got the message:
This is your browser visiting other webservers.

Quote:

Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
This is not an error as AlucardZero already pointed out. You can edit /home/Administrator/Downloads/apache/conf/httpd.conf, search for ServerName and add the name of your box.

Btw, if this is the only warning you see, then apache should have started. Try http://localhost and see if you get the default apache page.
If not, check /home/Administrator/Downloads/apache/logs/error_log to see if you find the reason

_007 09-16-2010 01:38 PM

You are THE MAN! I didn't have to edit /home/Administrator/Downloads/apache/conf/httpd.conf. I typed in http://localhost and the "It works!" page came up. Thanks alot. By the way, for future reference for me, what do you mean when you say "add the name of my box"?

bathory 09-16-2010 01:46 PM

Your box should have a name. Check /etc/hosts and you'll see among others something like:
Code:

192.168.1.4 host.domain.com host
You can use that "host.domain.com" for the ServerName directive in httpd.conf, so apache stops compaining.

Regards


All times are GMT -5. The time now is 05:39 AM.