Starting Mariadb/Wordpress results in '403 Forbidden'

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
Nuor
DD-WRT User


Joined: 20 Apr 2015
Posts: 175

PostPosted: Wed Apr 02, 2025 17:18    Post subject: Starting Mariadb/Wordpress results in '403 Forbidden' Reply with quote
I attempted to use the instructions found here but failed in the final step. starting wordpress.

I am able to install and create a wordpress database in mariadb but any attempt to start the wordpress setup/install results in a "Forbidden 403" message.

Is something special required to start wordpress install?
attempting to connect using "http://my_ip_addr:81/wordpress" or various other permutations fail.

R9000 on r60137
entware installed on /opt mounted to ext4 harddrive
lighttpd default server on ports 81/443
using php8 from entware install.

Code:

server.dir-listing           = "enable"
server.tag                    = "lighttpd/1.4.75"
server.bind                  = "0.0.0.0"
server.port                  = 81
server.document-root         = "/jffs/www"

...

fastcgi.debug       = 0
fastcgi.server = (".php" =>
   ( "localhost" =>
      ( "socket" => "/tmp/php-fcgi.sock",
      #"bin-path" => "/usr/bin/php-cgi", #default
      "bin-path" => "/opt/bin/php-cgi",
      "max-procs" => 1,
      "bin-environment" =>
         (
         "PHP_FCGI_CHILDREN" => "2",
         "PHP_FCGI_MAX_REQUESTS" => "500"
         )
      )
   )
)

#$HTTP["host"] =~ "(^|.)wordpress.example.com$" {
$HTTP["url"] =~ "^/wordpress($|/)" {
   server.document-root = "/jffs/www/wordpress",
   url.access-deny = (""),
   setenv.set-response-header += ( "Strict-Transport-Security" => "max-age=63072000; includeSubDomains" )
}
...



All attempts to start any .php file inside '/jffs/www/wordpress' results in the 'Forbidden 403' message. If I remove the wordpress code from lighttpd.conf I get nothing not even 'Forbidden 403'. I have reviewed a dozen tutorials on installing wordpress on lightpd. All seem to closely echo what is stated above basically install mysql/mariadb, create database, unzip wordpress to desired location, point browser to that location and wordpress starts.

I feel I am missing something basic about wordpress install.

I am confident lighttpd is working as nextcloud and phpmyadmin both run fine when I start them from /jffs/www/... only wordpress php's give this error.

This seems like a permissions error to me but all file permissions look correct 755/644.

I've tried various different server.document-root locations.

If anyone has successfully done this I'd appreciate some help in this last step.

btw no logs (lighttpd, wordpress, php) I've scanned seem to indicate anything useful. but maybe I'm looking at wrong ones.

thanks
Sponsor
Nuor
DD-WRT User


Joined: 20 Apr 2015
Posts: 175

PostPosted: Sat Apr 12, 2025 22:19    Post subject: Reply with quote
I managed to get this running. It took me many down many different paths and if I knew exactly why it is working now I'd document it for future users but I can't. One potential issue may have been a problem with the php server (confusion with different doc root paths between Nextcloud and wordpress?). I seemed to get it fully working after starting up an additional php-fpm server on unix:/opt/var/run/php8-fpm.sock and using that instead of the default php-cgi server on 127.0.0.1:9000. But I made various other changes along the way so I've no real confidence in that as the initial cause.

Whatever the cause, I've tested with lighttpd and nginx and both now appear to work for both remote and local use.

Good luck to any of you trying this in the future.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum