Difference between revisions of "Wordpress"

From PostgreSQL_wiki
Jump to: navigation, search
(Installeer website)
(multi site)
 
(2 intermediate revisions by the same user not shown)
Line 37: Line 37:
 
These unique authentication keys are also missing from your /etc/wordpress/config-zevendehemel.nl.php file. To make your installation more secure, you should also add:
 
These unique authentication keys are also missing from your /etc/wordpress/config-zevendehemel.nl.php file. To make your installation more secure, you should also add:
 
<pre>
 
<pre>
define( 'AUTH_KEY', '****************************' );
+
define( 'AUTH_KEY', '****************************' );
define( 'SECURE_AUTH_KEY', ''****************************'' );
+
define( 'SECURE_AUTH_KEY', ''****************************'' );
define( 'LOGGED_IN_KEY', ''****************************'' );
+
define( 'LOGGED_IN_KEY', ''****************************'' );
define( 'NONCE_KEY', ''****************************'' );
+
define( 'NONCE_KEY', ''****************************'' );
define( 'AUTH_SALT', ''****************************'' );
+
define( 'AUTH_SALT', ''****************************'' );
define( 'SECURE_AUTH_SALT', ''****************************'' );
+
define( 'SECURE_AUTH_SALT', ''****************************'' );
define( 'LOGGED_IN_SALT', ''****************************'' );
+
define( 'LOGGED_IN_SALT', ''****************************'' );
define( 'NONCE_SALT', ''****************************'' );
+
define( 'NONCE_SALT', ''****************************'' );
 
</pre>
 
</pre>
   
 
Add the following to your /etc/wordpress/htaccess file, replacing other WordPress rules:
 
Add the following to your /etc/wordpress/htaccess file, replacing other WordPress rules:
 
<pre>
 
<pre>
  +
RewriteEngine On
  +
RewriteBase /
  +
RewriteRule ^index\.php$ - [L]
  +
  +
# add a trailing slash to /wp-admin
  +
  +
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
  +
  +
RewriteCond %{REQUEST_FILENAME} -f [OR]
  +
RewriteCond %{REQUEST_FILENAME} -d
  +
RewriteRule ^ - [L]
  +
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
  +
RewriteRule ^(.*\.php)$ $1 [L]
  +
RewriteRule . index.php [L]
  +
</pre>
  +
== /etc/wordpress/htaccess ==
  +
##
  +
## Configuration for a multi-site wordpress installation using subdomains
  +
##
  +
<IfModule mod_rewrite.c>
 
RewriteEngine On
 
RewriteEngine On
 
RewriteBase /
 
RewriteBase /
Line 62: Line 82:
 
RewriteRule ^(.*\.php)$ $1 [L]
 
RewriteRule ^(.*\.php)$ $1 [L]
 
RewriteRule . index.php [L]
 
RewriteRule . index.php [L]
</pre>
+
</IfModule>
   
 
= Install =
 
= Install =

Latest revision as of 15:12, 16 March 2013

Installeer website

Op de server is de benodige code van Wordpress aanwezig in /usr/share/wordpress.
Eerst de database voorbereiden:

Er is reeds een lege database aangemaakt met de volgende rechten:
mysql> create database webhuis_nl;
mysql> grant all on webhuis_nl.* to gebruker identified by "geheim";
mysql> grant all on webhuis_nl.* to gebruiker@localhost identified by "geheim";
mysql> flush privileges;

Daarna de voorbereiding van de webserver:

root@host:~# vi /etc/apache2/sites-available/test2.webhuis.nl.conf
root@host:~# mkdir /var/www/webhuis.nl
root@host:~# a2ensite -> enable test2.webhuis.nl
root@host:~# /etc/init.d/apache2 reload

Als laatste volgt de wordpress code voor de website.

root@host:~# cp -a /usr/share/wordpress/* /var/www/webhuis.nl/

multi site

Multi site vereist per een aantal instellingen om het geheel werkend te krijgen. Doe je dat niet dan gaan alle sites op wit. Add the following to your /etc/wordpress/config-domain.nl.php file:

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'test.domain.nl');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
   These unique authentication keys are also missing from your /etc/wordpress/config-zevendehemel.nl.php file. To make your installation more secure, you should also add:
define( 'AUTH_KEY', '****************************' );
define( 'SECURE_AUTH_KEY', ''****************************'' );
define( 'LOGGED_IN_KEY', ''****************************'' );
define( 'NONCE_KEY', ''****************************'' );
define( 'AUTH_SALT', ''****************************'' );
define( 'SECURE_AUTH_SALT', ''****************************'' );
define( 'LOGGED_IN_SALT', ''****************************'' );
define( 'NONCE_SALT', ''****************************'' );
   Add the following to your /etc/wordpress/htaccess file, replacing other WordPress rules:
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin

RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

/etc/wordpress/htaccess

    1. Configuration for a multi-site wordpress installation using subdomains

<IfModule mod_rewrite.c>

   RewriteEngine On
   RewriteBase /
   RewriteRule ^index\.php$ - [L]
   # add a trailing slash to /wp-admin
   RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
   RewriteCond %{REQUEST_FILENAME} -f [OR]
   RewriteCond %{REQUEST_FILENAME} -d
   RewriteRule ^ - [L]
   RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
   RewriteRule ^(.*\.php)$ $1 [L]
   RewriteRule . index.php [L]

</IfModule>

Install

Voer op een kale server het volgende commando uit:

root@twhz-210:~# apt-get install wordpress mysql-server

Dit commando installeert alles inclusief apache, mysql, php en modules.


Terug naar: Webhuis Infrastructuur