This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Varnish & Nginx & Apache & Zpanel & MySQLTuner & ApachebuddyTuner
#1
Varnish & Nginx & Apache & Zpanel & MySQLTuner & ApachebuddyTuner
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! Big Grin
5: edit /etc/httpd/conf/httpd.conf make Listen 8080
6: u can add some good values on /etc/httpd/conf/httpd.conf




Code:
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>
7: edit /etc/varnish/default.vcl change backend port to 8080
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 Big Grin 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 Big Grin
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;
#error_log  /var/log/nginx/error.log  notice;
#error_log  /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;
   #tcp_nopush     on;

   #keepalive_timeout  0;
   keepalive_timeout  65;

   #gzip  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;
       }
}

}
then edit the varnish>default.vcl and set  .port = "8083";

Now my cpu is god Big Grin
Angel
Reply
Thanks given by:
#2
RE: Varnish & Nginx & Apache & Zpanel & MySQLTuner & ApachebuddyTuner
Varnish + nginx + Apache seems like an overkill.
Varnish is easy enough, I don't think nginx is needed.
Reply
Thanks given by:
#3
RE: Varnish & Nginx & Apache & Zpanel & MySQLTuner & ApachebuddyTuner
you add Haproxy to the mix ;-).

M B
No support using PM (Auto adding to IGNORE list!), use the forum. 
How to ask
Freelance AWS Certified Architect & SysOps// DevOps

10$ free to start your VPS

Reply
Thanks given by: DimitarBG


Possibly Related Threads...
Thread Author Replies Views Last Post
Nginx > Varnish > Apache mohamadcom 4 2,655 01-31-2018, 04:17 AM
Last Post: Me.B
apache 2.2 end of life Me.B 3 3,305 07-24-2017, 08:39 AM
Last Post: Me.B
Sentora is ZPanel? slaserx 1 3,046 01-03-2015, 07:12 AM
Last Post: Me.B

Forum Jump:


Users browsing this thread: 1 Guest(s)