Wordpress at Pi IP, webroot

Pardon what is likely a simple question. I have a clean install on a PI and just installed Wordpress with lighttpd. What do I need to change so that wordpress responds on a browser to http://RPi-IP (basically port 80 in place of the lighttpd generic page)?

Thanks in advance.

You can create a redirect, right now you can reach it via /wordpress.

You need to create a new config file, for e.g.
/etc/lighttpd/conf-enabled/99-wodpress-redirect.conf
with the content:

$SERVER["socket"] == ":80" {
  url.redirect = ( "" => "http://IP_of_PI/wordpress" )
}

You can also do that on domain level with $SERVER["host"],
see also: Mod redirect - Lighttpd - lighty labs

Or you could change your server.document-rootin /etc/lighttpd/lighttpd.conf to /var/www/wordpress I think :thinking:

Thanks. This didn’t work because it broke subsequent links internal to Wordpress. I’ll try the other options.

Probably you have to change the site-URL inside wordpress too. :thinking:

But the redirect should also do it.

Yeah, I thought that as well, but I can’t get in if I do the document root. I think I need to change the site URL and then document root.

You can change directly in the file wp-config.php.

Maybe easier doing it on the WP admin settings

I did bare metal minimal reinstall (technically a restore of a backup I made earlier) and installed WP from the dietpi-software optimizer again and oddly now going to the RPI’s IP only takes me to the WP install.

you have that configuration still active?

No, I assume that was cleared out when I did the restore.

did you close your browser? Or cleared the cache? As well double check the config file did not exist.

Different browser. Verified, restored a backup I made immediately after a minimal dietpi install. So it was clean and none of the proposed changes remain.

From the minimal install, I selected WP from dietpi-software and followed though, auto installing the webstack and selecting lighttpd. After that, going to 10.10.1.10 works correctly and takes me to the WP install.

UPDATE: Tried a different browser again and not working, back to default lighttpd placeholder.

1 Like

using the IP address only, without sub path, should open the lighttpd placeholder page.

It wasn’t, but it is now. So I’m back to square one. The question now, again, is how replace that with the WP install?

Go into WP admin settings (web site) and adjust the default URL/path. Once done, you can change server.document-root within lighttpd.conf. Don’t forget to restart web server afterwards.

1 Like

Thanks.

A) That was ridiculously easy.
B) I should have seen that, but it’s been a while since I did a bare metal WP install.

1 Like

This is a partial solution. Seems I can get to the main WP page but no longer any others like wp-login.php. Seems like something else it needed.

It would be nifty of there was a option to configure this as part of the diet-pi software install of WP and the webstack. I’ll have to post that separately.

About to give up on this experiment.

Let me clarify a use case:

I’m testing out an application of Cloudflare Zero Trust. When setting up the tunnel on the Cloudflare side, I need to be able to point to a device on my local network–in this case a Pi Zero W running WP for a very basic website. I can either point it to the Pi’s local IP for the tunnel, in which case it will default to Port 80 OR specify a port.

So, I either need to configure the webserver on the PI to serve the WP install on Port 80 or specific a different port to access the WP install.

How would I best go about doing this?

NOTE: I could run FuguHub as a test case, since it will install on the Pi Zero and defaults to Ports 80/443.

just to avoid a misunderstanding. All our web server apps will run on port 80 by default. What you are looking for is to remove / avoid the sub path to be added. But this has nothing to do with the port the web server is LISTEN on.

Okay, fair point. My error.

I did try adding a 99-wordpress.conf file to conf-enabled for lighttpd with the following:

server.modules += ( "mod_alias" )
alias.url = ( "/" => "/var/www/wordpress/" )

This mostly worked, but trying to get back to a working wp-login.php fails.