HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   HOWTO-Related Questions (http://www.howtoforge.com/forums/forumdisplay.php?f=2)
-   -   Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On CentOS 6.3 (http://www.howtoforge.com/forums/showthread.php?t=59422)

Totenkopf 5th November 2012 10:47

Installing Nginx With PHP5 (And PHP-FPM) And MySQL Support On CentOS 6.3
 
Greetings!

Im currently running several shopware4 installations on an apache server with mod_php and pure-ftp, but ive got the problem, that i cant use the ftp server properly, because of mod_php. Now i wanted to make a sampole installation inside a VM with nginx and php-fpm and i already understood the syntax of nginx config files, but i cvant manage to get the installation of shopware running, because of the redirect rules. I can open my shopware basic folder, with the warning, that i should install shopware first and i can see the first page of the installation process, but right after i tried to change the language, or to go to the 2nd step, i get thron back to the shopware.php main site with the warning.

First my configs:

/etc/nginx/nginx.conf

Quote:

user nginx;
worker_processes 4;

error_log /var/log/nginx/error.log;
#error_log /var/log/nginx/error.log notice;
#error_log /var/log/nginx/error.log info;

pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

## Detect when HTTPS is used
map $scheme $fastcgi_https {
default off;
https on;
}

log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';

access_log /var/log/nginx/access.log main;

sendfile on;
keepalive_timeout 2;

# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*.conf;
}
/etc/nginx/conf.d/default.conf

Quote:

server {
listen 80; # Listen to Port 80
server_name somesite.com; # Replace with Server-Name
access_log /var/log/nginx/localhost.access.log;

location / {
root /var/www/somesite.com; #Define doc-root
include /var/www/shopware.conf; #Include shopware specific nginx rules
}


# Use php-fpm as fast-cgi backend for all .php files
location ~ .php$ {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
}
}
/var/www/shopware.conf

Quote:

# Shopware nginx rules
# version 1.0
# date 09.08.2011
# author Stefan Hamann <sth@shopware.de>

# Defining various options

# Set DirectoryIndex
index shopware.php index.php;

# Deny direct access to all smarty templates
location ~ ^/templates/.*/*.tpl {
deny all;
}

# Permit access to php files in web readable directories
location ~ ^/cache/.*/*.(php|cgi|php5|php3|php4|phtml|pl|py) {
deny all;
}
location ~ ^/images/.*/*.(php|cgi|php5|php3|php4|phtml|pl|py) {
deny all;
}
location ~ ^/files/.*/*.(php|cgi|php5|php3|php4|phtml|pl|py) {
deny all;
}
location ~ ^/upload/.*/*.(php|cgi|php5|php3|php4|phtml|pl|py) {
deny all;
}

# Defining rewrite rules
rewrite /images/ayww/(.*) /images/banner/$1 last;
rewrite /files/documents/.* /engine last;
rewrite /templates/(.*(css|js))$ /engine/backend/php/sCacheTemplate.php?file=/templates/$1 last;
rewrite /sitemap.xml(.*) /shopware.php?controller=SitemapXml;
rewrite /application.yaml /engine last;
rewrite /engine/core/php/sAjaxSearch.php$ /engine/backend/php/sAjaxSearch.php last;
rewrite /engine/core/php/campaigns.php$ /engine/backend/php/campaigns.php last;

# Defining controller based route processing behaviour
if (!-e $request_filename) {
rewrite . /shopware.php last;
}
I do have a somesite.com.vhost file to, located at /etc/nginx/sites-available with link to sites-enabled, but this one is ignored...

Any ideas or suggestions?

Totenkopf 5th November 2012 12:26

Now i deleted the default.conf and changed the last nginx.conf include setting to "/etc/nginx/sites-enabled/*". Since then i get an "Redirect error"...


All times are GMT +2. The time now is 17:21.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.