Anfängerfrage Wordpress  [GELÖST]

Locked
MikeDelta
Posts: 1
Joined: Tue 2. May 2017, 00:08

Anfängerfrage Wordpress

Post by MikeDelta »

Guten Abend,
ich beschäftige mich seit kurzem mit der Serveradministration in Verbindung mit KeyHelp.
Ich hätte eine Frage zu Wordpress in Verbindung mit Ubuntu 16.04.

Auf dem Server läuft eine Wordpress Instanz - leider schaffe ich es nicht die Berechtigungen soweit richtig zu setzen dass der User (in diesem Fall ich) es schafft Plugins zu installieren bzw. zu entfernen.
Die Verzeichnissberechtigungen sind okay (755) - ich bekomme die Fehlermeldung
"Installation failed: Could not create directory."

Nach Recherche im Netz habe ich folgendes gefunden :
http://wpnow.io/how-to-solve-wordpress- ... directory/ sowie
https://wordpress.org/support/topic/ins ... directory/

Ich habe dir Tutorials wirklich Step by Step befolgt und diverse weitere Alternativen im Netz - leider bin ich nicht fündig geworden.
Vielleicht kann mir jemand mal den Weg weisen :)

Danke
User avatar
Martin
Posts: 984
Joined: Wed 20. Jan 2016, 00:43

Re: Anfängerfrage Wordpress  [GELÖST]

Post by Martin »

Hallo,

wenn Wordpress per FTP hochgeladen wurde, und somit die Dateien dem korrekten Benutzer gehören, so sollten die Dateien und Ordner automatisch die korrekten Berechtigungen aufweisen.
Probleme dürfte es hier eigentlich nur geben, wenn das Wordpress z.B. als User root im Verzeichnis des Benutzers abgelegt wurde und nachfolgend die Dateieigentümerschaft nicht korrigiert wurde.
Viele Grüße,
Martin
longjohn
Posts: 1
Joined: Sat 14. Mar 2020, 21:48

Re: Anfängerfrage Wordpress

Post by longjohn »

The topic is old but it's needed for beginners, like me.

Issues the with owner on wordpress files/folders:

For my first use of keyhelp I've used the skel folder to install default wordpress files.
Because the upload of the files in "/etc/keyhelp/skel" needs a root account.
This then also means when you get your files installed owned by root:root

using SSH with root user and simple add this command:
Note: use the username not!!! your admin login_name!!

Code: Select all

cd /home/users/<your_keyhelp_username>/

Code: Select all

sudo chown <your_keyhelp_username>:<your_keyhelp_username> -R /home/users/<your_keyhelp_username>
then hit ENTER

Tip:
If the Skel option doesn't work you can do it manually:
I've made a folder called wordpress where default wordpress, plugins, and theme are uploaded.

Code: Select all

cd /etc/keyhelp/skel/wordpress
<enter>

Code: Select all

cp -r ./ /home/users/<your_keyhelp_username>/www/
!!! remember to do the steps above for CHOWN when the copy is ready!!!

I hope that the newbies (like me) will have less trouble fixing the issues to get starting.
Before my multi domain wordpress, VPS was finally working there where 4 times a reinstall server.
This due to the lack of finding sollutions on the forum and started googling, adding, upgrading the server and then finding out that KeyHelp couldn't work with the changes made to the system.
User avatar
Alexander
Keyweb AG
Posts: 3842
Joined: Wed 20. Jan 2016, 02:23

Re: Anfängerfrage Wordpress

Post by Alexander »

.
DO NOT DO THIS:
longjohn wrote: Mon 16. Mar 2020, 12:40

Code: Select all

cd /home/users/<your_keyhelp_username>/

Code: Select all

sudo chown <your_keyhelp_username>:<your_keyhelp_username> -R /home/users/<your_keyhelp_username>
then hit ENTER

DO THIS:
Have a look into a typical directory of a KeyHelp user, some directories needs to be in the www-data group in order to work like expected.
Rather than chown-ing the whole user folder, just chown the WordPress folder, or /home/users/<USERNAME>/www/!

For my first use of keyhelp I've used the skel folder to install default wordpress files.
Because the upload of the files in "/etc/keyhelp/skel" needs a root account.
This then also means when you get your files installed owned by root:root
Sounds like a Bug, i will check tomorrow. -> I checked it, and everything is okay, files belongs to the new user, not the root user. No bug present.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
User avatar
george
Posts: 88
Joined: Fri 3. Jan 2020, 05:53
Location: AUSTRALIA

Re: Anfängerfrage Wordpress

Post by george »

Hope this may help. I use the following one liner in crontab for this task.

Code: Select all

rm -r /etc/keyhelp/skel/wordpress && curl https://wordpress.org/latest.tar.gz | tar -xz  -C /etc/keyhelp/skel/ && cp -r /home/users/myuser/www/maindomain.com/wp-content/plugins/* /etc/keyhelp/skel/wordpress/wp-content/plugins && chown -R nobody.nogroup /etc/keyhelp/skel/wordpress/wp-content/plugins/*
This is what the commands do:

Removes previous version, retrieves latest Wordpress, then extracts it to skel

Code: Select all

rm -r /etc/keyhelp/skel/wordpress && curl https://wordpress.org/latest.tar.gz | tar -xz  -C /etc/keyhelp/skel/
Copies plugins from a "master" site (which has all plugins up-to-date) to skel

Code: Select all

cp -r /home/users/myuser/www/maindomain.com/wp-content/plugins/* /etc/keyhelp/skel/wordpress/wp-content/plugins
Correct ownership for skel

Code: Select all

chown -R nobody.nogroup /etc/keyhelp/skel/wordpress/wp-content/plugins/*
Upon new domain setup, the directories/files will all have the correct owner/group.
Locked