Mikem22
Posts: 6
Joined: Sat Apr 16, 2016 12:04 pm

editing Wordpress files on Pi

Fri Nov 02, 2018 9:32 am

I have a Wordpress website installed on my Pi3 which has Access Point setup to drive a camera timelapse rail rig. Is there an easy way to edit the Wordpress files from my Windows10 desktop via my Virgin Super Hub or any other way come to that? I would like to use Notepad++ for the editing.

Andyroo

Re: editing Wordpress files on Pi

Fri Nov 02, 2018 3:37 pm

Which files specifically? Any any reason for Notepad++ rather than a Linux editor?

Posts and pages are best edited in WP (either TinyMCE or other theme editor)

If it’s config files or program files then you need to sort out the security of the install folders first :evil:

By default, the web site folders are owned by www-data as a user and group and changing these increases security risks for your site.

Sharing files from Linux is possible with many options, ftp, sftp, samba etc.

Mikem22
Posts: 6
Joined: Sat Apr 16, 2016 12:04 pm

Re: editing Wordpress files on Pi

Fri Nov 02, 2018 7:15 pm

I'd like to tweak the contents pages and possibly one of the python script files.
The reason for Notepad++ is because I'm used to that and it is more convenient to be able to use my windows 10 desktop pc, avoids the need to remove the Pi from the enclosure it is in together with the battery packs, motor driver etc., which is the only way I can connect a monitor, keyboard and mouse directly to the Pi.

The setup was running fine using an original Pi B with with an external TP-Link TL-WR702N router as an Access Point, then it decided to not to allow me to login anymore. I gave up trying to 'fix' it after many attempts and purchased a Pi 3 and got that working after several attempts. I need not install bridging as everytime I tried I failed to get it to work. I guess you can appreciate I would prefer not to tamper with the Pi setup.

The Pi wifi access is protected by password.

I guess I will end up recreating the website locally on my desktop get it working to my liking locally and and then up load it with FileZilla or WinSCP or similar, which is what I did originally

But I will look at your suggestion to try TinyMCE etc.

Thanks for the advice.

User avatar
DougieLawson
Posts: 36578
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: editing Wordpress files on Pi

Fri Nov 02, 2018 7:48 pm

Andyroo wrote:
Fri Nov 02, 2018 3:37 pm
By default, the web site folders are owned by www-data as a user and group and changing these increases security risks for your site.
Add the pi userid to the www-data group to get over that problem (as long as the files and folders have 664 (-r-wr-wr--) and 775 (drwxrwxrx) respectively you'd be able to edit them).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Andyroo

Re: editing Wordpress files on Pi

Fri Nov 02, 2018 9:27 pm

DougieLawson wrote:
Fri Nov 02, 2018 7:48 pm
Andyroo wrote:
Fri Nov 02, 2018 3:37 pm
By default, the web site folders are owned by www-data as a user and group and changing these increases security risks for your site.
Add the pi userid to the www-data group to get over that problem (as long as the files and folders have 664 (-r-wr-wr--) and 775 (drwxrwxrx) respectively you'd be able to edit them).
Assuming he has changed the default password :D but yep that’s Less risky than some ideas I’ve seen on here esp. if using a complex password...

Most WP sites are php not python.

One easy way I stumbled across tonight (from a Mac to be honest) is to use FileZilla with the Pi connected by SFTP as user pi and change the editor to one of your own choosing. You can then navigate to the folder from your pc, find the file, edit and save back to your hearts content.

Never twigged on me as I normally use FZ on ftp sites out of the local lan :oops:

User avatar
DougieLawson
Posts: 36578
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: editing Wordpress files on Pi

Fri Nov 02, 2018 9:37 pm

FZ needs a userid with write to the files and directories. So my suggestion still holds.

You could, add an additional userid with the same UID number as www-data and /bin/bash as a shell. You could then, effectively, login as www-data.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Mikem22
Posts: 6
Joined: Sat Apr 16, 2016 12:04 pm

Re: editing Wordpress files on Pi

Fri Nov 02, 2018 10:57 pm

Thanks for all this.
Yep, I did change the default password.
A php file calls in a python script that actuates the motor and triggers the shutter for the times, speed and frequency, and these settings can be changed within the website.
It's a VERY long time since I did any Unix type scripts but I do recognise the changing of permissions, but recognise doesn't mean I can remember what they mean, so sorry to say it's all a bit Martian to me now :)

Return to “Beginners”