How-to Restore WordPress Site

0
Comments

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...

Read further...

Tool for enabling or disabling nginx sites (a2ensite analogue for nginx)

0
Comments

If you have previously used Apache you should now about a2ensite tool. If you start using nginx you probably find out that there are no such tool for nginx. You can use following command to do that: ln -s /etc/nginx/sites-available/mysite /etc/nginx/sites-enabled/mysite and then restart nginx sudo service nginx restart But... I have found one small script that can do that for you. Also, it can display list of all available or enabled sites, disable site and automatically restart nginx. Just put...

Read further...

Migrate from Apache to nginx + php-fpm and speed up your site twice

0
Comments
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...

Read further...

[Fixed] Apache mod_status: /server-status forbidden from 127.0.0.1

1
Comments

If you have mod_status enabled but still got this error (403) when trying to connect from localhost (127.0.0.1) you can should do following: First, go to /etc/apache2/mods-enabled/status.conf and check that you have all hosts that you want to connect from is added to Allow from, something like this:   <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 ::1 </Location> Second, create VirtualHost configuration for 127.0.0.1 with f...

Read further...

Пароль средствами .htaccess и .htpasswd

0
Comments

Пароль средствами .htaccess и .htpasswd Цель: Запаролить отдельную папку сайта. Например у нас есть сайт http://example.com и нам надо поставить пароль на папку http://example.com/admin/ Справится с этой задачей легко, и этом нам помогут два файла: .htaccess и .htpasswd. Сначала создадим в паке admin файл .htaccess с таким содержимым: [code lang="apache"]AuthUserFile /полный_путь_к_файлу/.htpasswd AuthGroupFile /dev/null AuthName подсказка AuthType Basic require valid-user [/code] Директива Auth...

Read further...