Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx issue - CentOS6 #854

Closed
Crustymd opened this issue Dec 22, 2014 · 11 comments
Closed

nginx issue - CentOS6 #854

Crustymd opened this issue Dec 22, 2014 · 11 comments

Comments

@Crustymd
Copy link

MOst of the hosting servers that have SentOS6 installed with or without ISP manager panel have nginx installed on it, you can not disable or delete you will need to reconfigure the server. Anyway by default they have it installed. I run throw the instalaation with no error, when i reach the part when i ahve to go throw Web Installer http://mysite.com/magento2/setup - the page is just BLANK

Server log no errors. With the help of MAX i managed to find the issue, at least he says it's the issue

YOu can see the issue here http://prntscr.com/5jmnfr

You have a nginx.conf.sample in the root folder, so i fi try to make the nginx.conf in the /etc/nginx/nginc.conf to include this nginx.conf.sample from magento root. THe nginx will just stop working on the server, even if i define $MAGE_ROOT;

The question is how d oyou guys set up nginx correctly on CentOS for magento2? did anybody had nginx issue?

Thank you

@mazhalai
Copy link
Contributor

Please check if the magento2 and setup folders as well as files have read and execute permissions. Other possible reasons here

@Crustymd
Copy link
Author

@mazhalai

Acording to the documentation i made everything 700 and 600, so the files do not have execute permission :) - so the documentation is incorect then ?

p.s. if i set up all to 755 everything works fine :)

@Crustymd
Copy link
Author

Or at least 755 the folder and 644 the files

@nhp
Copy link

nhp commented Dec 23, 2014

on archlinux it is working with 700/600. Normally only the directories should need exec permission because it is needed for traversal. The files are never executed directly as i understand it so it should work.

Your installation resides in a subdirectory of the webroot? maybe it needs more tuning for that ? I only run it in the docroot of that vhost so no struggling with it for me. Maybe you look into the nginx log to see which file on disk it is trying to access. Did you change the user to the nginx-running user and not only the permissions?

@Crustymd
Copy link
Author

@nhp
I changed onyly the permissions and it was enough, so as i see now it goes as subdirectory of webrood... webroot is mysite.com and the magento is like mysite.com/magento2/

BUt now i have new error when i preceed with the install. it tells me that it failed at 0% with no log but the server logs show this

[Tue Dec 23 15:45:26 2014] [error] [client 46.55.111.162] PHP Warning:  fopen(): open_basedir restriction in effect. File(/tmp/install.log) is not within the allowed path(s): (/var/www/user/data:.) in /var/www/user/data/www/mysite.com/magento2/setup/module/Magento/Setup/src/Model/WebLogger.php on line 59, referer: http://www.mysite.com/magento2/setup/
[Tue Dec 23 15:45:26 2014] [error] [client 46.55.111.162] PHP Warning:  fopen(/tmp/install.log): failed to open stream: Operation not permitted in /var/www/user/data/www/mysite.com/magento2/setup/module/Magento/Setup/src/Model/WebLogger.php on line 59, referer: http://www.mysite.com/magento2/setup/
[Tue Dec 23 15:45:26 2014] [error] [client 46.55.111.162] PHP Warning:  fseek() expects parameter 1 to be resource, boolean given in /var/www/user/data/www/mysite.com/magento2/setup/module/Magento/Setup/src/Model/WebLogger.php on line 148, referer: http://www.mysite.com/magento2/setup/
[Tue Dec 23 15:45:26 2014] [error] [client 46.55.111.162] PHP Warning:  fgets() expects parameter 1 to be resource, boolean given in /var/www/user/data/www/mysite.com/magento2/setup/module/Magento/Setup/src/Model/WebLogger.php on line 150, referer: http://www.mysite.com/magento2/setup/
[Tue Dec 23 15:45:26 2014] [error] [client 46.55.111.162] PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in /var/www/user/data/www/mysite.com/magento2/setup/module/Magento/Setup/src/Model/WebLogger.php on line 69, referer: http://www.mysite.com/magento2/setup/

@Crustymd
Copy link
Author

Also the httpd.conf here it is

Include /usr/local/ispmgr/etc/ispmgr.inc
<Directory /var/www/user/data/www/mysite.com>
    Options +ExecCGI +Includes
php_admin_value open_basedir "/var/www/user/data:."
php_admin_flag engine on
</Directory>
NameVirtualHost 99.185.28.25:81
<VirtualHost 99.185.28.25:81 >
ServerName mysite.com
AssignUserID user user
CustomLog /var/www/httpd-logs/mysite.com.access.log combined
DocumentRoot /var/www/user/data/www/mysite.com
ErrorLog /var/www/httpd-logs/mysite.com.error.log
ServerAdmin webmaster@mysite.com
ServerAlias www.mysite.com
AddHandler server-parsed .ssi
AddType application/x-httpd-php .php .php3 .php4 .php5 .phtml
AddType application/x-httpd-php-source .phps
php_admin_value open_basedir "/var/www/user/data:."
php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f webmaster@mysite.com"
php_admin_value upload_tmp_dir "/var/www/user/data/mod-tmp"
php_admin_value session.save_path "/var/www/user/data/mod-tmp"
ScriptAlias /cgi-bin/ /var/www/user/data/www/mysite.com/cgi-bin/
</VirtualHost>

@nhp
Copy link

nhp commented Dec 23, 2014

Of course it is enough to give way too loose permissions. If you have correct ownership 700/600 is enough. If ownership is not that of the nginx-user then it has to be something like X55 or XX5.
php_admin_value open_basedir is your problem in there because it is preventing any file access beside /var/www/user/data and /tmp is outside of that you are in trouble. According to http://devdocs.magento.com/guides/v1.0/install-gde/trouble/tshoot_install-log.html it looks like you have to change the value of open_basedir to include system_temp_dir.

I was not aware of that but it looks like really bad practice in any shared environment.
The problem came up some time ago here #796

@mazhalai
Copy link
Contributor

@Crustymd which documentation are you referring to?

@nhp we are working on the open_basedir issue. Should have a fix merged soon.

@Crustymd
Copy link
Author

@mazhalai

I have to set all folders to 755 and files to 644 and no more blank page. I see and can fill in the instalation wizzard

I have to add to the existing value of open_basedir the "/tmp:" at the end of the value so that installation would start otherwise i get error with no log.

Then at 93% i have new error and i need to delete or comment out the "session_path" assigned to the domain from httpd.conf and then installation is all good at 100%

@maksek maksek added the PS label Dec 26, 2014
@maksek
Copy link
Contributor

maksek commented Jan 8, 2015

Hi @Crustymd, seems like you have resolved the issue?

@muasir
Copy link

muasir commented Jan 23, 2015

closing this issues as @Crustymd hasn't responded in 15days. Please reopen if our fix didn't work for you.

@muasir muasir closed this as completed Jan 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants