HowTo install Wordpress on NethServer

intermediate
application

(Stéphane de Labrusse) #1

#Nethserver-wordpress

Nethserver-wordpress is a rpm integration to install wordpress from epel to Nethserver

Maintainer

Stéphane de Labrusse stephdl@de-labrusse.fr

Installation

Enable Nethforge repository following http://dev.nethserver.org/projects/nethforge/wiki/NethForge#Enable-NethForge-repository

Install nethserver-wordpress

yum install --enablerepo=nethforge nethserver-wordpress

Each time you want to reconfigure the contrib you can do

signal-event nethserver-wordpress-update

Once installed You have to point your browser to the url http://url/wordpress and set all informations needed.

Options

You have some db which allows to use specific settings

 # config show wordpress



wordpress=configuration
     MaxExecutionTime=60
     MemoryLimit=128M
     PostMaxSize=32M
     UploadMaxSize=8M
     WebFilesMod=enabled    #used to allow upgrade files&folder with the backend
     access=public          #You can restrict to your local network or be opened to all (public/private) 
     status=enabled         #you can disabled completely worpdress (enabled/disabled)

If you want to change something, for example (don’t forget M which means megabytes)

config setprop wordpress UploadMaxSize 10M
 signal-event nethserver-wordpress-update

You have also some hidden db :

If you want to force all users to renew their authentications each time you do a signal-event (enabled/disabled)

config setprop wordpress Salt enabled
 signal-event nethserver-wordpress-update

If you want to enable the ‘Debug’ mode of wordpress (enabled/disabled)

config setprop wordpress Debug enabled
 signal-event nethserver-wordpress-update

If you want that all themes & plugins can be updated automatically (enabled/disabled)

config setprop wordpress AutomaticUpdater enabled
 signal-event nethserver-wordpress-update

