Dotclear

Vous n'êtes pas identifié(e).

Annonce

13 février 2024 Sortie de Dotclear 2.29

#1 2016-06-17 01:39:26

reppep
Membre
Inscription : 2009-11-14

How should I define the dotclear action?

I am migrating my blog server from DC2.6 on CentoS 6 to CentOS 7. This line is giving me trouble:

Action dotclear /dotclear/index.php virtual

My old server has this action defined in each Apache vhost which is running Dotclear, but it doesn't work on my new server. I get recursive redirects until http gives up:

[Thu Jun 16 21:31:46.338438 2016] [core:error] [pid 630] [client 24.90.75.238:58769] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Thu Jun 16 21:31:46.338476 2016] [core:debug] [pid 630] core.c(3531): [client 24.90.75.238:58769] AH00121: r->uri = /dotclear/index.php/dotclear/index.php/dotclear/index.php/dotclear/index.php/dotclear/index.php/dotclear/index.php/dotclear/index.php/dotclear/index.php/dotclear/index.php/dotclear/index.php/dotclear/index.php
...
[Thu Jun 16 21:31:46.338785 2016] [core:debug] [pid 630] core.c(3538): [client 24.90.75.238:58769] AH00122: redirected from r->uri = /dotclear/index.php/dotclear/index.php/dotclear/index.php
[Thu Jun 16 21:31:46.338813 2016] [core:debug] [pid 630] core.c(3538): [client 24.90.75.238:58769] AH00122: redirected from r->uri = /dotclear/index.php/dotclear/index.php
[Thu Jun 16 21:31:46.338838 2016] [core:debug] [pid 630] core.c(3538): [client 24.90.75.238:58769] AH00122: redirected from r->uri = /dotclear/index.php

Unfortunately the only documentation I can find on using a dotclear 'action' is https://dotclear.org/documentation/2.0/admin/multiblog -- which I believe I wrote with guidance from Olivier years ago.

What is the best way to set up the dotclear handler?

Thanks!

Hors ligne

#2 2016-06-17 15:46:15

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

Hello

The way I proceed for a multiblog (or single for that matter) with a clean install (separating personnal files, plugins and themes from dotclear folder) is the following :

- put a copy of dotclear/index.php at the root of www folder and adjust the path to dotclear/inc/prepend.php
- in blog parameters fill in blog URL to http:domain.tld/
- add enventually an .htaccess file (query_string) containing

# Nice URLs
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

This works on all my servers, I hope it will help for you. If you need more details please do not hesitate to ask again ;)

Hors ligne

#3 2016-06-17 21:24:35

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

Hmm, that doesn't do what I want. http://$SITE/ still shows the CentOS default page.

"Alias /dotclear /home/web/dotclear" makes http://$SITE/dotclear/ show my blog homepage, but I want the top level of each vhost to be its own blog. I used to get this with a custom handler, with "Action dotclear /dotclear/index.php virtual" & "SetHandler dotclear" for each vhost.

Hors ligne

#4 2016-06-17 22:18:23

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

I think my current issue is that the dotclear handler is overriding PHP, so I see /dotclear/index.php (blank page with HTML comments) in my browser

php.conf on the server includes this:

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

But that's overridden in the vhost by:

    <Location />
        SetHandler dotclear
    </Location>

I don't understand why it works on the old server. Somehow that httpd knows to execute PHP on index.php, not serve it up as a textfile.

Hors ligne

#5 2016-06-18 15:23:39

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

Sorry, I misunderstood the initial question, and cannot help much here, as it is more a question about Apache than about dotclear itself. Additionnaly, I am not familiar with SetHandler directives, nor with CentOS distribution, but the line containing "SetHandler dotclear" seems to me as it lacks a path to the dotclear folder, path which should, maybe, be indicated in the Location directive from what I undertand...

However, the difference between your old and new distribution might, amongst many, reside in the Apache version. Maybe you would have more luck by asking directly in a CentOS support forum ?

Hors ligne

#6 2016-06-20 00:39:02

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

Unfortunately handlers are pretty obscure. It's not really a CentOS question -- more an Apache httpd configuration question. The problem is that I don't know how it's *supposed* to work.

I need a clearer idea of what I'm trying to accomplish before I can either figure out the right httpd.conf syntax or get httpd help. Unfortunately I believe *I* wrote the only documentation I can find on this usage in 2009, based on hand-holding from Olivier. So there's no supporting documentation for insight.

Hors ligne

#7 2016-06-20 00:48:49

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

