Apache doesn't work on port diffrent than standart on Centos 7/OpenVZ container
1
vote
0
answers
106
views
I tried to change the default Apache port on the Centos 7 OpenVZ container, but it just didn't work.
curl **.**.**.**:8080 curl: (7) Failed to connect to **.**.**.** port 8080: No route to host
But it works correctly with the standard port:
$ curl -I **.**.**.**
HTTP/1.1 403 Forbidden
Date: Wed, 01 May 2019 01:06:31 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Thu, 16 Oct 2014 13:20:58 GMT
ETag: "1321-5058a1e728280"
Accept-Ranges: bytes
Content-Length: 4897
Content-Type: text/html; charset=UTF-8
At first I thought it was related to the SELinux policy, but as I read further, SELinux does not work on OpenVZ - Openvz_SELinux .
When I tried to change the port to Centos 7 KVM VM, it worked flawlessly (the necessary rules were created for SELinux):
$ curl -I **.**.**.**:8080
HTTP/1.1 403 Forbidden
Date: Wed, 01 May 2019 01:09:51 GMT
Server: Apache/2.4.6 (CentOS)
Last-Modified: Thu, 16 Oct 2014 13:20:58 GMT
ETag: "1321-5058a1e728280"
Accept-Ranges: bytes
Content-Length: 4897
Content-Type: text/html; charset=UTF-8
After that I changed the OS on the OpenVZ container to Ubuntu 18.04. It works correctly.
$ curl -I **.**.**.**:8080
HTTP/1.1 200 OK
Date: Wed, 01 May 2019 01:19:57 GMT
Server: Apache/2.4.29 (Ubuntu)
Last-Modified: Fri, 12 Apr 2019 08:09:12 GMT
ETag: "2aa6-58650d16807ed"
Accept-Ranges: bytes
Content-Length: 10918
Vary: Accept-Encoding
Content-Type: text/html
Any suggestions on this case?
P.S. Firewalld, iptables and ufw are disabled on all VPS.
Asked by fisherman_bob
(11 rep)
May 1, 2019, 01:30 AM