0

QUESTION

It seems that my php pages are not loading through proxypass set up on my master Apache server. What change do I need to make in order to get php pages to load through my proxypass?

I tried this question on Ask Ubuntu but some suggest I try the question here. This is the exact post from that forum.

Ask Ubuntu Link: https://askubuntu.com/questions/1003434/how-to-install-php-on-ubuntu-server

ORIGINAL POST

This I would imagine is going to be a simple answer. (It wasn't) I have Apache2 running on my Ubuntu server but it seems PHP is not installed. When I try to load a php page it does not load properly.

Example: http://urbanturtles.servegame.com/ (My Site)

At first I thought the php module was simply not loaded but when I try to run sudo a2enmod php but it did not work and I get this error: ERROR: Module php does not exist!

Thanks for help in advance!

EDIT

After trying to load a simple PHP page to show the php version I have gotten a new error trying to load the page. that error is visible here: http://urbanturtles.servegame.com/version.php . This makes me think I have more of an Apache issue than a php issue. I have a main Apahce sever that proxys all incoming traffic to each server inside my network. The Apache config for the main server looks like this:

<VirtualHost *:*>
        ServerName MaxKulik.net
        ServerAdmin max@maxkulik.net
        ProxyPreserveHost On
        ServerName "www.MaxKulik.net"
        ServerAlias "MaxKulik.net"
        ProxyPass / http://192.168.1.5/
        ProxyPassReverse / http://192.168.1.5/
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

<VirtualHost *:*>
        ServerName MaxKulik.net
        ServerAdmin max@maxkulik.net
        ProxyPreserveHost On
        ServerName "www.MaxKulik.net"
        ServerAlias "MaxKulik.net"
        SSLProxyEngine On
        SSLProxyCheckPeerCN on
        SSLProxyCheckPeerExpire on
        ProxyPass / https://192.168.1.5/
        ProxyPassReverse / https://192.168.1.5/
</VirtualHost>

<VirtualHost *:*>
        ServerName USI
        ServerAdmin max@maxkulik.net
        ProxyPreserveHost On
        ServerName "www.UrbanTurtles.servegame.com"
        ServerAlias "UrbanTurtles.servegame.com"
        ProxyPass / http://192.168.1.28/
        ProxyPassReverse / http://192.168.1.28/
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Here is the php error that I was getting: enter image description here

2
  • 1
    The error isn't visible at that link, just a phpinfo(); statement. Please reproduce the error message here, so your question may still be useful later Feb 6 '18 at 10:03
  • I added the php error to the end of the question. I hope that helps!
    – Max Kulik
    Feb 7 '18 at 0:51
2

You can only have one ServerName directive in your VirtualHost. The directive should match the primary FQDN of your site, all other FQDNs should be ServerAlias.

ServerName www.urbanturtles.servegame.com
ServerAlias urbanturtles.servegame.com

Remove the ServerName USI directive, it's not a FQDN.

If you have multiple ServerName directives and Apache decides to use the wrong one your VirualHost will not match.

4
  • 1
    Regarding the PHP setup: That belongs into the config of your Apache on 192.168.1.28. Feb 6 '18 at 6:55
  • Gerald, do you mean that ServerName belongs to the Apache config on the web server that is 192.168.1.28?
    – Max Kulik
    Feb 7 '18 at 0:55
  • And I made the change by getting rid of the ServerName directive and it seems to have no effect.
    – Max Kulik
    Feb 7 '18 at 0:56
  • It seems my php proxy error is no longer persistent but my php pages are still not loading.
    – Max Kulik
    Feb 7 '18 at 2:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.