Configuring ngnix for cms


#1

My YunoHost configuration

Hardware: x64 vpn
Internet access: in a datacenter
yunohost 3.4.2.4 (stable)
yunohost-admin 3.4.2 (stable)
moulinette 3.4.2 (stable)
ssowat 3.4.2 (stable)

Have you personalized your yunohost with some specifics configurations or do you use only the yunohost cli/webadmin tool ? basic

Description of my problem

HEY
I would like to install some CMS on my YNH server. To make them work, I have to make some change to the ngnix or php version, and I would like to know if it’s possible and/or risky.

  • First, I have installed this app: Custom Web app with SFTP access. No problem here.

  • When I try to install Flextype CMS, it says that I have to update my PHP version to 7.1.3. Is it safe and possible?

  • When I try to install Automad CMS, I have to modify the ngnix config file to make it work:

If you want to install Automad on an [Nginx](https://en.wikipedia.org/wiki/Nginx) server instead, please edit the `nginx.conf` file and add something like this to the `http` block to enable URL rewriting:

server {
    root    /path/to/automad;
    index   index.php index.html;
    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }
    location ~ \.php$ {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_index  index.php;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
    }
}

Source: https://automad.org/getting-started#nginx-configuration

  • My guess is that I have to edit the file /etc/nginx/conf.d/mydomain.d/my_webapp.conf
  • Could you help me to edit that file in order to make it work?

Please tell me if you think a ynh server is not made to do it, and I will stick to grav cms.

THANKS !


#2

Uuuuh theoretically yes but the dev team (us) will tend to discourage you to do this …

Supposedly yes, but looking at the piece of conf you mention, you might as well instead use the redirect app to create a reverse-proxy / proxy-pass to port 9000 … but imho that’s not the end of the story, you should probably have a service running somewhere on port 9000, which means configuring systemd and that’s another story if you are not comfortable with that kind of stuff …

Basically if you are not comfortable with tweaking configuration files, you will have a hard time making those work I think. So if you can stick with any other CMS already packaged for YunoHost that would be easier :s


#3

Thanks a lot @Aleks! Exactly what I needed to know.


#4

For anyone interested by running a CMS in Yunohost, just like to say that Pico CMS works without any configuration needed when you put it in a Custom Web app with SFTP access www folder.