Showing posts with label apache. Show all posts
Showing posts with label apache. Show all posts

Sunday, April 9, 2017

Fix website permissions


chown www-data:www-data  -R /var/www/vhosts/
find  /var/www/vhosts/ -type d -exec chmod 755 {} \;
find  /var/www/vhosts/ -type f -exec chmod 644 {} \; 

Sunday, February 12, 2017

apache + nginx wordpress dynamic cache

nginx.conf http section

    proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
    proxy_cache_key "$host$request_uri $cookie_user";
    proxy_temp_path  /var/cache/nginx/temp;
    proxy_ignore_headers Expires Cache-Control;
    proxy_cache_use_stale error timeout invalid_header http_502;
    proxy_cache_valid any 1d;

location config:

    location / {
        proxy_pass      http://127.0.0.1:8080;
        proxy_pass_header "X-Accel-Redirect";
        proxy_pass_header "X-Accel-Expires";
        proxy_cache cache;

Thursday, May 21, 2015

nginx / apache parse access log

cat /var/log/nginx/access_log | awk '{print $1}' |sort | uniq -c | sort -k 1 -n

Tuesday, May 12, 2015

AH00082: an unknown filter was not added: PHP

Должно быть так
/etc/apache2/apache2.conf

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
А не так
/etc/apache2/mod-available/php5filter.conf
<Files *.php>
       SetOutputFilter PHP
       SetInputFilter PHP
</Files>

Делаем так

#<Files *.php>
#      SetOutputFilter PHP
#       SetInputFilter PHP
#</Files>

Thursday, April 30, 2015

переадресация c http на https и другой порт

RewriteEngine On
RewriteCond %{SERVER_PORT} ^80$ [OR]
RewriteCond %{HTTP} =on
RewriteRule ^(.*)$ https://www.domain.com:8080/$1 [R=301,L]

Thursday, April 9, 2015

apache сколько памяти требуется одному процессу

ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}'

grub2-install: error: disk `mduuid/e54081d398c6d57b4d67436f6d032162' not found

After raid 1 disk replacement faced with this issue # grub2-install /dev/sdb Installing for i386-pc platform. grub2-install: error: disk `md...