DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 8th December 2016
agshekeloh agshekeloh is offline
Real Name: Michael W Lucas
Port Guard
 
Join Date: Jul 2008
Location: Detroit, MI
Posts: 21
Default Wordpress and httpd

Hi,

This seems like the best place to ask for this sort of help.

I'm working on getting Wordpress running on httpd (-current, amd64), to use as an example in the httpd/relayd book. (Yes, yes, I know, Wordpress sucks. But people want it, and if OpenBSD is to be considered a hosting platform I need to show it runs things people want.)

I've succeeded... almost. Wordpress installs. It runs. I can add posts and comments. But it can't make a connection back to wordpress.org, so it can't add plugins or check for updates. With debugging on, I get:

An error occurred. Something may be wrong with WordPress.org or this server’s configuration. If you continue to have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /site12/wp-includes/update.php on line 306

Doesn't matter if I use PHP 5.6 or 7.0.

According to various forums, this happens when OpenSSL is out of date. I'm confident that's not the issue. ;-)

Reading the WP source, it appears something has broken the function wp_remote_post.

And there my skills break down.

Any suggestions on how to further debug this?

Thanks,
==ml
Reply With Quote
  #2   (View Single Post)  
Old 8th December 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

Good morning, Michael. Wordpress was pulled from the ports tree 19 months ago.

You might reach out to gonzalo@, who had been maintaining the application.

Perhaps a different dynamic application -- one still available in the tree --might be an option to consider.
Reply With Quote
  #3   (View Single Post)  
Old 8th December 2016
agshekeloh agshekeloh is offline
Real Name: Michael W Lucas
Port Guard
 
Join Date: Jul 2008
Location: Detroit, MI
Posts: 21
Default

If it was for me, I'd do a different app. This is for the book.

People make this work. It can't be rocket surgery...
Reply With Quote
  #4   (View Single Post)  
Old 8th December 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

Quote:
Originally Posted by agshekeloh View Post
People make this work.
There are other interpretations of that sentence, with just a little punctuation change.
  • People, make this work!
  • People make this work?
I can try to recreate the problem over the weekend, with my usual lack of any guarantee whatsoever. By then, you may get some actual help or guidance from someone with skills, knowledge, and experience. When it comes to Wordpress, I lack all three.
Reply With Quote
  #5   (View Single Post)  
Old 8th December 2016
TronDD TronDD is offline
Package Pilot
 
Join Date: Sep 2014
Posts: 155
Default

My first guess is that because of the chroot, you can't resolve the hostname.

Did you populate /var/www with a etc/resolv.conf? I had seen an email on misc@ saying that fixed their setup, but I can't find it now. I don't remember what site software tehy were using.

Tim.
Reply With Quote
  #6   (View Single Post)  
Old 9th December 2016
psypro psypro is offline
Shell Scout
 
Join Date: Mar 2016
Location: Continent:Europe
Posts: 124
Default

I use httpd and wordpress. I have the same problem, but I have not put effort into trying to fix it. I just download app and extract them into the correct folder. But I am no expert WordPress user, would making this work, make it easier to update WordPress and apps, so it might be a good idea. Looking forward to following your progress.
Reply With Quote
  #7   (View Single Post)  
Old 9th December 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

I think TronDD is on to something. I've installed WP and saw the following error message after logging into it the first time, on the lower right section of the WP Dashboard:
Quote:
WP HTTP Error: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: no address associated with name stream_socket_client(): unable to connect to tcp://wordpress.org:80 (php_network_getaddresses: getaddrinfo failed: no address associated with name)
I'm no expert on PHP, but I found an old thread that suggested creating /var/www/etc, and populating it with resolv.conf, hosts, and localtime.

That seemed to do the trick. Errors in /var/www/logs/error.log regarding wordpress.org ceased.
Reply With Quote
  #8   (View Single Post)  
Old 9th December 2016
agshekeloh agshekeloh is offline
Real Name: Michael W Lucas
Port Guard
 
Join Date: Jul 2008
Location: Detroit, MI
Posts: 21
Default

I had gotten the resolv.conf trick.

What happens when you click on the Plugins page, though? Do you get an error? That's where mine hangs up...
Reply With Quote
  #9   (View Single Post)  
Old 9th December 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

No errors on plugins page. Akimset and Hello Dolly were already installed. Clicking on Add New gives me a page full of 'em.

Last edited by jggimi; 9th December 2016 at 11:28 PM. Reason: typos
Reply With Quote
Old 10th December 2016
agshekeloh agshekeloh is offline
Real Name: Michael W Lucas
Port Guard
 
Join Date: Jul 2008
Location: Detroit, MI
Posts: 21
Default

