uSked / mosaico-php-backend

A PHP backend for Mosaico
GNU General Public License v3.0
32 stars 34 forks source link

How To #14

Open jb-alvarado opened 8 years ago

jb-alvarado commented 8 years ago

Hello, sorry that I ask this question, but I don't get this backend to run. Can you please explain in some words how the php backend works?

I have mosaico installed outside from the standard documentroot, so I have to apply a rewrite rule in apache2 to execute php scripts. But when I navigate to url/backend-php, I get the message index.html not found, and when I add index.php to the address I get a plank page.

My Virtualhost config looks like this:

<VirtualHost *:80>
    ServerName mosaico.domain.intern
    DocumentRoot /home/user/nodeapps/mosaico

    <Directory /home/user/nodeapps/mosaico>
        Options FollowSymLinks
        Order allow,deny
        Allow from all
    </Directory>

    RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
    RewriteRule ^/(.*) http://localhost:9006/$1 [P,L]
    ProxyPassReverse / http://localhost:9006/
</VirtualHost>

Regards

Jonatha

NJseo commented 8 years ago

Yeah, that is how it is supposed to work. Change the html on the editor.html to var ok = Mosaico.init({ imgProcessorBackend: basePath+'/php-backend/img/', emailProcessorBackend: basePath+'/dl/', titleToken: "MOSAICO Responsive Email Designer", fileuploadConfig: { url: basePath+'/php-backend/upload/', } }, plugins);