Koozali.org: home of the SME Server
Obsolete Releases => SME 7.x Contribs => Topic started by: Stefano on October 21, 2010, 11:56:27 AM
-
Hi all
just installed wordpress (updated to last release) and php5-cgi via wiki howto.. so far so good
Now I want wordpress use php5-cgi, so I copied 92wordpress fragment in /templates-custom/ tree and edited this way:
{
my $status = $wordpress{'status'} || "disabled";
return " # wordpress is disabled in this VirtualHost"
unless $status eq 'enabled';
$OUT = "";
my $allow = 'all';
my $pass = '0';
my $satisfy = 'all';
my $name = $wordpress{'Name'} || 'Wordpress weblog';
for ('exit-if-none')
{
if ($wordpress{'PublicAccess'})
{
if ($wordpress{'PublicAccess'} eq 'none')
{
next;
}
elsif ($wordpress{'PublicAccess'} eq 'local')
{
$allow = $localAccess;
$pass = 0;
$satisfy = 'all';
}
elsif ($wordpress{'PublicAccess'} eq 'local-pw')
{
$allow = $localAccess;
$pass = 1;
$satisfy = 'all';
}
elsif ($wordpress{'PublicAccess'} eq 'global')
{
$allow = 'all';
$pass = 0;
$satisfy = 'all';
}
elsif ($wordpress{'PublicAccess'} eq 'global-pw')
{
$allow = 'all';
$pass = 1;
$satisfy = 'all';
}
elsif ($wordpress{'PublicAccess'} eq 'global-pw-remote')
{
$allow = $localAccess;
$pass = 1;
$satisfy = 'any';
}
}
$OUT .= "#------------------------------------------------------------\n";
$OUT .= "# wordpress - $name\n";
$OUT .= "#------------------------------------------------------------\n";
{
if (exists $wordpress{'URL'})
{ $OUT .= "Alias /$wordpress{'URL'} /opt/wordpress\n"; }
}
$OUT .= "Alias /wordpress /opt/wordpress\n";
$OUT .= "\n";
$OUT .= "<Directory /opt/wordpress>\n";
$OUT .= " AddType application/x-httpd-php .php\n";
$OUT .= " php_admin_value open_basedir /opt/wordpress\n";
$OUT .= " Options None\n";
$OUT .= " order deny,allow\n";
$OUT .= " deny from all\n";
$OUT .= " allow from $allow\n";
$OUT .= " php_value mysql.default_host $wordpress{DbName}\n";
$OUT .= " php_value mysql.default_user $wordpress{DbUser}\n";
$OUT .= " php_value mysql.default_password $wordpress{DbPassword}\n";
$OUT .= " AddHandler php5-cgi .php\n";
$OUT .= " Action php5-cgi /php5-cgi/php-cgi\n";
if ($pass)
{
$OUT .= " AuthName \"$name\"\n";
$OUT .= " AuthType Basic\n";
$OUT .= " AuthExternal pwauth\n";
$OUT .= " require valid-user\n";
$OUT .= " Satisfy $satisfy\n";
}
$OUT .= "</Directory>\n";
}
}
expanded template,checked syntax with
httpd -t
and restarted e-smith-httpd service
my httpd.conf file, for wordpress, says:
Alias /wordpress /opt/wordpress
<Directory /opt/wordpress>
AddType application/x-httpd-php .php
php_admin_value open_basedir /opt/wordpress
Options None
order deny,allow
deny from all
allow from all
php_value mysql.default_host wordpress
php_value mysql.default_user wordpress
php_value mysql.default_password ***************
AddHandler php5-cgi .php
Action php5-cgi /php5-cgi/php-cgi
</Directory>
but if I run phpinfo() from /opt/wordpress/index.php I see:
PHP Version 4.3.9
any hint?
Tia
edit by Cactus: removed the password
-
Action php5-cgi /php5-cgi/php-cgi
i think the problem lies in above line. IMHO the Action keyword first parameter is a filetype (see also http://httpd.apache.org/docs/2.0/mod/mod_actions.html#action). I am not sure if you set the proper file type here, AFAICT there is no php5-cgi file type. Did you copy this line from somewhere?
As far as I know the type should be application/x-httpd-php. But perhaps the php5-cgi handler is valid, but not configured in your case, see the link to the documentation I supplied for some examples.
-
Hi Cactus..
I copied from here (http://wiki.contribs.org/PHP5)
thanks
-
I copied from here (http://wiki.contribs.org/PHP5)
Then I am puzzled.
-
Then I am puzzled.
Then again... is your php5-cgi executable located at the location you specify (/php5-cgi/php-cgi)?
<Directory /opt/wordpress>
....
AddHandler php5-cgi .php
Action php5-cgi /php5-cgi/php-cgi
</Directory>
-
Does PHP5 work anywhere? Try enabling it on the Primary iBay and upload a phpinfo() file to check.
Also, try following the wiki instructions rather than editing the Wordpress template itself. That way the direction to load PHP5-CGI will likely be parsed by Apache before it processes the other options.
-
Does PHP5 work anywhere? Try enabling it on the Primary iBay and upload a phpinfo() file to check.
yes, it works flawlessy on ibays, just tested
finally I found the problem (after having dinner...): wordpress is in /opt but I'm using it as primary site, so I have:
[root@srvsrv scripts]# cd /home/e-smith/files/ibays/Primary/html/
[root@srvsrv html]# ls -la
total 12
drwxr-s--- 2 admin shared 4096 Aug 2 16:16 .
drwxr-xr-x 5 root root 4096 Aug 5 18:34 ..
lrwxrwxrwx 1 root shared 24 Aug 2 16:16 .htaccess -> /opt/wordpress/.htaccess
-rw-r----- 1 admin shared 240 Jan 12 2010 index.old
lrwxrwxrwx 1 root shared 24 Aug 2 12:11 index.php -> /opt/wordpress/index.php
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 license.txt -> /opt/wordpress/license.txt
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 readme.html -> /opt/wordpress/readme.html
lrwxrwxrwx 1 root shared 30 Aug 2 12:11 wp-activate.php -> /opt/wordpress/wp-activate.php
lrwxrwxrwx 1 root shared 23 Aug 2 12:11 wp-admin -> /opt/wordpress/wp-admin
lrwxrwxrwx 1 root shared 25 Aug 2 12:11 wp-app.php -> /opt/wordpress/wp-app.php
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 wp-atom.php -> /opt/wordpress/wp-atom.php
lrwxrwxrwx 1 root shared 33 Aug 2 12:11 wp-blog-header.php -> /opt/wordpress/wp-blog-header.php
lrwxrwxrwx 1 root shared 35 Aug 2 12:11 wp-comments-post.php -> /opt/wordpress/wp-comments-post.php
lrwxrwxrwx 1 root shared 34 Aug 2 12:11 wp-commentsrss2.php -> /opt/wordpress/wp-commentsrss2.php
lrwxrwxrwx 1 root shared 28 Aug 2 12:11 wp-config.php -> /opt/wordpress/wp-config.php
lrwxrwxrwx 1 root shared 35 Aug 2 12:11 wp-config-sample.php -> /opt/wordpress/wp-config-sample.php
lrwxrwxrwx 1 root shared 25 Aug 2 12:11 wp-content -> /opt/wordpress/wp-content
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 wp-cron.php -> /opt/wordpress/wp-cron.php
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 wp-feed.php -> /opt/wordpress/wp-feed.php
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 wp-includes -> /opt/wordpress/wp-includes
lrwxrwxrwx 1 root shared 32 Aug 2 12:11 wp-links-opml.php -> /opt/wordpress/wp-links-opml.php
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 wp-load.php -> /opt/wordpress/wp-load.php
lrwxrwxrwx 1 root shared 27 Aug 2 12:11 wp-login.php -> /opt/wordpress/wp-login.php
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 wp-mail.php -> /opt/wordpress/wp-mail.php
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 wp-pass.php -> /opt/wordpress/wp-pass.php
lrwxrwxrwx 1 root shared 25 Aug 2 12:11 wp-rdf.php -> /opt/wordpress/wp-rdf.php
lrwxrwxrwx 1 root shared 30 Aug 2 12:11 wp-register.php -> /opt/wordpress/wp-register.php
lrwxrwxrwx 1 root shared 26 Aug 2 12:11 wp-rss2.php -> /opt/wordpress/wp-rss2.php
lrwxrwxrwx 1 root shared 25 Aug 2 12:11 wp-rss.php -> /opt/wordpress/wp-rss.php
lrwxrwxrwx 1 root shared 30 Aug 2 12:11 wp-settings.php -> /opt/wordpress/wp-settings.php
lrwxrwxrwx 1 root shared 28 Aug 2 12:11 wp-signup.php -> /opt/wordpress/wp-signup.php
lrwxrwxrwx 1 root shared 31 Aug 2 12:11 wp-trackback.php -> /opt/wordpress/wp-trackback.php
lrwxrwxrwx 1 root shared 25 Aug 2 12:11 xmlrpc.php -> /opt/wordpress/xmlrpc.php
applying php directive to Primary ibay solved the issue
thank you
-
Glad to have stumbled across the answer!
-
finally I found the problem (after having dinner...)
New rule for solving problems at SME: with a full stomach is better reasoning... :)
-
finally I found the problem (after having dinner...): wordpress is in /opt but I'm using it as primary site, so I have:
Dinner at this time? I thought you were living in CET-zone...
-
Dinner at this time? I thought you were living in CET-zone...
well, you are right.. I meant lunch, but after I solved the problem, I fell asleep :-D
-
Stefano
wordpress is in /opt but I'm using it as primary site..
From your directory listing it appears you have created a whole lot of symlinks to the files in /opt
Is that how you made access to /opt functional (from the Primary ibay) ?
Did you need to use/create any other aliases or do anything else eg along the lines of the web application redirect howto ?
-
Stefano
From your directory listing it appears you have created a whole lot of symlinks to the files in /opt
Is that how you made access to /opt functional (from the Primary ibay) ?
Did you need to use/create any other aliases or do anything else eg along the lines of the web application redirect howto ?
Mary, IIRC, I just followed this (http://forums.contribs.org/index.php/topic,35553.msg156391.html#msg156391) suggestion, adapted to wordpress
HTH