Page 1 of 2

Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Tue May 03, 2016 11:03 am
by alikamran
Hi,
I have been trying for more than a week to install Magento. This is what I have done:

Updated my PHP to 5.6
Added domain.conf (with my domain name) to /etc/nginx/conf.d/ with appropriate settings

Still I get 404 error when trying to access the domain for Magento installation. Can anyone please guide me how to install Magento?

I am using CentOS 7.2 with Nginx+FPM-PHP.

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Tue May 03, 2016 6:07 pm
by ShaunWHD
This might occur if there is not an .htaccess file.
When you extracted magento, did you extract it into your webroot or is it in a subfolder called magento? That might also be the problem.

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Tue May 03, 2016 9:25 pm
by alikamran
ShaunWHD wrote:This might occur if there is not an .htaccess file.
When you extracted magento, did you extract it into your webroot or is it in a subfolder called magento? That might also be the problem.
Hi,
Thank you for your reply. I downloaded magento to /home/admin/web/domain/public_html

.htaccess file is there.

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Tue May 03, 2016 10:54 pm
by ShaunWHD
Which version Magento are you attempting to install?

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Tue May 03, 2016 11:55 pm
by jonn
nginx doesnt have support for .htaccess....


bit hard to diagnose without you posting your nginx rewrite configs

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Wed May 04, 2016 8:10 am
by alikamran
jonn wrote:nginx doesnt have support for .htaccess....


bit hard to diagnose without you posting your nginx rewrite configs
Below are the settings I am using for the domain.conf in etc/nginx/conf.d/domani.conf (pcfanatics.pk.conf)

Code: Select all

server {
listen 80 default;
server_name www.pcfanatics.pk pcfanatics.pk;
root /home/admin/web/pcfanatics.pk/public_html;

location / {
index index.html index.php;
try_files $uri $uri/ @handler;
expires 30d;
}

location ^~ /app/                { deny all; }
location ^~ /includes/           { deny all; }
location ^~ /lib/                { deny all; }
location ^~ /media/downloadable/ { deny all; }
location ^~ /pkginfo/            { deny all; }
location ^~ /report/config.xml   { deny all; }
location ^~ /var/                { deny all; }

location /var/export/ {
auth_basic           "Restricted";
auth_basic_user_file htpasswd;
autoindex            on;
}

location  /. {
return 404;
}

location @handler {
rewrite / /index.php;
}

location ~ .php/ {
rewrite ^(.*.php)/ $1 last;
}

location ~ .php$ {
if (!-e $request_filename) { rewrite / /index.php last; }

expires        off;
fastcgi_pass   127.0.0.1:9000;
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
fastcgi_param  MAGE_RUN_CODE default;
fastcgi_param  MAGE_RUN_TYPE store;
include        fastcgi_params; ## See /etc/nginx/fastcgi_params
}
}
ShaunWHD wrote:Which version Magento are you attempting to install?
Magento 1.9.2.4
XoXiLhJ0mn wrote:Can it be that the Magento installation scripts does not understand proxy_pass at the port required with VestaCP?
Everything seems fine to me, I get Error 404 and the URL on the page is http://pcfanatics.pk/index.php/install/

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Wed May 04, 2016 12:44 pm
by alikamran
XoXiLhJ0mn wrote:Hi,

I tried to begin the installation and it started to install.

Then I got following error:

Code: Select all

        Path "/home/admin/web/pcfanatics.pk/public_html/app/etc" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/xmlconnect" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/xmlconnect/custom" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/xmlconnect/custom/ok.gif" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/xmlconnect/system" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/xmlconnect/system/ok.gif" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/xmlconnect/original" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/xmlconnect/original/ok.gif" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/customer" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/downloadable" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/dhl" must be writable.
        Path "/home/admin/web/pcfanatics.pk/public_html/media/dhl/logo.jpg" must be writable.
So you need to make these dir writable, as it says.
How did you get access to my domain ? :O

Yeah I fixed the issue, apparently I was editing the wrong nginx file. Fixed it and installed Magento. Yeah this permission issue rose when I reinstalled magento. But I am still astonished how did you get access to the site ?

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Wed May 04, 2016 12:52 pm
by skurudo
alikamran wrote:How did you get access to my domain ? :O
You post domain name yourself :)

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Wed May 04, 2016 7:28 pm
by jonn
glad you got it sorted...
XoXiLhJ0mn wrote:So you need to make these dir writable, as it says.
Here is the official guide for permissions after install:
http://devdocs.magento.com/guides/m1x/i ... after.html

Re: Installation issues with Magento Nginx-FPM-PHP CentOS

Posted: Wed May 04, 2016 10:25 pm
by alikamran
skurudo wrote:
alikamran wrote:How did you get access to my domain ? :O
You post domain name yourself :)
Ohh I forgot about that :P
jonn wrote:glad you got it sorted...

Here is the official guide for permissions after install:
http://devdocs.magento.com/guides/m1x/i ... after.html
Thank you everyone for the help :)