[vc_row][vc_column][vc_toggle title=”warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory” style=”simple” custom_font_container=”tag:h2|font_size:16|text_align:left” custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]vi /etc/environment

add these lines…


https://gist.github.com/jampajeen/841d4eed4da3e6c758bf[/vc_toggle][vc_toggle title=”How to create and extract zip, tar, tar.gz and tar.bz2 files in Linux” style=”simple” color=”blue” custom_font_container=”tag:h2|font_size:16|text_align:left” custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]


This format is my weapon of choice for most compression. It gives very good compression while not utilizing too much of the CPU while it is compressing the data. To compress a directory use the following syntax:

tar -zcvf archive_name.tar.gz directory_to_compress

To decompress an archive use the following syntax:

tar -zxvf archive_name.tar.gz

This will extract the files in the archive_name.tar.gz archive in the current directory. Like with the tar format you can optionally extract the files to a different directory:

tar -zxvf archive_name.tar.gz -C /tmp/extract_here/

https://www.simplehelp.net/2008/12/15/how-to-create-and-extract-zip-tar-targz-and-tarbz2-files-in-linux/[/vc_toggle][vc_toggle title=”swapfile” style=”simple” color=”turquoise” custom_font_container=”tag:h2|font_size:16|text_align:left” custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]







但是,由于硬盘的 I/O 读写速度远不能和内存的读写速度相提并论(可能相差几十倍),使用Swap交换分区时,系统可能会变得特别缓慢、卡顿,甚至程序会出现错误。





# cd /var/


# dd if=/dev/zero of=swapfile bs=1M count=256


# /sbin/mkswap swapfile


# /sbin/swapon swapfile


# chmod 0644 /var/swapfile


# echo "/var/swapfile swap swap defaults 0 0" >> /etc/fstab


# free -m

出现 “Swap: 256” 字样表示设置成功。

修改 swappiness 默认值


首先查看下 swappiness 的默认值:

# cat /proc/sys/vm/swappiness


实际上,swappiness = 0 表示最大限度使用物理内存,然后才使用swap分区;swappiness = 100 表示系统积极的使用swap分区,然后才使用物理内存。

显然,这里我们需要降低 swappiness 的默认值。

# vi /etc/sysctl.conf

在里面添加 vm.swappiness=10 字段,然后退出保存。


# echo "vm.swappiness=10" >> /etc/sysctl.conf

然后 reboot 一下VPS即可。


[/vc_toggle][vc_toggle title=”VPS建站: LAMP搭建WordPress博客+优化安装教程 (Vultr & 搬瓦工VPS亲测)” style=”simple” color=”pink” custom_font_container=”tag:h2|font_size:16|text_align:left” custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]

http://www.seoimo.com/wordpress-vps/[/vc_toggle][vc_toggle title=”One-Click WordPress” style=”simple” color=”violet” custom_font_container=”tag:h2|font_size:16|text_align:left” custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]

App Details

WordPress runs on the CentOS 6 x64 operating system. You can log into this system with an SSH client using the root login found on your Vultr control panel.

Initially, you will need to access https://[SERVER_IP]/wp-admin/ in your web-browser. Substitute the [SERVER_IP] with the IP address of your VPS. The certificate warning can be safely ignored. Login credentials are sent to you in an email, and can also be found in your Vultr control panel. Once you have completed the WordPress setup, you can access your WordPress site at http://[SERVER_IP]/ or https://[SERVER_IP]/.

