wordpress
This is an old revision of the document!
Common Wordpress Issues
Wordpress Permissions
Replace ${WP_ROOT} with the directory location of wordpress. If you are already in the wp document root, replace with a dot .
1 2 3 |
find ${WP_ROOT} - exec chown :apache {} \; find ${WP_ROOT} - type d - exec chmod 755 {} \; find ${WP_ROOT} - type f - exec chmod 644 {} \; |
Changing Site URL
Check the current URL, first select the database with the 'use' command (eg. use live_database;):
1 |
SELECT * FROM wp_options WHERE option_name = 'siteurl' OR option_name = 'home' ; |
1 |
UPDATE wp_options SET option_value = 'http://notes.lukeslinux.co.uk' WHERE option_name = 'siteurl' OR option_name = 'home' ; |
.htaccess rewrite
Used for permalinks
1 2 3 |
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)\ HTTP/ [NC] RewriteCond %{HTTPS} !=on [NC] RewriteRule ^/?(wp-admin/|wp-login\.php) https: //mysite .com%{REQUEST_URI}%{QUERY_STRING} [R=301,QSA,L] |
wp-config FTP
1 2 3 4 5 6 7 8 9 10 |
define( 'FS_METHOD' , 'direct' ); define( 'FTP_BASE' , '/var/www/vhosts/example.com/httpdocs/' ); define( 'FTP_CONTENT_DIR' , '/var/www/vhosts/example.com/httpdocs/wp-content/' ); define( 'FTP_PLUGIN_DIR ' , '/var/www/vhosts/example.com/httpdocs/plugins/' ); #define('FTP_PUBKEY', '/var/www/vhosts/example.com/httpdocs/.ssh/id_rsa.pub'); #define('FTP_PRIKEY', '/var/www/vhosts/example.com/httpdocs/.ssh/id_rsa'); define( 'FTP_USER' , 'FTPusername' ); define( 'FTP_PASS' , 'FTPpassword' ); define( 'FTP_HOST' , 'localhost' ); define( 'FTP_SSL' , false ); |
Auto Install Plugins (without FTP/FTPs details)
vim /var/www/vhost/website/wp-config.php
1 |
define( 'FS_METHOD' , 'direct' ); |
XMLRPC
To prevent xmlrpc attacks add the following to a .htaccess
1 2 3 4 |
<Files "xmlrpc.php" > Order Allow,Deny deny from all < /Files > |
What is an xmlrpc attack?
xml-rpc can use system.multicall - this can be used to execute multiple methods inside a single request. This allows applications to pass multiple commands with one http request.
You could also use a plugin called JetPack to assist - more information to come soon
https://wordpress.org/plugins/jetpack/
wordpress.1457023221.txt.gz · Last modified: 2024/05/23 07:26 (external edit)