Facing a service start with Apache in centos 6.5 and unable to start services

HI All,

I am facing problem with Apache service -

check some below command result

tcp 0 0 :::80 :::* LISTEN 5865/httpd

killall -9 httpd

cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.234.157 www.department1.com department1
192.168.234.157 www.department2.com department2
192.168.234.157 ram.yogesh.com

hostname

ram.yogesh.com

./apachectl start
AH00548: NameVirtualHost has no effect and will be removed in the next release /u sr/local/apache/conf/httpd.conf:524

Here - line number 524 :-

*NameVirtualHost :80

line : 54 -> Listen 80
###############
Anounmusly this error get when i start the service :smile:
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80 (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down AH00015:

Listen is supposed to be an ip address, you either have to pick an ip address or use * for everyone.

sorry, disregard my last post, the issue is you have it defined two times, If you comment out Line 54 it should work.

still same -

comment - line 54

#Liten 80
NameVirtualHost *:80 (NameVirtualHost * )

try with alternate also
getting error when i start the service –

NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/httpd.conf:541 ( *NameVirtualHost :80 this line in 541)
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80

here i write below code as well-

Listen 80
NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.department1.com
.
.

<VirtualHost *:80>
ServerName www.department2.com
.
.

It seems some process is running on port 80, before starting apache run lsof -i :80 and check which process is running on port 80, kill that n run apache.

If nothing is running and still you are facing this issue, then make sure that you have mention
Listen directive only once for per unique ip/port.

Dear @rai_nagendra ,

already kill the process and change port and ip assign as well. getting same error.

plz provide the o/p of lsof -i :80 before starting apache and after running apache.

/usr/local/apache/bin/apachectl stop
AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/httpd.conf:541
[root@nisha ~]# lsof -i :80

/usr/local/apache/bin/apachectl start
AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/httpd.conf:541
[root@nisha ~]# lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 12692 root 4u IPv6 52379 0t0 TCP *:http (LISTEN)
httpd 12693 daemon 4u IPv6 52379 0t0 TCP *:http (LISTEN)
httpd 12694 daemon 4u IPv6 52379 0t0 TCP *:http (LISTEN)
httpd 12695 daemon 4u IPv6 52379 0t0 TCP *:http (LISTEN)

Note : ( Line 541 )
NameVirtualHost *:80

As per lsof o/p apache is running, just comment out NameVirtualHost directive to remove above mentioned error.