You may also want to point the DNS “A record” of your website to your [SERVER_IP]. This will allow you to access WordPress by navigating to your website (www.example.com). If you update your DNS record, be sure to edit your “WordPress Address (URL)” and “Site Address (URL)” to match your domain name. These settings are located in WordPress Admin (https://[SERVER_IP]/wp-admin/-> Settings -> General. Also, you will need to update the server_name attribute in the Nginx site configuration files, otherwise WordPress will be unable to send email. Follow these steps:

vim /etc/nginx/conf.d/wordpress_http.conf
# Change the server_name underscore "_" to your domain name.

vim /etc/nginx/conf.d/wordpress_https.conf
# Change the server_name underscore "_" to your domain name.

service nginx restart

Removing wp-admin Login Prompt

For servers created after 04/02/2015.

For security purposes, your WordPress app has an initial login prompt that opens when accessing the /wp-admin/ page. To remove this prompt, follow these steps.

  1. Login to your server using ssh as root.
  2. Create a backup of your vhost files: cp /etc/nginx/conf.d/*.conf /root/
  3. Edit both vhost files in /etc/nginx/conf.d/. You need to remove the block of code that starts with location ^~ /wp-admin/. It is about 15 lines long.
  4. Save your changes, and restart the web server: service nginx restart && service php-fpm restart

https://www.vultr.com/docs/one-click-wordpress[/vc_toggle][vc_toggle title=”Install Let’s Encrypt SSL on One-Click WordPress App” style=”simple” color=”peacoc” custom_font_container=”tag:h2|font_size:16|text_align:left” custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]


Let’s Encrypt is a certificate authority service that offers free TLS/SSL certificates. The process of installation is simplified by Certbot, a software client that automates most of the installation process. This tutorial shows how to install a Let’s Encrypt SSL certificate on the One-Click WordPress app.

https://www.vultr.com/docs/install-lets-encrypt-ssl-on-one-click-wordpress-app[/vc_toggle][vc_toggle title=”How To Optimize Nginx Configuration” style=”simple” color=”chino” custom_font_container=”tag:h2|font_size:16|text_align:left” custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]


Nginx is a fast and lightweight alternative to the sometimes overbearing Apache 2. However, Nginx just like any kind of server or software must be tuned to help attain optimal performance.


https://www.digitalocean.com/community/tutorials/how-to-optimize-nginx-configuration[/vc_toggle][vc_toggle title=”Increasing memory allocated to PHP” style=”simple” color=”mulled_wine” custom_font_container=”tag:h2|font_size:16|text_align:left” custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]

Increasing memory allocated to PHP

Also released with Version 2.5, the WP_MEMORY_LIMIT option allows you to specify the maximum amount of memory that can be consumed by PHP. This setting may be necessary in the event you receive a message such as “Allowed memory size of xxxxxx bytes exhausted”.

This setting increases PHP Memory only for WordPress, not other applications. By default, WordPress will attempt to increase memory allocated to PHP to 40MB (code is at the beginning of /wp-includes/default-constants.php) for single site and 64MB for multisite, so the setting in wp-config.php should reflect something higher than 40MB or 64MB depending on your setup.

WordPress will automatically check if PHP has been allocated less memory than the entered value before utilizing this function. For example, if PHP has been allocated 64MB, there is no need to set this value to 64M as WordPress will automatically use all 64MB if need be.

Please note, this setting may not work if your host does not allow for increasing the PHP memory limit–in that event, contact your host to increase the PHP memory limit. Also, note that many hosts set the PHP limit at 8MB.

Increase PHP Memory to 64MB

define( ‘WP_MEMORY_LIMIT’, ’64M’ );

Increase PHP Memory to 96MB

define( ‘WP_MEMORY_LIMIT’, ’96M’ );

Administration tasks require much memory than usual operation. When in the administration area, the memory can be increased or decreased from the WP_MEMORY_LIMIT by defining WP_MAX_MEMORY_LIMIT.

define( ‘WP_MAX_MEMORY_LIMIT’, ‘256M’ );

Please note, this has to be put before wp-settings.php inclusion.

https://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP[/vc_toggle][vc_toggle title=”To Do List before Web Completion ” style=”simple” color=”pink” custom_font_container=”tag:h3|font_size:16|text_align:left|color:%238224e3″ custom_google_fonts=”font_family:ABeeZee%3Aregular%2Citalic|font_style:400%20regular%3A400%3Anormal” use_custom_heading=”true”]改Contact form email

由我地email 改做客人email

woo commercial email (位置setting -> email & product -> inventory)

由我地email 改做客人email

Delete Post & Page

唔要0page & Post

Delete Post Tags & Categories

唔要0Tags & Categories

Delete 購買紀錄

testing 0既購買紀錄

Delete Media


要取消唔俾Search Engine 搵到

Search Engine Visibility –  Discourage search engines from indexing this site

更改Email 0既內容英轉中

第一次開account 後要變更密碼之後0既通知密碼