Geoip Nginx and Magento on Ubuntu 18.04
This tutorial assumes you have magento installed
This tutorial assumes you have magento installed
yum install varnish
yum install nginx
server {
listen 8081;
server_name www.example.com;
rewrite ^(.*) http://example.com$1 permanent;
}
server {
listen 8081 default_server;
server_name example.com;
....................
}
#
# This is an example VCL file for Varnish.
#
# It does not do anything by default, delegating control to the
There are two modes when you don't want Certbot to edit your configuration: - Standalone: replaces the webserver to respond to ACME challenges - Webroot: needs your webserver to serve challenges from a known folder.
Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.
For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.
Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon
with HyperThreading enabled, but it can work without problem on slower machines.
apt-get update
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti
service ajenti restart
apt-get install ajenti-v ajenti-v-nginx ajenti-v-mysql ajenti-v-php-fpm php-mysql
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get install -y nginx
sudo service nginx
sudo service nginx start
sudo yum install nginx -y
sudo yum install php -y
sudo yum install php-fpm -y
sudo nano /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name www.exampledomain.tld exampledomain.tld;
location / {
root /var/www/html;
index index.php index.html index.htm;
}
location ~ \.php$ {
root /var/www/html;