FWIW, I don't necessarily need an action/handler. That's just how I was told to run multiple blogs (including http://www.extrapepperoni.com/ http://link.extrapepperoni.com/dotclear/ http://molly.reppep.com ) off a single installation of Dotclear, with admin for all through a single https://SERVER/dotclear/ URL...

Is there a better way to set up multiple blogs with their own domains, under a single installation? I'd prefer to avoid `mod_rewrite` overhead on every request, but I can probably handle it if there is no alternative.

Dernière modification par reppep (2016-06-20 03:45:12)

Hors ligne

#8 2016-06-20 06:10:34

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

If you do not need the action/handler directives, I suggest you remove it at least for the time being.

Here is an example configuration for 2 domains powered by one dotclear installation. For the sake of simplicity, let's say both domains share themes, plugins and public folders.

(domain1.tld holds the dotclear installation in var/www/domain1.tld/dotclear/ with the following tree)

www
  domain1.tld
    dotclear
    index.php
    themes
    plugins
    public
    .htaccess (optional)

  domain2.tld
    index.php
    .htaccess (optional)

vhosts in etc/apache2/sites-available :

<VirtualHost *:80>
	ServerAdmin webmaster@domain1.tld
	ServerName domain1.tld
	ServerAlias www.domain1.tld
	DocumentRoot /var/www/domain1.tld
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/domain1.tld>
		Options FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	</Directory>
</VirtualHost>
<VirtualHost *:80>
	ServerAdmin webmaster@domain1.tld
	ServerName domain2.tld
	ServerAlias www.domain2.tld
	DocumentRoot /var/www/domain2.tld
	<Directory />
		Options FollowSymLinks
		AllowOverride None
	</Directory>
	<Directory /var/www/domain2.tld>
		Options FollowSymLinks MultiViews
		AllowOverride All
		Order allow,deny
		allow from all
	</Directory>
</VirtualHost>

As far as Apache is concerned, this is it

Now the blog in domain.1tld has default as id. This is its index.php file

if (isset($_SERVER['DC_BLOG_ID'])) {
	define('DC_BLOG_ID',$_SERVER['DC_BLOG_ID']);
} elseif (isset($_SERVER['REDIRECT_DC_BLOG_ID'])) {
	define('DC_BLOG_ID',$_SERVER['REDIRECT_DC_BLOG_ID']);
}else {
	# Define your blog here
	define('DC_BLOG_ID','default');
}

require dirname(__FILE__).'/dotclear/inc/public/prepend.php';

and blog in domain2.tld index.php has other as id and its index.php contains

define('DC_BLOG_ID','other');
require dirname(__FILE__).'/../domain1.tld/dotclear/inc/public/prepend.php';

And this is it.

If you wish to remove the index.php? part of URLs, use the .htaccess file given previously at the root of both domains, choose query_string as URL scheme in blog parameters, and set blog urls to http://www.domain(1or2).tld/. It should not be too heavy for your server ;)

Also, you will have to adjust public_path, public_url, themes_path and themes_url for both blogs in about:config, but I suppose you will figure it out

Does it make more sense now ?

Hors ligne

#9 2016-06-20 13:45:43

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

Philippe,

Thanks! That looks like a good fit. I want shared plugins & themes.

I'll try tonight.

Hors ligne

#10 2016-06-20 20:57:50

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

I set DC_BLOG_ID in my vhost configuration files, which still works:

SetEnv DC_BLOG_ID extrapepperoni

I stripped out the action/handler configuration.

You didn't mention enabling PHP in your snippets, but I got that from php.conf, included with the CentOS php*.rpm.

DC 2.6 is installed at /home/web/dotclear. I made index.php in each vhost a symlink, which gives me the correct blog homepage as each site homepage.

[root@linode2 ~]# ls -l /home/web/www.extrapepperoni.com/index.php
lrwxrwxrwx 1 root root 28 Jun 20 16:21 /home/web/www.extrapepperoni.com/index.php -> /home/web/dotclear/index.php

Thank you very much!

Unfortunately /post/ URLs don't work, and I'm not sure what other (virtual) subdirectories also need to be mapped back to DC somehow...

Dernière modification par reppep (2016-06-20 21:08:09)

Hors ligne

#11 2016-06-23 18:24:49

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

Hello? Putting a symlink to index.php into each vhost's DocumentRoot works for the default page (what naturally shows index.php), but how can I get other URLs to invoke Dotclear?

Hors ligne

#12 2016-06-24 01:49:02

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

Sorry, I do not really understand why you need to use symlinks? If you do as indicated in #8, i.e. placing an index.php file (with the right path to dotclear and the right id for each blog) at the root of each domain, doesn't it work better ?

Hors ligne

#13 2016-06-24 02:53:31

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

The symlink works fine. The problem is that there are other URLs, like /post/2015/11/Austin-BBQ, which do not point to index.php. How do I assign those URLs to Dotclear?

Hors ligne

#14 2016-06-24 15:10:02

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

The symlink may work fine if you have only one blog, but you must pass a different blog id to dotclear for the others, and symlinks will not do it...

By the way, did you try doing exactly what I suggested?

Hors ligne

#15 2016-06-24 20:00:47

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

All the blog homepages work properly, using symlinks, showing the proper blogs. I put DC_BLOG_ID into the httpd vhost.conf files, and that works fine.

The problem is that these blogs date back to 2008, and every post has its own URL, which is not index.php. Right now all those links are dead. I need a way to tell httpd that a URL like /post/2015/11/Austin-BBQ should *also* be handled by index.php (Dotclear). SetHandler did that, but now I just get a 404 error. Nothing in your configuration addresses /post/2015/11/Austin-BBQ and other post URLs.

Hors ligne

#16 2016-06-24 20:43:23

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

reppep a écrit :

I put DC_BLOG_ID into the httpd vhost.conf files, and that works fine.

OK. I understand better now  :)

