Control Web Panel

WebPanel => CentOS 6 Problems => Topic started by: Laur on November 11, 2015, 07:36:59 PM

Title: SELinux + Nginx on port 82 = FAIL
Post by: Laur on November 11, 2015, 07:36:59 PM
Hello,

First, i want to thank the staff of CWP, it's a awesome panel, and I will donate soon.

In second row i want to explain what problem I have when I activate SELinux with that configuration:

Code: [Select]
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted


and with WebServer configuration: Apache & Varnish Cache & Nginx Reverse Proxy (Varnish on port 80, Nginx on port 82 and apache on port 8181)

the problem is NGINX can't start because it's on port 82

Code: [Select]
Starting nginx: nginx: [emerg] bind() to 0.0.0.0:82 failed (13: Permission denied)
[FAILED]


Thank you very much.
Title: Re: SELinux + Nginx on port 82 = FAIL
Post by: Igor S. on November 13, 2015, 07:35:17 AM
Hello.

I'm afraid the CWP still does not have support SELinux. We're recommend turn off it if you do not understand how to configure SELinux.
You can check what software exactly use the port:
Code: [Select]
netstat -nlp | grep :82and then to kill the proccess.
Title: Re: SELinux + Nginx on port 82 = FAIL
Post by: cyfocus on November 16, 2015, 04:52:10 PM
Try changing SElinux to permissive

and report back.
Title: Re: SELinux + Nginx on port 82 = FAIL
Post by: Laur on November 18, 2015, 07:52:35 AM
Hello,

I set it on permissive and i can run nginx and others, but i really want to protect my /etc/passwd for read from php, how i put php.ini on every subdomain(virtual host from nginx) ?

EDIT: Done, with: open_base_dir in php.ini at every subdomain and chmod 777 with root so the client can't modify it...
Anyway, i need another metodh.
Thanks.
Title: Re: SELinux + Nginx on port 82 = FAIL
Post by: Igor S. on November 20, 2015, 08:12:24 AM
The CWP don't have SELinux support.