hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

404 File Not Found on Apache 2.4.7, Ubuntu 14.04, FastCGI

Open bouyajdad opened this issue 12 years ago • 13 comments

Hello,

I use hhvm on Ubuntu 14.04 and on Apache 2.4.7. I configured everything like you´re described for the use with FastCGI on virtual host, but if I try to open the "domain/index.php" in Browser, I get: 404 File Not Found.

If I try it with "domain/index.html", all works fine, that means that the vhost must set right.

If I go in console to the public folder where the index.php is included and insert "hhvm index.php" the output is "HipHop", cause in the file I use phpinfo(). That means HHVM works fine.

I used the Prebuilt for 14.04.

After install-routine I used: "/usr/share/hhvm/install_fastcgi.sh" and "/etc/init.d/hhvm restart"

Type: "hhvm --version" results in: HipHop VM 3.0.1 (rel) Compiler: tags/HHVM-3.0.1-0-g1da451b79f40686de6472d23cf90fdd09fa4dc23 Repo schema: 11f0d546efba889ced1f9b92d9c9249f494d0b84

I also used: "a2enmod proxy_fcgi" to enable Module proxy and Module proxy_fcgi.

This is my config for virtual host:


virtualhost *:80>

        # Admin email, Server Name (domain name) and any aliases

        ServerAdmin [email protected]         ServerName domain.de         ServerAlias www.domain.de

        # Index file and Document Root (where the public files are located)

        DirectoryIndex index.php index.html         DocumentRoot /var/www/vhosts/domain/public_html

        # Custom log file locations

        LogLevel debug         #LogLevel warn

        ErrorLog /var/www/vhosts/domain/logs/errors.log         CustomLog /var/www/vhosts/domain/logs/access.log combined

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/vhosts/domain/public_html/$1

    <Directory /var/www/vhosts/domain/public_html>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride FileInfo  All
            Order allow,deny
            Allow from all
            Require all granted
    </Directory>

/virtualhost>


/etc/hosts/ 127.0.0.1 domain.de


/etc/hhvm/server.ini: hhvm.server.default_document = index.php


Here is our: netstat -tulpn Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 808/sshd tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 951/mysqld tcp6 0 0 :::22 :::* LISTEN 808/sshd tcp6 0 0 :::9000 :::* LISTEN 1939/hhvm tcp6 0 0 :::80 :::* LISTEN 1906/apache2


Here is our: ls -ld /var/www/vhosts/domain drwxrwxr-x 4 root developers 4096 May 16 07:57 /var/www/vhosts/domain


Here is our: getent group developers developers:x:1001:me,root,www-data


This is an entry in our error log: [Thu May 15 21:51:48.005072 2014] [proxy:debug] [pid 1429] proxy_util.c(1690): AH00924: worker fcgi://127.0.0.1:9000/var/www/$1 s$


Any idea how to fix it?

Any reference to do anything else important for the use with WordPress?

Best regards

bouyajdad avatar May 16 '14 08:05 bouyajdad

My setting for ProxyPassMatch is the following.

ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/

Why do you have a $1 at the end? What happens when you remove it?

SiebelsTim avatar May 16 '14 09:05 SiebelsTim

It´s the same result.

$1 expands to the entire request-URI from the original request, minus the leading slash

bouyajdad avatar May 16 '14 09:05 bouyajdad

I just installed it and have the same problem with error 404. Could someone fix it?

Zeokat avatar Aug 11 '14 00:08 Zeokat

Also seen on Debian + Apache 2.4.10 (behind Pound & Varnish) using same ProxyPassMatch config.The $1 placeholder makes no difference.

With hhvm not running the server returns 'File not found'; and with hhvm running, the server returns '404 File not found', for any file matching the .'php.' The setup works when switching Apache to use php5-fpm instead of hhvm.

John-B avatar Aug 15 '14 08:08 John-B

I'm seeing this with a fresh build. I can load any file that doesn't end in .php.

hhvm --version
HipHop VM 3.2.0 (rel)
Compiler: tags/HHVM-3.2.0-0-g01228273b8cf709aacbd3df1c51b1e690ecebac8
Repo schema: c52ba40f4a246d35a88f1dfc1daf959851ced8aa

Swahvay avatar Sep 11 '14 01:09 Swahvay

Same issue here... hhvm --version HipHop VM 3.3.0 (rel) Compiler: tags/HHVM-3.3.0-0-g0a3cfb87b8a353fc7e1d15374f4adc413e37aba9 Repo schema: 9a391d9a03e15fccba1cde6d35c05b7cdd380238 Extension API: 20140829

gwelr avatar Oct 02 '14 11:10 gwelr

Same issue here, Ubuntu 12.04, Apache 2.4.7, HHVM 3.3.0.

When i use ProxyPassMatch, all .php files return 404, other file extensions (like .html) works (via Apache and not HHVM as expected). When I use ProxyPass, actually the directory index works ( http://mysite/ ), and HHVM is shown under X-Powered-By header, but nothing else works (f eg http://mysite/index.php returns 404). Other file extensions doesn't work at all (browser doesn't receive data - nothing is logged).

patrickfabrizius avatar Oct 17 '14 16:10 patrickfabrizius

The issue seems to be with /etc/apache2/mods-enabled/hhvm_proxy_fcgi.conf, when removing that symlink (and restarting apache) things started working for me. It seems to globally configure apache to proxy everything to /var/www and override the vhost-specific proxies, thus 404.

patrickfabrizius avatar Oct 22 '14 06:10 patrickfabrizius

Thanks @patrickfabrizius , removing hhvm_proxy_fcgi.conf worked for me.

klausi avatar Oct 23 '14 20:10 klausi

I am experiencing this issue as well ubuntu 14.04, apache 2.4.7, hhvm 3.7

wmarbut avatar May 07 '15 04:05 wmarbut

same here. i tried to set up a ProxyPass to something else than /var/www and it gets overwritten by /etc/apache2/mods-enabled/hhvm_proxy_fcgi.conf - not sure what created that file and why, but it seems pretty stupid to me. would be nice to fix that to make life easier when setting up hhvm...

dbu avatar May 28 '15 19:05 dbu

I was having this issue, but changing fcgi://127.0.0.1:900/var/www/$1 to fcgi://127.0.0.1:900/var/www/html/$1 in /etc/apache2/mods-enabled/hhvm_proxy_fcgi.conf fixed the issues for me.

PaulMDemers avatar Jul 05 '15 01:07 PaulMDemers

I am going over old issues on this repository, to see which ones apply to the current versions of hhvm.

Hhvm doesn't ship with built-in webserver configuration anymore. Setting it up, just like one would for php, works fine just fine. For any remaining server questions, please open a new issue.

lexidor avatar Sep 05 '23 20:09 lexidor