For your URLs, would it work if you used the .htaccess file I suggested?

Edit : or remove index.php from your blog url parameter

Hors ligne

#17 2016-06-25 01:19:11

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

The problem isn't that index.php is explicitly specified -- I can specify any vhost without any path at all. There probably is a way to have .htaccess map all URLs to index.php, but I don't know it. I don't want to change my page URLs so they all start with 'index.php?'.

I need some configuration, which should probably go in the vhost.conf file but might well work in .htaccess, to say that all URLs should be handled by index.php.

Hors ligne

#18 2016-06-25 02:41:02

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

Sorry, I cannot help anymore, as I do not understand clearly what you are trying to do. As I am not used to configuring vhosts this way, I suggest you wait until somebody more qualified comes around. I have just reported this thread to other forum moderators, hopefully somebody will come up with a solution.

Hors ligne

#19 2016-06-25 03:10:54

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

Thanks.

Hors ligne

#20 2016-06-28 13:10:29

Lomalarch
Responsable du photocopieur
Lieu : Colombes (92)
Inscription : 2006-05-02
Site Web

Re : How should I define the dotclear action?

Hi,

If I understand correctly what you are trying to do, you’ll need RewriteRules in order for it to work. If you have written them, consider using query_string instead of path_info as URL reading method (and include the query mark in your RewriteRule). I hope I am undersstandable !


RTFM attitude : https://fr.dotclear.org/documentation/2.0
Le chantier tips, tutos et astuces : http://tips.dotaddict.org/
Rien nulle part??? une petite recherche sul’ forum, alors?: https://forum.dotclear.org/search.php ?

Hors ligne

#21 2016-06-30 03:52:28

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

Lomalarch,

I don't have RewriteRules, or know what they should be. Is this documented anywhere?

Hors ligne

#22 2016-06-30 05:23:34

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

A RewriteRule was given in #2 for an .htaccess file, but can be implemented (and actually should preferably) in your httpd.conf (server wide) or vhost configuration (domain wide) just after the DocumentRoot directive. See mod_rewrite documentation : http://httpd.apache.org/docs/current/en/rewrite/

Hors ligne

#23 2016-06-30 05:53:24

Philippe
Stagiaire
Lieu : Toulon
Inscription : 2004-06-13
Site Web

Re : How should I define the dotclear action?

PS : mod_rewrite module must be activated in your Apache configuration, and #2 in this thread lacked RewriteEngine On directive. The rules should look like this :

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1

Hope this helps in the end ;)

Hors ligne

#24 2016-07-01 02:53:36

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

Sorry. I must have tried that before I got your vhost instructions in #8, so it didn't work. Then I forgot and didn't see it again when I checked over #8 later.

Unfortunately they don't work. I put those 4 lines in a vhost, and after "apachectl graceful" I lost access to the vhost homepage.

I don't want my URLs to include "index.php?", and my blogs have "URL scan method:" set to 'PATH_INFO'.

I tried uncommenting these 4 lines in inc/config.php (both with and without your 4 mod_rewrite lines), but that didn't help either way.

> // If you have PATH_INFO issue, uncomment following lines
> if (!isset($_SERVER['ORIG_PATH_INFO'])) {
>     $_SERVER['ORIG_PATH_INFO'] = '';
> }
> $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];

Hors ligne

#25 2016-07-01 03:38:35

reppep
Membre
Inscription : 2009-11-14

Re : How should I define the dotclear action?

Progress! I found some info on PATH_INFO, including an alternate mod_rewrite recipe.

https://dotclear.org/documentation/2.0/hosting/1and1?s[]=path&s[]=info
https://dotclear.org/documentation/2.0/ … ultiblog?s[]=path&s[]=info
https://dotclear.org/documentation/2.0/admin/config?s[]=path&s[]=info

Surprisingly, neither server needs those 4 PATH_INFO lines uncommented in inc/config.php.

I had to tweak the PATH_INFO rewrite stanza for use in vhost.conf files:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) /index.php/$1
    RewriteRule ^/index.php$ /index.php/

My only remaining problem is that the URLs for the last 3 posts (including /post/2013/06/Bobby-the-purple-donut) on one of my blogs show the blog homepage instead of the specified posts.

Hors ligne

Vous n'êtes pas identifié(e).

Pied de page des forums

Sites map