iredmail increase mail attachment size

Default mail attachment size in iredmail is 10 MB. To increase mail attachment size, login to server as user root, run following commands postconf -e message_size_limit=104857600 postconf -e mailbox_size_limit=104857600 systemctl restart postfix Here 104857600 is 100 MB in bytes (100 * 1024 * 1024). Change this as required. Sending very large file using mail attachment … Read more

Show Real IP Nginx Behind Reverse Proxy

Nginx Web Server

When your Nginx web server is running behind a reverse proxy, you will see IP of the reverse proxy server as visitor IP in web servers access log. To fix this, edit nginx.conf file vi /etc/nginx/nginx.conf Find http { Inside http section, add set_real_ip_from IP_ADDRESS_OF_PROXY_SERVER_HERE; real_ip_header X-Forwarded-For; Example set_real_ip_from 192.168.122.1; real_ip_header X-Forwarded-For; Restart Nginx nginx … Read more

Install Nginx on CentOS 8

Nginx Web Server

To install Nginx web server on CentOS 8, create repo vi /etc/yum.repos.d/nginx.repo Add [nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1 Install nginx with dnf or yum dnf install nginx Open HTTP and HTTPS ports on firewall firewall-cmd –zone=public –permanent –add-service=http firewall-cmd –zone=public –permanent –add-service=https firewall-cmd –zone=public –permanent –add-service=ssh firewall-cmd –reload

Nginx Location Directive

Nginx Location Directive is used to route request to correct files. Match Exact match is used to match an exact URL. server { listen 80 default_server; root /var/www/html; index index.html; server_name _; location /ok/ { root /home/; } } When location is used with no modifiers, then beginning of the URL is matched. In this … Read more

Nginx Password Protect a website

nginx password protect

To password protect a website, you need to install htpasswd utility. On Ubuntu/Debian, you can install it with the command Now create a password file with the command It will ask for a password. Edit the configuration file for your website and add the following in the server entry for the website. Restart Nginx. Now … Read more

Nginx vs Apache

I recently added nginx as front end for apache. Now nginx serve static content, PHP requests are peroxided to Apache. Nginx frontend, Apache backend [root@server12 ~]# ab -n 1000 -c 100 http://netfree.netfreehost.com/ This is ApacheBench, Version 2.0.40-dev apache-2.0 Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Copyright 2006 The Apache Software Foundation, http://www.apache.org/ Benchmarking netfree.netfreehost.com … Read more

Configure Nginx to listen on single IP Address

By default Nginx listens on all IP address on a server. To make nginx listen on specific IP address, edit nginx configuration file vi /etc/nginx/nginx.conf And VirtualHost/server files for each domain located in folders /etc/nginx/conf.d => on CentOS/RHEL /etc/nginx/sites-available => on Debian/Ubuntu Find listen 80 Replace with listen IP_ADDR_HERE:80 IP_ADDR_HERE = your server IP address … Read more

Running Python Application with gunicorn and nginx

Create a service file for gunicorn root@django:~# cat /etc/systemd/system/gunicorn2.service [Unit] Description=gunicorn2 daemon Requires=gunicorn2.socket After=network.target [Service] User=ubuntu Group=www-data WorkingDirectory=/home/ubuntu/myapp/wagtail2 ExecStart=/home/ubuntu/myapp/venv/bin/gunicorn \ –access-logfile – \ –workers 3 \ –bind unix:/run/gunicorn2.sock \ wagtailblog4.wsgi:application [Install] WantedBy=multi-user.target root@django:~# Here /home/ubuntu/myapp/wagtail2 = path to the folder where web application is. /home/ubuntu/myapp/venv/bin/gunicorn = is where gunicorn installed inside virtualenv. Change these path … Read more

Nginx Config for Laravel Application

Here is Nginx configuration for a laravel application server { listen 80; server_name www.domain.com; access_log /var/log/nginx/domain.com.log; root /home/domain.com/html/public; index index.html index.php; access_log /var/log/nginx/domain.com.log; error_log /var/log/nginx/domain.com-error.log; client_max_body_size 1000M; proxy_read_timeout 600s; fastcgi_read_timeout 600s; fastcgi_send_timeout 600s; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { try_files $uri =404; access_log off; expires max; } location = … Read more