| 39 | |
| 40 | Edit the WordPress configuration for Apache in /etc/httpd/conf.d/wordpress: |
| 41 | {{{ |
| 42 | <VirtualHost *:80> |
| 43 | ServerName dev.jorritsma.cc # network host |
| 44 | #LogLevel debug |
| 45 | |
| 46 | DocumentRoot /usr/share/wordpress |
| 47 | <Directory /usr/share/wordpress> |
| 48 | AllowOverride Options |
| 49 | <IfModule mod_authz_core.c> |
| 50 | # Apache 2.4 |
| 51 | #Require local |
| 52 | Require all granted |
| 53 | </IfModule> |
| 54 | <IfModule mod_rewrite.c> |
| 55 | # add a trailing slash to /wp-admin |
| 56 | RewriteRule ^wp-admin$ wp-admin/ [R=301,L] |
| 57 | RewriteCond %{REQUEST_FILENAME} -f [OR] |
| 58 | RewriteCond %{REQUEST_FILENAME} -d |
| 59 | RewriteRule ^ - [L] |
| 60 | RewriteRule ^(wp-(content|admin|includes).*) $1 [L] |
| 61 | RewriteRule ^(.*\.php)$ $1 [L] |
| 62 | RewriteRule . index.php [L] |
| 63 | </IfModule> |
| 64 | </Directory> |
| 65 | |
| 66 | <Directory /usr/share/wordpress/wp-content/plugins/akismet> |
| 67 | <FilesMatch "\.(php|txt)$"> |
| 68 | Order Deny,Allow |
| 69 | Deny from all |
| 70 | </FilesMatch> |
| 71 | </Directory> |
| 72 | |
| 73 | # stop the xmlrpc spam / ddos |
| 74 | <Files "xmlrpc.php"> |
| 75 | Order Deny,Allow |
| 76 | Deny from all |
| 77 | </Files> |
| 78 | |
| 79 | <Directory /usr/share/wordpress/wp-admin> |
| 80 | <IfModule mod_authz_core.c> |
| 81 | # Apache 2.4 |
| 82 | Require local |
| 83 | #Require ip 83.162.221.129 |
| 84 | Require all granted |
| 85 | </IfModule> |
| 86 | </Directory> |
| 87 | </VirtualHost> |
| 88 | }}} |