I had Apache2 running on my local ubuntu machine and I installed nginx & hhvm on my local for debugging purposes by following this tutorial.
I would now like to switch back to Apache2 as I had it before, previously I had both Apache & NGINX with PHP5-FPM running and I could switch between them by running:
sudo service nginx stop
sudo service apache2 restart
Now when I try this I get the below error when I try to access my Magento app
/var/www/app/Mage.php was not found
I can however see the default Ubuntu Apache page when I go to http://localhost/
I tried running
~:$ sudo service nginx stop
~:$ sudo service hhvm stop
~:$ sudo service apache2 restart
* Restarting web server apache2 [ OK ]
~:$ sudo service php5-fpm restart
stop: Unknown instance:
php5-fpm start/running, process 12258
~:$ sudo service php5-fpm restart
php5-fpm stop/waiting
php5-fpm start/running, process 12281
And now I get a 503 service unavailable error when I try to access my Magento app in the browser. I know in Magento this error can be caused by a maintenance.flag file in the Magento root directory but this is not the case here.
My Apache error log says:
[Sat Jun 27 11:11:07.902430 2015] [proxy:error] [pid 12223] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9000 (*) failed
[Sat Jun 27 11:11:07.902490 2015] [proxy_fcgi:error] [pid 12223] [client 127.0.0.1:39494] AH01079: failed to make connection to backend: 127.0.0.1[Sat Jun 27 11:11:07.902430 2015] [proxy:error] [pid 12223] (111)Connection refused: AH00957: FCGI: attempt to connect to 127.0.0.1:9000 (*) failed
[Sat Jun 27 11:11:07.902490 2015] [proxy_fcgi:error] [pid 12223] [client 127.0.0.1:39494] AH01079: failed to make connection to backend: 127.0.0.1
When I installed HHVM I ran it's install_fastcgi.sh script. Could that be what is causing the issue.
Any idea on how I can switch between NGINX to Apache and not use HHVM on my local.
UPDATE
I tried @mboehn solution below and now I'm getting the original error in the browser when I navigate to my Magento apps URL
This should be looking in /var/www/magento/app/
for Mage.php
. And index.php
is in /var/www/magento/
. The start of index.php is:
/**
* Compilation includes configuration file
*/
define('MAGENTO_ROOT', getcwd());
$compilerConfig = MAGENTO_ROOT . '/includes/config.php';
if (file_exists($compilerConfig)) {
include $compilerConfig;
}
$mageFilename = MAGENTO_ROOT . '/app/Mage.php';
But this is how Magento apps normally run and I made no changes here. Just installed HHVM and stopped it to revert back to my previous Apache config.
There is nothing in the /var/log/apache2/error.log
.
In I have:
<VirtualHost *:80>
DocumentRoot /var/www/magento
ServerName http://dev.magento.local
DirectoryIndex index.php
<Directory /var/www/magento>
AllowOverride All
Allow from All
SetEnv MAGE_IS_DEVELOPER_MODE true
</Directory>
</VirtualHost>
2nd Update
Ok so there was a index.php in the /var/www/
path that was throwing me off, it was just a copy of something I had been working on ages ago that hadn't caused a problem before.
After removing it I get the bellow message in my browser.
File not found.
And now in my apache error log it says
[Sat Jun 27 12:33:58.382270 2015] [proxy_fcgi:error] [pid 16003] [client 127.0.0.1:40412] AH01071: Got error 'Primary script unknown\n'
/var/www/app/
isn't set somewhere in for exampleindex.php
? I believe you should have seen an error in Apache's error.log if it were Apache that returned a 404 (file not found) error./var/www/
. No I have a message in my error log[Sat Jun 27 12:33:58.382270 2015] [proxy_fcgi:error] [pid 16003] [client 127.0.0.1:40412] AH01071: Got error 'Primary script unknown\n'
/etc/apache/sites-available/default
) with it, or did you make another file (now in/etc/apache/sites-enabled/
)? You might need to disable thedefault
-site configuration.