Fix Nginxcp errors in WHM, conflicting server name, Address already in use

Some configurations using nginxcp in whm may see the following errors when starting/restarting WHM:

nginx: [warn] conflicting server name "YOURIPADDRESS" on 66.228.117.248:80, ignored
nginx: [warn] conflicting server name "YOURIPADDRESS" on 66.228.117.248:80, ignored
nginx: [warn] conflicting server name "YOURIPADDRESS" on 66.228.117.248:80, ignored

nginx: [emerg] bind() to YOURIPADDRESS:80 failed (98: Address already in use)
nginx: [emerg] bind() to YOURIPADDRESS:80 failed (98: Address already in use)
nginx: [emerg] bind() to YOURIPADDRESS:80 failed (98: Address already in use)
nginx: [emerg] still could not bind()
already running.

Make these changes to fix it: (in your shell).

cd /etc/nginx/vhosts
perl -pi -w -e 's/server_name(.*) YOURIPADDRESS/server_name$1/g;' *

Replace YOURIPADDRESS with the ip address you see in the errors.

Now go to WHM > Tweak settings and change Apache non-SSL IP/port to 0.0.0.0:8081

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>