Configuration nginx/htaccess pour YellowCMS

Bonjour

J’aimerais utiliser le merveilleux YellowCMS (que je recommande vivement) sur mon serveur YunoHost hébergé à la maison.


J’ai donc installé l’application my_webapp (celle sans FTP)

J’ai commencé à bidouiller le fichier de conf nginx associé à my_webapp pour un ou deux CMS très simple en m’aidant d’un convertisseur htaccess pour nginx. Avec de bons résultats et avec l’aide de maniackcrudelis. Je tiens à préciser que je pige que pouic à ce que je fais concrètement, juste je bidouille en essayant de comprendre la logique.

Mais pour Yellow, je galère ! A la base, certains ont cherché à adapter Yellow pour Nginx

Finalement, ils ont fini par trouver la configuration idéale:

server {
    listen 80;
    server_name website.com;
    root /var/www/website/;
    charset utf-8;
    index index.html yellow.php;

    error_page 404 /error.html;

    location /cache {
        rewrite ^(.*)$ /error break;
    }

    location /content {
        rewrite ^(.*)$ /error break;
    }

    location /system {
        rewrite ^(.*)$ /error break;
    }

    location / {
        if (!-e $request_filename) {
            rewrite ^/(.*)$ /yellow.php last;
            break;
        }
    }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index yellow.php;
        include fastcgi_params;
    }
}

Mais je n’ai AUCUNE idée de comment adapter ça pour le fichier de conf nginx de my_webapp ! Peut-être que quelqu’un saura m’indiquer la marche à suivre ?

Par défaut mon fichier de conf pour my_webapp ressemble à ça

location /home {
       alias /var/www/webapp_name/home/;
       if ($scheme = http) {
              rewrite ^ https://$server_name$request_uri? permanent;
       }
       index index.php index.html index.htm;
       default_type text/html;
       location ~ [^/]\.php(/|$) {
           fastcgi_split_path_info ^(.+?\.php)(/.*)$;
           fastcgi_pass unix:/var/run/php5-fpm.sock;
           fastcgi_index index.php;
           include fastcgi_params;
           fastcgi_param  REMOTE_USER $remote_user;
           fastcgi_param  PATH_INFO $fastcgi_path_info;
	    fastcgi_param SCRIPT_FILENAME $request_filename;
       }
  # Include SSOWAT user panel.
  include conf.d/yunohost_panel.conf.inc;
}

Et le fichier htaccess de Yellow ressemble à:

<IfModule mod_rewrite.c>
RewriteEngine on

# Yellow dynamic pages
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ yellow.php [L]
DirectoryIndex index.html yellow.php
RewriteRule ^(cache|content|system)/ error [L]

# Yellow static pages
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^[^\.]+$ - [T=text/html,L]
ErrorDocument 404 /error.html
</IfModule>

L’auteur de Yellow ne sait malheureusement pas comment s’y prendre. Mais il serait ravi qu’on y parvienne, afin de proposer à l’avenir une application YunoHost pour Yellow, pour ceux qui comme moi seraient intéressés.

Au plaisir - JUH

J’ai finalement réussi à installer Yellow sur Yunohost. J’ai fait un petit tuto en anglais:

How to install Yellow in YunoHost:

1-Install Custom Webapp without FTP access with yunohost (for example, in domain.com/home)
2-Upload Yellow in /var/www/webapp_name/home
3-Edit home.conf in folder /etc/nginx/conf.d/domain.com.d like this:

error_page 404 /home/error.html;

location /home/cache {
    rewrite ^/home/(.*)$ /home/error break;
}
location /home/content {
    rewrite ^/home/(.*)$ /home/error break;
}
location /home/system {
    rewrite ^/home/(.*)$ /home/error break;
}

location /home {
     alias /var/www/webapp_name/home/;
     if ($scheme = http) {
          rewrite ^ https://$server_name$request_uri? permanent;
    }
     index yellow.php index.php index.html index.htm;
     default_type text/html;
     location ~ [^/]\.php(/|$) {
       fastcgi_split_path_info ^(.+?\.php)(/.*)$;
       fastcgi_pass unix:/var/run/php5-fpm.sock;
       fastcgi_index yellow.php;
       include fastcgi_params;
       fastcgi_param  REMOTE_USER $remote_user;
       fastcgi_param  PATH_INFO $fastcgi_path_info;
       fastcgi_param SCRIPT_FILENAME $request_filename;
    }

    if (!-e $request_filename) {
    rewrite ^/home/(.*)$ /home/yellow.php last;
    break;
    }

# Include SSOWAT user panel.
include conf.d/yunohost_panel.conf.inc;
}

4-Edit config.ini in /var/www/webapp_name/home/system/config and add this:

webinterfaceServerScheme = https

Working good for now.

This is only work for my_webapp without FTP access I have not tested yet with official my_webapp