Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've recently moved a PHP project I'm working on to a VM running Apache 2.4.9 from a physical box running Apache 2.2.11. I have setup a VirtualHost for the project similar to what I had on the 2.2 box. I know there are differences between 2.2 and 2.4, which I'm pretty sure I've addressed in my 2.4 Virtualhost config, but I seem to be missing something.

When I point my browser to the URL of my VM for my project VirtualHost (http://project.dev.lan, in this case), all I get it a blank (white) screen. I have another VirtualHost setup for the default Document root and it seems to be working just fine; the page comes up as expected.

Can someone help steer me in the right direction?

apachectl -S returns:

VirtualHost configuration:
*:80                   is a NameVirtualHost
         default server localhost (/usr/local/etc/apache2/extra/httpd-vhosts.conf:40)
         port 80 namevhost localhost (/usr/local/etc/apache2/extra/httpd-vhosts.conf:40)
                 alias 192.168.0.130
         port 80 namevhost project.dev.lan (/usr/local/etc/apache2/extra/httpd-vhosts.conf:46)
                 alias project.dev.vm
ServerRoot: "/usr/local/apache2"
Main DocumentRoot: "/data/www/apache2:80"
Main ErrorLog: "/var/log/apache2/error_log"
Mutex rewrite-map: using_defaults
Mutex proxy: using_defaults
Mutex default: dir="/usr/local/apache2/logs/" mechanism=default 
Mutex mpm-accept: using_defaults
Mutex proxy-balancer-shm: using_defaults
PidFile: "/usr/local/apache2/logs/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="apache2" id=2000
Group: name="www" id=103

My VirtualHost file contains:

<VirtualHost *:80>
        ServerName      localhost
        ServerAlias     192.168.0.130
        DocumentRoot    /data/www/apache2:80
</VirtualHost>

<VirtualHost *:80>
        ServerName      project.dev.lan
        ServerAlias     project.dev.vm
        DocumentRoot    /data/www/project/SRC
        DirectoryIndex  index.php index.html
        ServerAdmin     me@mydomain.com
        ErrorLog        /var/log/apache2/project.dev.lan-error_log
        CustomLog       /var/log/apache2/project.dev.lan-access_log common

        <Directory "/data/www/project/SRC">
                Options         +Indexes +Multiviews +FollowSymLinks
                AllowOverride   All
                Require         all granted
        </Directory>
</VirtualHost>

I can post my httpd.conf if necessary, though I haven't changed much from the default beyond ensuring that my extra/httpd-vhosts.conf file has been included.

Can anyone shed some light on what I'm missing?

Thanks

share|improve this question
2  
Anything in Apache's error log? – Shane Madden Jun 16 '14 at 5:52
    
No, nothing that would indicate a problem. – skubik Jun 16 '14 at 13:16
    
What HTTP headers are you getting on the blank page response? – Shane Madden Jun 16 '14 at 15:31
1  
HTTP/1.1 200 OK Date: Mon, 16 Jun 2014 18:26:44 GMT Server: Apache/2.4.9 (Unix) PHP/5.4.29 x-powered-by: PHP/5.4.29 Expires: Thu, 19 Nov 1981 08:52:00 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Content-Length: 0 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive Content-Type: text/html – skubik Jun 16 '14 at 18:30
    
Just grabbed it from Firebug. Sorry for the lack of formatting. I suppose it's possible it's a PHP thing, but I'd assume I'd be getting something in the logs if it was. Usually when I get a blank screen like this, it's a syntax error, but again, it usually says something in my logs. – skubik Jun 16 '14 at 18:32

if you get blank pages on loading php pages, set display_errors = On in /path-to-your/php.ini and start apache again (e.g.: sudo service apache24 onerestart). This way instead of a blank page, the missing extension(s) will be shown on the page. Chances are that it is commented out or missing in /path-to-your/php/extensions.ini (read on a FreeBSD forum, tip from soulreaver1)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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