Varnish & Nginx & Apache & Zpanel & MySQLTuner & ApachebuddyTuner
12-19-2014, 03:04 AM
(This post was last modified: 12-19-2014, 10:25 PM by DimitarBG.)
Quote:Steps:
1: https://www.varnish-cache.org/installation/redhat - just install 1
2: edit from admin cp Apache Config ?module=apache_admin
make port like 8080
3: wait 5 minutes
4: edit /etc/zpanel/configs/apache/httpd-vhosts.conf if all ports is 8080 cont. if not change him!
5: edit /etc/httpd/conf/httpd.conf make Listen 8080
6: u can add some good values on /etc/httpd/conf/httpd.conf
7: edit /etc/varnish/default.vcl change backend port to 8080Code:ServerSignature off
AddDefaultCharset UTF-8
ServerTokens Prod
<IfModule mod_headers.c>
Header set X-XSS-Protection: "1; mode=block"
</IfModule>
<Directory /var/zpanel/hostdata/*/public_html>
<FilesMatch ".(ttf|otf|eot|woff)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
<IfModule mod_headers.c>
Header set X-XSS-Protection: "1; mode=block"
</IfModule>
ServerSignature off
AddDefaultCharset UTF-8
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
Order Allow,Deny
Deny from all
</FilesMatch>
<Files ~ "^.ht">
Order allow,deny
Deny from all
</Files>
RemoveHandler cgi-script .pl .py .cgi
<Files *.pyc>
deny from all
</Files>
<Files *.pyo>
deny from all
</Files>
<Files *.py>
deny from all
</Files>
FileETag None
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
8: edit /etc/sysconfig/varnish change VARNISH_LISTEN_PORT to 80
9: service httpd restart, service varnish restart.
10: if fail back all apache values... for me is working fine I use last 4.0 version!
Quote:http://mysqltuner.pl
perl mysqltuner.pl
Quote:http://apachebuddy.pl
perl apachebuddy.pl
Lol i installed and nginx
My nginx.conf
Code:
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log;
/var/log/nginx/error.log notice;
/var/log/nginx/error.log info;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
on;
0;
keepalive_timeout 65;
on;
gzip on;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_types text/plain application/x-javascript text/xml text/css;
gzip_vary on;
# Load config files from the /etc/nginx/conf.d directory
# The default server is in conf.d/default.conf
server {
listen 8083 default_server;
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8080;
}
location ~ /\.ht {
deny all;
}
}
}
Now my cpu is god