Page 1 of 1

Nginx And HTTPD wont start

Posted: Fri Nov 20, 2015 12:12 pm
by pwmotp
I am running centos 6.This morning i deleted a user using

Code: Select all

useradd -m username -s /sbin/nologin
little did i know i messed up with something,Now httpd and nginx cannot start at the sametime - one has to be off for another to work - and this way i am getting 502 error bad gateway.

Wheni attempt to start httpd i get:

Code: Select all

[Fri Nov 20 15:06:30 2015] [warn] NameVirtualHost SERVER_IP:443 has no Virtual                                                                                        Hosts
(98)Address already in use: make_sock: could not bind to address [::]:80
(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
my SERVER_IP.conf from

Code: Select all

/etc/httpd/conf.d
contains:

Code: Select all

NameVirtualHost SERVER_IP:80
Listen SERVER_IP:80
NameVirtualHost SERVER_IP:443
Listen SERVER_IP:443
my VESTA.conf from

Code: Select all

/usr/local/vesta/conf
contains:

Code: Select all

WEB_SYSTEM='httpd'
WEB_RGROUPS='apache'
WEB_PORT='80'
WEB_SSL='mod_ssl'
WEB_SSL_PORT='433'
FTP_SYSTEM='vsftpd'
MAIL_SYSTEM='exim'
IMAP_SYSTEM='dovecot'
DB_SYSTEM='mysql'
DNS_SYSTEM='named'
STATS_SYSTEM='webalizer,awstats'
BACKUP_SYSTEM='local'
CRON_SYSTEM='crond'
DISK_QUOTA='no'
FIREWALL_SYSTEM='iptables'
FIREWALL_EXTENSION='fail2ban'
REPOSITORY='cmmnt'
VERSION='0.9.8'
LANGUAGE='en'
How do i fix this,if it is fixable

Re: Nginx And HTTPD wont start

Posted: Thu Jan 07, 2016 7:29 am
by BBuchanan1013
pwmotp wrote:I am running centos 6.This morning i deleted a user using

Code: Select all

useradd -m username -s /sbin/nologin
little did i know i messed up with something,Now httpd and nginx cannot start at the sametime - one has to be off for another to work - and this way i am getting 502 error bad gateway.

Wheni attempt to start httpd i get:

Code: Select all

[Fri Nov 20 15:06:30 2015] [warn] NameVirtualHost SERVER_IP:443 has no Virtual                                                                                        Hosts
(98)Address already in use: make_sock: could not bind to address [::]:80
(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
my SERVER_IP.conf from

Code: Select all

/etc/httpd/conf.d
contains:

Code: Select all

NameVirtualHost SERVER_IP:80
Listen SERVER_IP:80
NameVirtualHost SERVER_IP:443
Listen SERVER_IP:443
my VESTA.conf from

Code: Select all

/usr/local/vesta/conf
contains:

Code: Select all

WEB_SYSTEM='httpd'
WEB_RGROUPS='apache'
WEB_PORT='80'
WEB_SSL='mod_ssl'
WEB_SSL_PORT='433'
FTP_SYSTEM='vsftpd'
MAIL_SYSTEM='exim'
IMAP_SYSTEM='dovecot'
DB_SYSTEM='mysql'
DNS_SYSTEM='named'
STATS_SYSTEM='webalizer,awstats'
BACKUP_SYSTEM='local'
CRON_SYSTEM='crond'
DISK_QUOTA='no'
FIREWALL_SYSTEM='iptables'
FIREWALL_EXTENSION='fail2ban'
REPOSITORY='cmmnt'
VERSION='0.9.8'
LANGUAGE='en'
How do i fix this,if it is fixable
check what's listed in:

Code: Select all

/usr/local/vesta/nginx/conf/nginx.conf
right around line 80:

Code: Select all

listen          8083;
if that's set to 80 as well, instead of 8083, then there's your problem.

Re: Nginx And HTTPD wont start

Posted: Thu Jan 07, 2016 8:22 am
by tjebbeke
I suspect that your server is not configured to use Apache + Nginx. I see no reference to Nginx in your vesta config.

Vesta.conf with nginx reference:

Code: Select all

WEB_SYSTEM='httpd'
WEB_RGROUPS='apache' 
WEB_PORT='8080' 
WEB_SSL='mod_ssl'
WEB_SSL_PORT='8443'
PROXY_SYSTEM='nginx'
PROXY_PORT='80'
PROXY_SSL_PORT='443'