If you want to use another name instead of ‘wordpress’ (http://url/wordpress), the older ‘wordpress’ is not removed

config setprop wordpress URL foldername
 signal-event nethserver-wordpress-update

Source repository

Here the source : https://github.com/stephdl/nethserver-wordpress


Wordpress Nethserver package
Virtualhost mapped to WordPress multisite sub-domains
Virtualhost mapped to WordPress multisite sub-domains
Nextcloud inside virtualhost
Web Server Manual
Wordpress uninstall/reinstall
(Vasco) #2

Hi @stephdl

Can you confirm the address of the nethforge repo?

When I try to add I have the following error:
Error getting repository data for nethforge-testing, repository not found


I need wordpress module in NS7
(Stéphane de Labrusse) #3

try nethforge


(Vasco) #4

same error in nethforge


(Vasco) #5

Already installed

Followed this document

http://dev.nethserver.org/projects/nethforge/wiki/NethForge#Enable-NethForge-repository

Many thanks


(Vasco) #6

Hi @stephdl

I setup wordpress without any problem and it is working

I tried to change the MemoryLimit parameter but without success.

The command was

config setprop wordpress MemoryLimit 512M
signal-event nethserver-wordpress-update

As a workaround changed the php.ini and is working but eventually will be reconfigured.

There is another way to change the value?

Also, I updated to the last version using the manual update instructions from the wordpress website.
I didn’t find any problem until now.


(Alessio Fattorini) #7

Maybe @stephdl could take a look :wink:


(Stéphane de Labrusse) #8

sorry I misunderstood if I set the same command as you

config setprop wordpress MemoryLimit 512M
signal-event nethserver-wordpress-update

i can find this in /etc/httpd/conf.d/wordpress.conf

#------------------------------------------------------------
# wordpress  weblog
#------------------------------------------------------------

Alias  /wordpress  /usr/share/wordpress

<Directory /usr/share/wordpress>
    AddType application/x-httpd-php .php
    php_admin_value open_basedir /usr/share/wordpress:/etc/wordpress:/usr/share/pear:/usr/share/php/
    Options None
    order deny,allow
    deny from all
    allow from all
    php_admin_value post_max_size 32M
    php_admin_value upload_max_filesize 8M
    php_admin_value memory_limit 512M
    php_admin_value max_execution_time 60
    php_admin_value upload_tmp_dir /usr/share/wordpress/tmp
</Directory>


<Directory /usr/share/wordpress/wp-content/plugins/akismet>
  <FilesMatch "\.(php|txt)$">
    Order Deny,Allow
    Deny from all
  </FilesMatch>
</Directory>

and at the end in /var/log/messages i can see that httpd is reloaded

May 18 14:29:37 nethserver-dev esmith::event[21323]: [INFO] service httpd reload
May 18 14:29:37 nethserver-dev esmith::event[21323]: Reloading httpd: 
May 18 14:29:37 nethserver-dev esmith::event[21323]: [INFO] httpd reload
May 18 14:29:37 nethserver-dev esmith::event[21323]: Action: /etc/e-smith/events/actions/adjust-services SUCCESS [0.339971]
May 18 14:29:37 nethserver-dev esmith::event[21323]: Event: nethserver-wordpress-update SUCCESS

I don’t understand why you say that the php memory is not set ??? how did you see that, it is not for the whole server, only for this virtualhost of apache


(Vasco) #9

I can not find find the .htaccess file of wordpress.
Can you tell me where is located?


(Stéphane de Labrusse) #10

Not sure it is a good idea to mix the installation

The epel version of wordpress gets some part removed for proprietary licenses, that can bring to issues if you update to the latest version. I do agree that a manual installation can be superior because you can adjust precisely to your needs, but at least you don’t need this module :smile:

I would be more interested to upgrade from the version of remi, if you want to have a go, if all is well we could upgrade from it, anyway, centos6 looks old now, time to move on

http://rpms.famillecollet.com/enterprise/6/remi/x86_64/repoview/wordpress.html


(Vasco) #11

When I use

config show wordpress

I have always have the value 128M
Same in /etc/httpd/conf.d/wordpress.conf


(Stéphane de Labrusse) #12

no needs, I don’t provide a rpm for wordpress, I just bring customisations to install it


(Stéphane de Labrusse) #13

retry your db command , here I have

# config show wordpress
wordpress=configuration
    MaxExecutionTime=60
    MemoryLimit=512M
    PostMaxSize=32M
    UploadMaxSize=8M
    WebFilesMod=enabled
    access=public
    status=enabled

(Stéphane de Labrusse) #14

it seems ok for me, just add

yum install http://rpms.famillecollet.com/enterprise/6/remi/x86_64/wordpress-4.2.2-1.el6.remi.noarch.rpm
signal-event nethserver-wordpress-update

I will do a bug to see if it is possible to import it.


(Vasco) #15

Ok
I wll try that with a clean install of Nethserver and post the result


(Vasco) #16

Now all I need to know is where is located the .htaccess file from wordpress.

I need to make a change related with a plugin,
The plugin can not make the change because the file as only read permissions


(Stéphane de Labrusse) #17

try to add it /usr/share/wordpress, the packager of wordpress doesn’t add it

and set apache permission on it if you have issue, but after that you need to do a custom template and allow in /etc/httpd/conf.d/wordpress.conf the option ‘allowoveride all’


(Vasco) #18

Ok, I will try and post


(Stéphane de Labrusse) #19

I missed something maybe that could be a bug

this is the wordpress.conf of the rpm packager, you can see that an ‘allowoverride options’ is set
Alias /wordpress /usr/share/wordpress

<Directory /usr/share/wordpress>
  AllowOverride Options
  <IfModule mod_authz_core.c>
    # Apache 2.4
    Require local
  </IfModule>
  <IfModule !mod_authz_core.c>
    # Apache 2.2
    Order Deny,Allow
    Deny from All
    Allow from 127.0.0.1
    Allow from ::1
 </IfModule>
</Directory>

<Directory /usr/share/wordpress/wp-content/plugins/akismet>
  <FilesMatch "\.(php|txt)$">
    Order Deny,Allow
    Deny from all
  </FilesMatch>
</Directory>

please edit the file

vim /etc/e-smith/templates/etc/httpd/conf.d/wordpress.conf/10Conf

and change

  $OUT .= "    Options None\n";

to

  $OUT .= "    AllowOverride Options \n";

then do

signal-event nethserver-wordpress-update

and add a .htaccess to /usr/share/wordpress


(Stéphane de Labrusse) #20

@vcc please try my new rpm, you will need to enable epel OR nethforge to retrieve dependencies

yum install http://mirror.de-labrusse.fr/nethserver/nethserver-wordpress/nethserver-wordpress-1.0.0-3.ns6.noarch.rpm http://mirror.de-labrusse.fr/nethserver/nethserver-wordpress/wordpress-4.2.2-1.el6.remi.noarch.rpm --enablerepo=epel,nethforge

I corrected my bug, you should be able to enable the .htaccess policy and you will have the most uptodate rpm of wordpress