Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I currently have other services listening on port 80, and so I've configured apache to listen on port 444 which definitely has no services listening on it.

However, when I attempt to start apache, I receive this error:

(98)Address already in use: make_sock: could not bind to address 127.0.0.1:444

Have also tried (and failed) to bind to 0.0.0.0:444. The error after this is:

Unable to open logs

Can anybody point me in the right direction?

UPDATE:

Regarding user:

# envvars
APACHE_RUN_USER=www-data
APACHE_RUN_GROUP=root

$ groups www-data
www-data : www-data root

$ ls -l /var/log/apache2
total 60
-rw-r----- 1 www-data root     0 May  9 08:02 access.log
..other files, same permissions..

As explained above, there is nothing listening on 444:

netstat -anp | grep 444
udp        0      0 0.0.0.0:57444           0.0.0.0:*                           761/avahi-daemon: r
share|improve this question

migrated from stackoverflow.com Jun 11 '13 at 9:00

This question came from our site for professional and enthusiast programmers.

    
Two things, - since the port is < 1024, you need priviledge user to bind to it. Are you launching Apache as root? You can check what is listening on the port with netstat -anp | grep 444 –  Burhan Khalid Jun 11 '13 at 4:51
    
sounds about right. unable to open th elog files probably means you're trying to run as non-root and apache can't open the root-only default /var/log/... dir+files –  Marc B Jun 11 '13 at 4:52
    
Thanks, I've updated with more information. It appears I'm running as root (user within root group) and there 100% nothing listening on port 444. –  Damien Roche Jun 11 '13 at 5:18
    
Well if you can't access the logs and you can't bind to the port, I wonder if another instance of apache is already running. –  Jason Tan Jun 11 '13 at 18:30

2 Answers 2

try changing port to 4444 or something bigger than 1024 and see if apache can started. You can try delete all log files, except directory. also you can check if log file is not open lsof | grep /var/log/apache2

share|improve this answer

Well if you can't access the logs and you can't bind to the port, I wonder if another instance of apache is already running. Have you run: ps aux|grep httpd after the errors are reported to make sure that there is not another apache instance that is running on the server? I mean something is blocking the same two resources you want - sounds like it might be another copy of what you are running.

Also you could use lsof to see what is using those resources:

lsof |egrep access\.log\|444

Boom!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.