Tuesday, 17 April 2018

การ Setup apache ให้กับ wordpress


ที่ httpd.conf

<Directory {path_ของ_wp_src}>
        Options Indexes FollowSymLinks ไม่ให้เห็น file listing หรือที่เรียกว่า Directory listing สมัยก่อน
        AllowOverride None All เปิดเพื่อให้ Permalink ใช้งานได้
        Require all granted
</Directory>

ที่ wp-config.php
define('WP_PROXY_HOST','lO.l$l.lg.g$');
define('WP_PROXY_PORT', 'Bl2e');
define('WP_PROXY_BYPASS_HOSTS', 'localhost');
define( 'WP_MEMORY_LIMIT', '512M' );

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_CONTENT_DIR','/appstore/modelanddispatch/wp-content');
define( 'WP_POST_REVISIONS', 5 );
define( 'WP_PAGE_REVISIONS', 5 );

define( 'AUTOSAVE_INTERVAL', 60*60*60*24*365 ); // autosave 1x per year
define( 'EMPTY_TRASH_DAYS',  0 ); // zero days

พบปัญหาการ auto save แล้ว keep  revision ไว้น้อย
ทำให้การ restore หา version เก่าที่ขึ้น prod ไป ไม่เจอ เพราะถูก autosave หมด

กรณี Restart หากทำเป็น Service ไว้
systemctl restart apache.service

ส่วนของ UNIX ให้ดำเนินการดังนี้
export http_proxy=http://server-ip:port/