Over the past ten years, I have been writing to my blog. I have started at the time when Angular, React and Vue.js didn't exist at all. In this article, I will show you the statistics I got, tell you what I learned and how I fucked up. I hope it's not the last anniversary, and in ten years I can write another blog post.
How-to Restore WordPress Site
In conclusion of "How-to Backup WordPress Site" article, here is small instruction to restore your backup: Upload files to VPS Upload you www.tar.gz and database.sql to the new VPS. You can use WinSCP (as described here) Extract www file structure Extract files: tar -xvf www.tar.gz And copy files: cp -a www/oldsite.com/www/* /var/yoursite.com/www Change permissions: cd /var/yoursite.com/www chown www-data:www-data -R * find . -type d -exec chmod 755 {} \; find . -type f -exec chmod 644 {} \; Cre...
How-to Backup Wordpress Site
Here are two commands to backup your wordpress site. First you need to backup database: mysqldump -uUSER -h127.0.0.1 -pPASSWORD DB_NAME > database.sql Now you can archive www root folder: tar -chvzf www.tar.gz /var/site.com/www After this manipulations you can copy this two files to the same place. How to Restore WordPress Site
Migrate Wordpress site from OpenShift to VPS
For all my new sites, I'm using free OpenShift account. But it is not 100% stable. Now, I have 5 sites located on OpenShift, and at least once a week, I need to restart one of them (usually it's error 503). So, when number of visitors on sevennet.org exceeded 4000 per day I have decided to move this wordpress blog to my VPS. Here is a small instruction how to do that Prepare your VPS\VDS On your VPS you should have nginx\apache with php and mysql installed. I would recommend you to change apache...
nginx wordpress configuration
Simple but working nginx configuration for wordpress based web site... server { server_name site.com; root /var/site.com/www; index index.php; location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } location ~ /\. { deny all; } location ~* /(?:uploads|files)/.*\.php$ { deny all; } location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/var/run/ph...
Migrate from Apache to nginx + php-fpm and speed up your site twice
This blog is hosted (together with mintchocolate.org) on a small VPS (1x2.8 Ghz, 256 Мб RAM, 10 Gb SSD). This VPS is shipped with apache2, php and mysql. As you can see I am using wordpress for this blog, also I have approximately 1000 unique visitors per day (half of them visit this and this articles). So it is good to have small response time. Apache First I need to measure how slow my blog is. I have used loadimpact.com to do that. This is result for apache2: [caption id="" align="aligncenter...
[Fixed] "CARTRIDGE_VERSION_2: line 1: 2: command not found" OpenShift application push error
After pushing updated version of my wordpress blog to OpenShift git repository, I have got "CARTRIDGE_VERSION_2: line 1: 2: command not found" error. You could see this error if you are pushing your changes in Drupal, Wordpress, Rails, Spring, Django, Reveal.js, CakePHP, or Dancer applications. To fix this error go to OpenShift applications repository and get the latest version of your app (wordpress-example): git clone https://github.com/openshift/wordpress-example.git Then copy and replace .o...
Synchronize OpenShift application after update
For this blog I am using OpenShift cloud (started plan). After updating wordpress engine through admin panel, updated files are not available in application git repository because they were not commited to git on remote server. To synchronize your OpenShift application with git repository you should perform following steps: Install and configure rhc command line tool as described here Connect to your application through ssh Go to OpenShift application page. Copy ssh connection string (lik...
Code Snippet
Есть такой плагин на wordpress. Скачать можно от сюда. Способ использования: [соde lang="язык"] текст который надо выделить [/соde] Список языков прилагается: actionscript-french actionscript ada apache applescript asm asp bash caddcl cadlisp c_mac c cpp csharp css-gen css delphi diff div dos d eiffel freebasic gml html4strict ini inno java javascript lisp lua matlab mpasm nsis objc oobas oracle8 pascal perl php-brief php python qbasic sdlbasic smarty sql vbnet vb vhdl visualfoxpro xml П.С. Сдел...