July 2018
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Categories

July 2018
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Apache Configure CORS Headers for Whitelist Domains

Apache Configure CORS Headers for Whitelist Domains

 

 

In the current implementation of Cross Origin Resource Sharing (CORS) the Access-Control-Allow-Origin header can only provide a single host domain or a wildcard as the accept value. This is not optimal when you have multiple clients connecting to the same virtual server and simply want to […]

Linux: include hidden files in tar archive

When you create a tar archive of a directory tree the hidden files are normally not included. Here’s how to include the hidden files.

Say you have a web directory called “/var/www/html/mysite/” that contains the following tree:

.htaccess index.php logo.jpg style.css admin_dir/.htaccess admin_dir/includes.php admin_dir/index.php

Normally you would use the tar command like this:

tar […]

Reset your WordPress password via email

Reset your WordPress password via email

If you’ve forgotten your WordPress admin password, you can reset it via email from the WordPress dashboard login page following these steps:

Go to your WordPress login page (example.com/wp-admin) Click on Lost you password? at the bottom Enter the Username or E-mail of your WordPress admin user, then click […]

Adding SSL to Apache on EC2 with Amazon Linux

Adding SSL to Apache on EC2 with Amazon Linux

 

These notes assume you have Apache installed and working on EC2 with Amazon Linux, but it’s fairly similar for other versions of Linux.

Install OpenSSL and the Apache Connector // for Apache 2.2 yum install openssl mod_ssl // for Apache 2.4 yum install openssl mod24_ssl […]

How to Improve rsync Performance

I need to transfer 10TB of data from one machine to another machine. Those 10TB of files are living in a large RAID which span across 7 different disks. The target machine has another large RAID which span across 12 different disks. It is not easy to copying those files locally. Therefore, I decide to […]

Replacing IP Address in Apache2 config files with SED

Suppose i just mirrored my vps machine (starting from a clone and then rsync-ing all needed files) with rsync. Obviously i need to change the IP Address value contained into all the config files, but I’m lazy. So, let’s use “SED” to do it at once, with a single line command. I need to replace […]

rsync

There are many commands to copy a directory in Linux. The difference between them in current Linux distribution are very small. All of them support link, time, ownership and sparse.

I tested them to copy a Linux kernel source tree. Each command I tested twice and keep the lower result. The original directory size is […]

Migrating to Amazon Linux 2

AWS also announced that Amazon Linux 2018.03 is the last release for the current generation of Amazon Linux and will be supported until June 30, 2020. Therefore, you have to come up with a migration plan.

Amazon Linux 2 comes with the same benefits as Amazon Linux, but it adds some new capabilities:

long-term support: […]

mysql dump issue utf8_unicode_520_ci

i use this in linux :

sed -i ‘s/utf8mb4/utf8/g’ your_file.sql sed -i ‘s/utf8_unicode_ci/utf8_general_ci/g’ your_file.sql sed -i ‘s/utf8_unicode_520_ci/utf8_general_ci/g’ your_file.sql

then restore your_file.sql

mysql -uyourdbuser -pyourdbpasswd yourdb < your_file.sql […]

Install LDAP-slapd.conf mode

Install LDAP-slapd.conf mode ——————start installation——————— Query whether to install

# rpm -qa openldap-servers

Remove ldap # yum remove openldap

# yum remove openldap-servers

Installation Environment Centos7 Apache/2.4.6 (CentOS) PHP 7.1.11

Install LDAP Server

Openldap-servers-2.4.44-5.el7.x86_64

# yum install openldap-servers openldap-clients migrationtools

# rpm -qa | grep openldap

Delete all files in the slapd.d folder and copy […]