Quote:
Originally Posted by jggimi View Post
No errors on plugins page. Akimset and Hello Dolly were already installed. Clicking on Add New gives me a page full of 'em.
But... but... AAAAAGH!!!

I'm missing some small, simple, trivial thing.

What version of PHP are you using?

At least I know it's me, thanks.
Reply With Quote
Old 10th December 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

PHP 7, MariaDB 10, amd64-current. Here's the package list.
Code:
femail-1.0p1        simple SMTP client
femail-chroot-1.0p2 simple SMTP client for chrooted web servers
gettext-0.19.8.1    GNU gettext runtime libraries and programs
libiconv-1.14p3     character set conversion library
libxml-2.9.4        XML parsing library
mariadb-client-10.0.28v1 multithreaded SQL database (client)
mariadb-server-10.0.28v1 multithreaded SQL database (server)
p5-Clone-0.38       recursively copy Perl datatypes
p5-DBD-mysql-4.041  MySQL drivers for the Perl DBI
p5-DBI-1.633        unified perl interface for database access
p5-FreezeThaw-0.5001 module for converting structures to strings and back
p5-MLDBM-2.05       store multi-level hash structure in single-level tied hash
p5-Math-Base-Convert-0.08 very fast base to base conversion
p5-Module-Runtime-0.014 runtime module handling
p5-Net-Daemon-0.48p0 extension for portable daemons
p5-Params-Util-1.07p1 utility to make parameter checking easier
p5-PlRPC-0.2020     module for writing rpc servers and clients
p5-SQL-Statement-1.407 SQL parsing and processing engine
php-7.0.12          server-side HTML-embedded scripting language
php-mysqli-7.0.12   mysql database access extensions for php5
quirks-2.271        exceptions to pkg_add rules
xz-5.2.2p0          LZMA compression and decompression tools
Reply With Quote
Old 10th December 2016
agshekeloh agshekeloh is offline
Real Name: Michael W Lucas
Port Guard
 
Join Date: Jul 2008
Location: Detroit, MI
Posts: 21
Default

OK, I've got /var/www/etc/hosts, localtime, services, and resolv.conf

MySQL is accessible in the chroot, as /var/www/var/run/mysql/mysql.sock.

httpd.conf is:
Code:
public_ip="192.0.2.101"
public_ip6="::"

chroot "/var/www"

server "default" {
        root "/default"
        listen on $public_ip port 80
        listen on $public_ip6 port 80
}

include "/etc/sites/site12.conf"

types {
        include "/usr/share/misc/mime.types"
}
site12.conf:
Code:
server "site12.mwlucas.org" {
        include "/etc/global-httpd.conf"
        root "/site12"
        directory index index.php
        location "*.php" {
                fastcgi socket "/run/php-fpm.sock"
        }
}
Do you have anything notably different?

Last edited by ocicat; 10th December 2016 at 02:16 PM. Reason: Please use [code] & [/code] tags when posting file contents.
Reply With Quote
Old 10th December 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,944
Default

The htttp.conf is extraordinarily simple.
Code:
$ cat /etc/httpd.conf                                                                                                                                
server "mwl.lab" {
        listen on * port 80
        listen on * tls port 443
        directory auto index
        location "*.php" {
                fastcgi socket "/run/php-fpm.sock"
        }
}
The MariaDB server was installed with /usr/local/bin/mysql_install_db and configured with /usr/local/bin/mysql_secure_installation before moving the socket into the chroot per the pkg-readme document.

PHP needed a link to configure mysqli.ini, per the PHP pkg-readme document.
Reply With Quote
Old 3rd January 2017
agshekeloh agshekeloh is offline
Real Name: Michael W Lucas
Port Guard
 
Join Date: Jul 2008
Location: Detroit, MI
Posts: 21
Default

Following up for the archives:

I traced this back to three old firewall rules and a rogue symlink. Thanks to jggimi for providing a "known working" image.

If all else fails in troubleshooting your httpd, chroot /bin/sh.
Reply With Quote
Reply

Tags
httpd, wordpress

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Security New WordPress vuln emerges J65nko News 0 28th December 2012 10:51 AM
NGINX/PHP-FPM wordpress issue scrummie02 OpenBSD General 5 23rd December 2012 08:41 AM
WordPress 3.3 approaches with first release candidate J65nko News 0 1st December 2011 03:23 PM
Problems with TinyMCE / Wordpress sampler OpenBSD Packages and Ports 6 18th August 2010 01:30 PM
WordPress 3.0 nearly complete J65nko News 0 9th June 2010 06:28 PM


All times are GMT. The time now is 11:39 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick