PHP Versions

Hello I have installed second version of PHP 5.4.16 on Virtualmin PRO / CentOS 6.x by this official instruction here: https://www.virtualmin.com/documentation/web/multiplephp

I change PHP version to 5.4.16 for the domain, after checking version is still the same 5.3.3 what can cause this issue, I have playing around 5 time to install Webmin + Virtualmin PRO on clean CentOS 6, but result is the same, but PHP versions can not be changed for domain/s.

What about SELinux ? Maybe or no ? ;) Little help, please Thanks in advance

Status: 
Active

Comments

Hey, the problem is not in the PHP Versions, but the problem is in the Apache VirtualHost + NameVirtualHost configuration, server pointing to /var/www/html because some how in httpd.conf in "section" have added IP some how, now I have to find out why & how IP come from...

Howdy -- you may be seeing a variant of this issue here:

https://www.virtualmin.com/documentation/web/troubleshooting#The_Wrong_S...

We recommend that all Virtual Hosts in the Apache config have a format such as this one:

<virtualhost x.x.x.x:80>

That "x.x.x.x" would be your server's primary IP address, which is often associated with the "eth0"interface.

If your server is behind a NAT router, that would be the internal IP, not the external IP.

If the above guide doesn't help clarify things, let us know what the output of this command is:

grep -i '<virtualhost' /etc/httpd/conf/httpd.conf

And we'll help sort out what's going on there.

Hi Thank you for the reply Here is configuration from "re-check configuration"

Using network interface eth0 for virtual IPs.

Default IPv4 address for virtual servers is x.x.x.x.x (external IP).

Default IP address is set to x.x.x.x (same external IP), which matches the detected external address. When added new virtual server, that site pointing to /var/www/html with default configuration But when i change configuration to virtual hosts start working fine... Server is behind router with open ports (standard) grep -i '<virtualhost' /etc/httpd/conf/httpd.conf --->>> working with this configuration

When I change Virtualmin configuration to IP behind router, I have new surprise:

"Default IPv4 address for virtual servers is 192.168.1.35.

Default IP address is set to 192.168.1.35, but the detected external address is actually 89.x.x.x. This is typically the result of being behind a NAT firewall, and should be corrected on the module configuration page."

If your server is behind a NAT router, what you would want to do is go into System Settings -> Virtualmin Config -> Network Settings, and there, set the following --

Option "Network interface for virtual addresses" set to "eth0" (or whatever your public facing network interface is).

Option "Default virtual server IPv4 address" set to "From Network Interface" (which will cause it to use eth0).

And lastly, option "Default IP address for DNS records" set to "Automatically detect external address".

That will ensure that Apache is set to use the internal IP addresses of your server, but that DNS records are added with the correct external IP address.

OK, done This setting have resolved my issue:

Option "Network interface for virtual addresses" set to "eth0" (or whatever your public facing network interface is).

Option "Default virtual server IPv4 address" set to "From Network Interface" (which will cause it to use eth0).

And lastly, option "Default IP address for DNS records" set to "Other Address" - I have added my external shared static IP.

That will ensure that Apache is set to use the internal IP addresses of your server, but that DNS records are added with the correct external IP address.

And last thing - I have changed NameVirtualHost *:80 in httpd.conf

Thank you for help ;)

That's fantastic, I'm glad it's working for you now!

Feel free to let us know if you have any other questions.