cloudflare – Rate Limiting

Rate Limiting

Rate limit specific traffic from IP addresses based on URI, threshold, and other attributes for added protection from attacks.

Traffic Manager

Configure load balancing and failover across multiple servers, data centers and geographic regions, based on active health checks.

Note: If you’re currently a part of the API-only Early Access program, this card will not update to reflect your status. Please consult the API documentation to configure your Load Balancers.

 

 

.htaccess: Invalid command ‘ExpiresActive’ and .htaccess: Invalid command ‘Header’

 

.htaccess: Invalid command ‘ExpiresActive’, perhaps misspelled or defined by a module not included in the server configuration,
ln -s /etc/apache2/mods-available/expires.load /etc/apache2/mods-enabled/
.htaccess: Invalid command ‘Header’, perhaps misspelled or defined by a module not included in the server configuration
a2enmod headers

At the end… restart Apache!

service apache2 restart

Warning: Unknown: open(/var/lib/php/session/ O_RDWR) failed: Permission denied (13)

I was getting the following error on a *fresh* CentOS…

Warning: Unknown: open(/var/lib/php/session/sess_isu2r2bqudeosqvpoo8a67oj02, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session) in Unknown on line 0

This will do the work…

chown -R nginx:nobody /var/lib/php/session && chmod -R 770 /var/lib/php/session

mysql – search & replace HUGE databases

So!, I have with almost 3Gb… and I need to make a search & replace…
This looks the best way to me…

EXPORT FROM MYSQL > LINUX SEARCH & REPLACE > IMPORT TO MYSQL

Dump database to text file

mysqldump -u user -p databasename > ./db.sql

Run sed command to find/replace target string

sed -i 's!oldString!newString!g' ./db.sql

Reload the database into MySQL

mysql -u user -p databasename < ./db.sql

As copied from http://stackoverflow.com/questions/11839060/find-and-replace-text-in-the-entire-table-using-a-mysql-query