cancel
Showing results for 
Search instead for 
Did you mean: 

Unsuccessful magento 2 installation on ubuntu 14.4 LTS

Unsuccessful magento 2 installation on ubuntu 14.4 LTS

Day by day I am losing  hope with magento 2 installation.  I am very much stuck for the past 6 months with the simple installation step. But I find no notes about the installation for ubuntu 14.4 LTS.  I will list down the steps for the installation which I have made till now.

 

System information check before installation (in command line terminal shell):
------------------


1)php -v

 

PHP 5.6.22-1+donate.sury.org~trusty+1 (cli)

Copyright (c) 1997-2016 The PHP Group

Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

   with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

 

2)mysql --version

 

mysql  Ver 14.14 Distrib 5.6.30, for debian-linux-gnu (i686) using  EditLine wrapper

 

3)sudo a2enmod rewrite

 

Module rewrite already enabled

 

4)apache2 -v

 

Server version: Apache/2.4.20 (Ubuntu)

Server built:   2016-04-20T00:00:00

 

5)composer -V

 

Composer version 1.0.3 2016-04-29 16:30:15

 

6)lsb_release -a

 

Distributor ID: Ubuntu

Description: Ubuntu 14.04.4 LTS

Release: 14.04

Codename: trusty

 

7)host path is “http://localhost”

 

Installation steps:

 

  1. Go to magento site and download the latest community edition zip package without sample data. Extract it in a sub folder (/var/www/html/test/maganto2) and change the file permissions. Then proceed with step by step installation through browser.
  2. After installation completed give the following command in terminal
    * cd /var/www/html/test/maganto2
    * sudo php bin/magento setup:static-content:deploy (without sudo throws permission error)
    * sudo php bin/magento indexer:reindex
    * chown & chmod
    * delete cache folder under var/cache

    With these step the home page works but sub pages and admin page does not work. I have created a vhost for the same. I have successfully created vhost for zf2, laravel 5 frameworks which does work.

I have changed the .htacess for subfolder. Even then the sub pages and admin pages does not works. It throws 404 for found. But when I give a /index.php/ then the page renders. For the same /index.php/admin the admin pages throws the same 404 with key as a url maganto2/admin/admin/index/index/key/98fd68bed0f5cb7f617e063d12c717b7778663ec71ad9458290283839bb03fa0/

The 1.x installation story was simple. I used to extract to whatever subfolder I wanted. When clicked it simply installed what I needed. But for v2 I don't know why the installation is complicated..!! Am I the only one who is facing the issue?

4 REPLIES 4

Re: Unsuccessful magento 2 installation on ubuntu 14.4 LTS

It sounds like either mod_rewrite is not enabled in your Apache or the default Magento 2 .htaccess is missing/broken in the root directory. To check whether mod_rewrite is working you can simply create a .php file with the following content:

<? phpinfo(); ?>

You should see mod_rewrite listed under "Loaded Modules".
Sindre M, CEO & Founder
ProperHost.com - The Magento Hosting Experts

Re: Unsuccessful magento 2 installation on ubuntu 14.4 LTS

you need to follow the instructions as below 

1) Create a .htaccess file into your root directory can follow the given URL :

https://github.com/magento/magento2/blob/2.0.4/.htaccess

 

2) After creating run the following command to restart your apache server

sudo /etc/init.d/apache2 restart

 

3) Also check the permission for var directory inside the root folder or run the following command to set permission :

sudo chmod 777 -R var/

 

4) Clen the cache 

sudo php bin/magento cache:clean

 

Hope it would work for you Smiley Happy

 

 

Re: Unsuccessful magento 2 installation on ubuntu 14.4 LTS

A couple items:

  1. Default Ubuntu apache config ( httpd.conf ) doesn't allow overrides in the /var/www directory; you'll need to edit that file and change the contents to AllowOverides ALL    ; that should fix the redirects and get them working again.
  2. You should use sudo -u www-data php bin/magento when you run CLI commands to keep permissions correct otherwise you're writing files that the apache user ( www-data ) can't interact with properly
  3. Quick fix is to do a chmod -R www-data:www-data on your Magento root directory ; that should get you to be able to see the home page at least ( if you've configured Magento to use redirects the links on the nav won't work ).

-Chuck

Re: Unsuccessful magento 2 installation on ubuntu 14.4 LTS

Hi SindreM,

Thanks for the help. But I do have mod_rewrite listed under "Loaded Modules".

 

Hi ipragmatech,

Thanks for the help.I do have .htaccess aleady in the folder. I also cleared cache by sudo php bin/magento cache:clean and chmod /var. But still it does not work for sub links and admin link

 

Hi Magento_Chuck,
Thanks for the help. I dont have httpd.conf in my Ubuntu 14.4 LTS. So I created a vhost inside by following
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/"file name.conf"
Inside that set the following

<VirtualHost *:80>
ServerAdmin xxx@gmail.com
ServerName migrate.localhost
DocumentRoot /var/www/html/migrate/public
SetEnv APPLICATION_ENV "development"
<Directory /var/www/html/migrate/public>
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

cd /etc/apache2/sites-available/
sudo a2ensite file name.conf
sudo service apache2 restart
sudo gedit /etc/hosts
Add: 127.0.0.1 sitename.localhost
sudo service apache2 restart

 

After this if I give http :// sitename.localhost The magento loades with home page. But again the sub pages does not work. I used to do the same vhost creation for zf2, laravel, cakePHP ect which does works. I even tried to create a simple vhost to check if it works and it does works.

 

I have also changed "chmod -R www-data:www-data" but still I could not make the sub pages and admin to work.

I wonder if anyone could take up the environment to test the same.