LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Changing Listen port(s) on Apache2 on CentOS 7 (https://www.linuxquestions.org/questions/linux-server-73/changing-listen-port-s-on-apache2-on-centos-7-a-4175594018/)

Turbocapitalist 11-22-2016 03:50 AM

Changing Listen port(s) on Apache2 on CentOS 7
 
This is regarding Apache2 on CentOS 7.

What must be changed outside of Apache's own configuration so that Apache2 can listen on a port other than 80 or 443?

systemd gives this information about the symptoms:

Code:

Nov 22 11:34:08 localhost.localdomain httpd[29752]: (13)Permission denied: AH00072: make_sock: could not bind to address [::]:7780
Nov 22 11:34:08 localhost.localdomain httpd[29752]: (13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:7780
Nov 22 11:34:08 localhost.localdomain httpd[29752]: no listening sockets available, shutting down

What is the cause, SELinux maybe?

I've done a lot of searching and found only wrong and outdated information about the new extra configurations that must be done.

bathory 11-22-2016 05:29 AM

Hi,

Most likely SELinux.
Did you try?
Code:

semanage port -a -t http_port_t -p tcp 7780

Turbocapitalist 11-22-2016 05:35 AM

Thanks. I did try that already. The program "semanage" is not part of the base installation for CentOS 7 and "yum" seems unable to tell me if it is part of any available packages. I've added the EPEL repository.

(I rarely even dabble with CentOS so it is quite unfamiliar.)

bathory 11-22-2016 05:44 AM

Quote:

Originally Posted by Turbocapitalist (Post 5633314)
Thanks. I did try that already. The program "semanage" is not part of the base installation for CentOS 7 and "yum" seems unable to tell me if it is part of any available packages. I've added the EPEL repository.

(I rarely even dabble with CentOS so it is quite unfamiliar.)

Then according to to this, you should run:
Code:

yum install policycoreutils-python

Turbocapitalist 11-22-2016 05:53 AM

Thanks. That did it.

Code:

yum install policycoreutils-python
semanage port -a -t http_port_t -p tcp 7780

And I can move forward, but for one question:


I realize that Red Hat's business model is to pile complexity after complexity onto the distro, but is there another way to find the right package name beside choosing random blogs and hoping they are right? I can't figure out a way for the package policycoreutils-python to turn up in any "yum" searches for "semanage"


Edit: yum provides semanage


All times are GMT -5. The time now is 08:33 PM.