<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[AnyStack]]></title><description><![CDATA[Linux SysAdmin Blog]]></description><link>https://anystack.xyz/</link><image><url>https://anystack.xyz/favicon.png</url><title>AnyStack</title><link>https://anystack.xyz/</link></image><generator>Ghost 5.26</generator><lastBuildDate>Sun, 12 Apr 2026 20:32:46 GMT</lastBuildDate><atom:link href="https://anystack.xyz/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[How to install a Mastodon instance on Ubuntu 16.04 LTS]]></title><description><![CDATA[A tutorial about how to install mastodon on a Ubuntu 16.04 LTS server with Nginx as a reverse-proxy and Cloudflare CDN/SSL]]></description><link>https://anystack.xyz/how-to-install-mastodon-ubuntu/</link><guid isPermaLink="false">5c40c890c86475242ab38545</guid><category><![CDATA[nginx]]></category><category><![CDATA[sysadmin]]></category><category><![CDATA[Tutorials]]></category><category><![CDATA[linux]]></category><category><![CDATA[nodejs]]></category><category><![CDATA[redis-server]]></category><category><![CDATA[cloudflare]]></category><category><![CDATA[self-hosted]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Thu, 06 Apr 2017 10:06:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2017/08/Screenshot_40.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2017/08/Screenshot_40.png" alt="How to install a Mastodon instance on Ubuntu 16.04 LTS"><p>Have you already the new open-source social network Mastodon ? I have launched few days ago my own instance to contribute to this project.</p>
<p>If you want to launch your own instance, here a quick tutorial to install mastodon on a Ubuntu 16.04 LTS server with Nginx as a reverse-proxy and Cloudflare CDN/SSL.</p>
<p>To follow the steps of this tutorial, a user with sudo rights is enough, you don&apos;t need to login as root.</p>
<h3><strong>Install the dependencies</strong></h3>
<pre><code>sudo apt-get update</code></pre>
Install nodejs
<pre><code>curl -sL https://deb.nodesource.com/setup_6.x | sudo bash -
sudo apt-get install imagemagick ffmpeg libpq-dev libxml2-dev libxslt1-dev nodejs
sudo npm install -g yarn
</code></pre>
<p>Install redis-server</p>
<pre><code>sudo apt-get install redis-server redis-tools
</code></pre>
<p>Install Postgresql</p>
<pre><code>sudo apt-get install postgresql postgresql-contrib</code></pre>
<p>Login as postgre user to create mastodon</p>
<pre><code>sudo su - postgres
psql
CREATE USER mastodon CREATEDB;
\q</code></pre>
<p>You will also have to enable ident authentication so users can login without password</p>
<pre><code>sudo sed -i &apos;/^local.*postgres.*peer$/a host all     all     127.0.0.1/32    ident&apos; \
/etc/postgresql/9.?/main/pg_hba.conf</code></pre>
<p>And to install the ident daemon :</p>
<pre><code>sudo apt-get install pidentd
sudo systemctl enable pidentd
sudo systemctl start pidentd
sudo systemctl restart postgresql</code></pre>
<h3>Install Ruby</h3>
Install the dependencies
<pre><code>sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev</code></pre>
Create a user mastodon without password :
<pre><code>adduser --disabled-password --disabled-login mastodon</code></pre>
Then login as mastodon :
<pre><code>su - mastodon</code></pre>
Install rbenv and rbenv-build
<pre><code>git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo &apos;export PATH=&quot;$HOME/.rbenv/bin:$PATH&quot;&apos; &gt;&gt; ~/.bashrc
echo &apos;eval &quot;$(rbenv init -)&quot;&apos; &gt;&gt; ~/.bashrc
source ~/.bashrc</code></pre>
We have to logout to apply the bash modification, and we install ruby-build.
<pre><code>exit
su - mastodon
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build</code></pre>
Then install ruby 2.4.1 for mastodon :
<pre><code>rbenv install 2.4.1
rbenv global 2.4.1</code></pre>
You can check the ruby version installed with the command :
<pre><code>ruby -v</code></pre>
<h3>Mastodon installation</h3>
We have installed all the dependencies required to setup Mastodon, so we can now clone the github repository. We use git checkout to select the last release instead of the master branch.
<pre><code>cd ~
git clone https://github.com/tootsuite/mastodon.git live
cd live
git checkout $(git tag | tail -n 1)</code></pre>
Install bundler to manage the dependencies and disable the gem documentation
<pre><code>echo &quot;gem: --no-document&quot; &gt; ~/.gemrc
gem install bundler --no-ri</code></pre>
Then launch the installation
<pre><code>bundle install --deployment --without development test
yarn install</code></pre>
You can now copy the configuration sample file and edit with your own informations
<pre><code>cp .env.production.sample .env.production
nano .env.production</code></pre>
You have to add the following informations&#xA0; :
<pre><code># Service dependencies
REDIS_HOST=localhost
REDIS_PORT=6379
DB_HOST=/var/run/postgresql
DB_USER=mastodon
DB_NAME=mastodon_production
DB_PASS=
DB_PORT=5432
<h1 id="federation">Federation</h1>
<p>LOCAL_DOMAIN=yourdomain.com<br>
LOCAL_HTTPS=true<br>
</p></code></pre><br>
Ainsi que la partie SMTP qui permettra aux utilisateurs de confirmer leur inscription :<p></p>
<pre><code># E-mail configuration
SMTP_SERVER=mail.yourdomain.com
SMTP_PORT=587
SMTP_LOGIN=noreply@yourdomain.com
SMTP_PASSWORD=YourPassword
SMTP_FROM_ADDRESS=noreply@yourdomain.com</code></pre>
<p>For the application secret part, you can use the command <code>bundle exec rake secret</code> to generate the 3 secret keys, then you have just to copy them into the configuration file.</p>
<p>To setup the database and the assets  :</p>
<pre><code>RAILS_ENV=production bundle exec rails db:setup
RAILS_ENV=production bundle exec rails assets:precompile</code></pre>
<h3>Adding systemd services</h3>
<strong>Web service</strong>
<pre><code>nano /etc/systemd/system/mastodon-web.service</code></pre>
<pre><code>[Unit]
 Description=mastodon-web
 After=network.target
<p>[Service]<br>
Type=simple<br>
User=mastodon<br>
WorkingDirectory=/home/mastodon/live<br>
Environment=&quot;RAILS_ENV=production&quot;<br>
Environment=&quot;PORT=3000&quot;<br>
ExecStart=/home/mastodon/.rbenv/shims/bundle exec puma -C config/puma.rb<br>
TimeoutSec=15<br>
Restart=always</p>
<p>[Install]<br>
WantedBy=multi-user.target</p></code></pre><br>
<strong>Background service&#xA0;</strong><p></p>
<pre><code>nano /etc/systemd/system/mastodon-sidekiq.service</code></pre>
<pre><code>[Unit]
 Description=mastodon-sidekiq
 After=network.target

[Service]
 Type=simple
 User=mastodon
 WorkingDirectory=/home/mastodon/live
 Environment=&quot;RAILS_ENV=production&quot;
 Environment=&quot;DB_POOL=5&quot;
 ExecStart=/home/mastodon/.rbenv/shims/bundle exec sidekiq -c 5 -q default -q mailers -q pull -q push
 TimeoutSec=15
 Restart=always

[Install]
 WantedBy=multi-user.target</code></pre>
<p><strong>API service</strong></p>
<pre><code>nano /etc/systemd/system/mastodon-streaming.service</code></pre>
<pre><code>[Unit]
 Description=mastodon-streaming
 After=network.target

[Service]
 Type=simple
 User=mastodon
 WorkingDirectory=/home/mastodon/live
 Environment=&quot;NODE_ENV=production&quot;
 Environment=&quot;PORT=4000&quot;
 ExecStart=/usr/bin/npm run start
 TimeoutSec=15
 Restart=always

[Install]
 WantedBy=multi-user.target</code></pre>
<p>Then we can enable our systemd services :</p>
<pre><code>systemctl enable /etc/systemd/system/mastodon-*.service</code></pre>
<p>And we can start our mastodon instance :</p>
<pre><code>sudo systemctl start mastodon-web.service mastodon-sidekiq.service mastodon-streaming.service</code></pre>
<p>Add the required crons for mastodon :</p>
<pre><code>crontab -u mastodon -e</code></pre>
<pre><code>RAILS_ENV=production
@daily cd /home/mastodon/live &amp;&amp; RAILS_ENV=production /home/mastodon/.rbenv/shims/bundle exec rails mastodon:media:remove_remote</code></pre>
<h3>Nginx reverse-proxy setup :</h3>
So we have setup mastodon, but to access to our instance directly under https and with our domain, we need to setup a reverse-proxy using Nginx.
<p>At first, install Nginx :</p>
<pre><code>wget -O - https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
sudo echo &quot;deb http://nginx.org/packages/ubuntu/ $(lsb_release -sc) nginx&quot; &gt; /etc/apt/sources.list.d/nginx.list
sudo apt update
sudo apt install nginx</code></pre>
<p>We have now to create our nginx configuration file for ou domain, we will use the configuration based on the <a href="https://angristan.fr/installer-instance-mastodon-debian-8/">Angristan&apos;s model </a> :</p>
<pre><code>nano /etc/nginx/sites-enabled/yourdomain.com</code></pre>
<pre><code>map $http_upgrade $connection_upgrade {
 default upgrade;
 &apos;&apos; close;
}
server {
 listen 80;
 listen [::]:80;
 server_name www.yourdomain.com yourdomain.com;
 return 301 https://votredomaine.com$request_uri;

 access_log /dev/null;
 error_log /dev/null;
}

server {
 listen 443 ssl http2;
 listen [::]:443 ssl http2;
 server_name www.yourdomain.com yourdomain.com;

 access_log /var/log/nginx/yourdomain.com-access.log;
 error_log /var/log/nginx/yourdomain.com-error.log;

 ssl_certificate /etc/letsencrypt/live/fullchain.pem;
 ssl_certificate_key /etc/letsencrypt/live/privkey.pem;
 ssl_protocols TLSv1.2;
 ssl_ciphers EECDH+AESGCM:EECDH+AES;
 ssl_prefer_server_ciphers on;
 add_header Strict-Transport-Security &quot;max-age=15552000; preload&quot;;

 keepalive_timeout 70;
 sendfile on;
 client_max_body_size 0;
 gzip off;

 root /home/mastodon/live/public;

 location / {
  try_files $uri @proxy;
 }

 location @proxy {
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto https;
  proxy_pass_header Server;
  proxy_pass http://127.0.0.1:3000;
  proxy_buffering off;
  proxy_redirect off;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;
  tcp_nodelay on;
 }

 location /api/v1/streaming {
  proxy_set_header Host $host;
  proxy_set_header X-Real-IP $remote_addr;
  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  proxy_set_header X-Forwarded-Proto https;
  proxy_pass http://127.0.0.1:4000;
  proxy_buffering off;
  proxy_redirect off;
  proxy_http_version 1.1;
  proxy_set_header Upgrade $http_upgrade;
  proxy_set_header Connection $connection_upgrade;
  tcp_nodelay on;
 }

 error_page 500 501 502 503 504 /500.html;
}
</code></pre>
<p>You can start nginx with the command :</p>
<pre><code>service nginx start</code></pre>
<p>Then we will use Let&apos;s Encrypt to generate a SSL certificate.</p>
<pre><code>cd /opt
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt
./letsencrypt-auto certonly --webroot -w /home/mastodon/live -d www.yourdomain.com -d yourdomain.com --email vous@yourdomain.com --text --rsa-key-size 4096</code></pre>
<h3>Updating Mastodon</h3>
Mastodon is updated very often, so if you want to keep your instance up-to-date you will have to follow the following steps :
<pre><code>su - mastodon
cd live
gem install bundler --no-ri
git fetch
git checkout v1.X.X
bundle install --deployment --without development test
NODE_ENV=production npm upgrade --global yarn
yarn install
RAILS_ENV=production bundle exec rails assets:clean
RAILS_ENV=production bundle exec rails assets:precompile
RAILS_ENV=production bundle exec rails db:migrate
exit</code></pre>
Then you just have to restart the instance :
<pre><code>sudo systemctl restart mastodon-web.service mastodon-sidekiq.service mastodon-streaming.service</code></pre>
If you need to update ruby with a new release use :
<pre><code>rbenv install 2.4.1
gem install bundler --no-ri</code></pre>
<h3>Create your administrator account</h3>
You instance is now running properly but you have to register to create your account and then you will be able to set this account as administrator with the following command : 
<pre><code>RAILS_ENV=production bundle exec rails mastodon:make_admin USERNAME=votre-utilisateur</code></pre>
<h3> My instance mastodon.top</h3>
![mastodon.top](/content/images/2017/08/Screenshot_44.png)
With VirtuBox, I have launched a Mastodon instance and if you are not registered on Mastodon yet, you can register at <a href="https://mastodon.top" target="_blank">mastodon.top</a>.
We are already more than 200 users on my instance and enough resources for more users.
You can find more informations about the instance on the  <a href="https://mastodon.top/about/more" target="_blank">page about</a>&#xA0;and the real-time monitoring of the server at <a href="https://instance.mastodon.top" target="_blank">instance.mastodon.top</a>.
<p>Don&apos;t hesitate to give your opinion on Mastodon, to tell me if there are errors in the tutorial or to ask for help if you want to deploy your own instance.</p>
<p>You can also follow me on Mastodon : <a href="https://mastodon.top/@thomas_virtubox" target="_blank">thomas_virtubox@mastodon.top</a></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[How to upgrade Ghost]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>If you are using a self-hosted Ghost, you may have sometimes to upgrade it to the new release.<br>
To do that, you have at first to download the latest Ghost release.<br>
For that create a new folder next your current Ghost folder and download Ghost :</p>
<pre><code>mkdir newghostfolder &amp;&amp; cd</code></pre>]]></description><link>https://anystack.xyz/how-to-upgrade-ghost/</link><guid isPermaLink="false">5c40c890c86475242ab38540</guid><category><![CDATA[Tutorials]]></category><category><![CDATA[nodejs]]></category><category><![CDATA[Ghost]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Thu, 16 Feb 2017 14:21:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2017/02/Screenshot_8.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2017/02/Screenshot_8.png" alt="How to upgrade Ghost"><p>If you are using a self-hosted Ghost, you may have sometimes to upgrade it to the new release.<br>
To do that, you have at first to download the latest Ghost release.<br>
For that create a new folder next your current Ghost folder and download Ghost :</p>
<pre><code>mkdir newghostfolder &amp;&amp; cd newghostfolder
wget https://ghost.org/zip/ghost-latest.zip
unzip ghost-latest.zip
</code></pre>
<p>You can make a copy of your current ghost folder and you will have to remove the <code>index.js</code>, all the <code>.md</code> and <code>.json</code> and the <code>core</code> folder. But do not delete the <code>config.js</code> file.<br>
Then you will have to stop the current Ghost instance by using  :</p>
<pre><code>forever stop index.js
</code></pre>
<p>Copy the new files over your current folder, and install the new dependencies with :</p>
<pre><code>npm install --production
</code></pre>
<p>After than you can restart your instance</p>
<pre><code>NODE_ENV=production forever start index.js
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Self-Hosting made easy with Cloudron]]></title><description><![CDATA[Learn how to Install and manage easily your self-hosted apps  like NextCloud or Rocket.chat with the Cloudron]]></description><link>https://anystack.xyz/self-hosting-platform-cloudron/</link><guid isPermaLink="false">5c40c890c86475242ab3853f</guid><category><![CDATA[sysadmin]]></category><category><![CDATA[vps]]></category><category><![CDATA[linux]]></category><category><![CDATA[self-hosted]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Sat, 17 Dec 2016 02:03:49 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/12/Cloudron--4-.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/12/Cloudron--4-.png" alt="Self-Hosting made easy with Cloudron"><p>Because there is nothing better than self-hosting, you are may looking for a way to manage your apps easily and to be able to host yourself all your web apps ?</p>
<p>I have tried several solutions in the past, but there was always something wrong and I was looking for something easy to deploy and stable.</p>
<p>Cloudron is a platform to run and manage your apps, and if it was only available on AWS EC2 servers, it can be now deployed on any platform, including Scaleway, OVH, DigitalOcean or Linode.</p>
<p>There are a large choice of apps available on the <a href="https://cloudron.io/store/index.html" target="_blank">Cloudron App Store</a> which can be deployed with a single click.</p>
<p><img src="https://anystack.xyz/content/images/2016/12/Screenshot_26.png" alt="Self-Hosting made easy with Cloudron" loading="lazy"></p>
<p>Cloudron also provide the ability to backup your server with AWS S3 storage, and keep your server and your apps always up-to-date.</p>
<p>So ton install Cloudron you only need :</p>
<ul>
<li>clean Ubuntu 16.04 LTS with 1GB+ RAM</li>
<li>SSH keys connection</li>
<li>domain with a wildcard record to your server ip</li>
</ul>
<p>Because Cloudron will install each application on a new subdomain, so you have to purchase a domain and to use a wildcard if you don&apos;t want to add each record manually.</p>
<p>I recommand you to buy a .xyz domain at <a href="https://www.namecheap.com/?aff=102052" target="_blank">NameCheap</a> and then to use Cloudflare DNS.</p>
<p>To install Cloudron, the first subdomain needed will be my.yourdomain.com, it will be your homepage.</p>
<p>Then you have to run the following command :</p>
<pre><code>wget https://git.cloudron.io/cloudron/box/raw/master/scripts/cloudron-setup
chmod +x cloudron-setup
./cloudron-setup --domain &lt;domain&gt; --provider &lt;digitalocean|ec2|generic|scaleway&gt;
</code></pre>
<p>You will have to replace :</p>
<ul>
<li><code>&lt;domain&gt;</code> with yourdomain.xyz</li>
<li><code>&lt;provider&gt;</code> with the provider name or generic</li>
</ul>
<p>When the process will be done, you will have to go to my.yourdomain.xyz to finish the setup and create your admin account.<br>
There is no maintenance needed with Cloudron but you can read the <a href="https://cloudron.io/references/selfhosting.html" target="_blank">documentation</a> .</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[How to setup Magento 2.1.7 with EasyEngine - Nginx &  Redis-cache]]></title><description><![CDATA[In this tutorial, I will show you how to install Magento 2.1.7 with EasyEngine to use Nginx, php7, Mariadb and redis-server.]]></description><link>https://anystack.xyz/setup-magento-2-easyengine-nginx-redis-cache/</link><guid isPermaLink="false">5c40c890c86475242ab3853a</guid><category><![CDATA[Tutorials]]></category><category><![CDATA[EasyEngine]]></category><category><![CDATA[sysadmin]]></category><category><![CDATA[redis-server]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Mon, 07 Nov 2016 20:49:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/11/magento_logo_footer-1.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/11/magento_logo_footer-1.png" alt="How to setup Magento 2.1.7 with EasyEngine - Nginx &amp;  Redis-cache"><p>If you have already setup redis-server for object-caching with WordPress, you are maybe looking for something more powerful to setup ?<br>
Magento 2 will be the perfect benchmark for your server. It&apos;s an open source e-commerce software and content management system for e-commerce websites based on the PHP Zend Framework. Magento is compatible with the most advanced caching systems including Varnish, Memcached or Redis.</p>
<p>So in this tutorial, we will see how to setup Magento 2.1.7 with Nginx, php7, Mariadb and Redis-server using EasyEngine.</p>
<p>At first, you need a VPS with ubuntu/debian and at least 2GB RAM. In production, 4GB will be the minimum, when 8GB will be better.</p>
<h3 id="serversetupconfiguration">Server setup &amp; configuration</h3>
<pre><code>## install easyengine
wget -qO ee rt.cx/ee &amp;&amp; bash ee

## install Nginx - php5.6 + php7 - Mariadb - phpmyadmin - redis - memcached
ee stack install --web --admin --php7 --redis

## create your domain vhost (--letsencrypt optional)
ee site create yourdomain.com --mysql --php7

## install php-intl for magento and unzip
apt-get update &amp;&amp; apt-get install php7.0-intl unzip
</code></pre>
<p>Change the php configuration according to magento documentation :</p>
<pre><code>## change php.ini settings for magento
nano /etc/php/7.0/fpm/php.ini

max_execution_time = 1800
max_input_time = 1800
memory_limit = 4096M
post_max_size = 512M

## add the following lines after the extension declaration : [opcache]
opcache.enable=1
opcache.enable_cli=0
opcache.memory_consumption=128
opcache.interned_strings_buffer=4
opcache.max_accelerated_files=20000
opcache.max_wasted_percentage=5
opcache.validate_timestamps=1
opcache.revalidate_freq=2
opcache.optimization_level=0xffffffff

## restart php7.0-fpm
service php7.0-fpm restart
</code></pre>
<h3 id="magentoinstallation">Magento installation</h3>
<p>We have already done almost all the server configuration. Now we have to download magento and to launch the installer.</p>
<p>Download it from the Magento website :<br>
<a href="https://magento.com/tech-resources/download">https://magento.com/tech-resources/download</a></p>
<p>To upload it via sftp, set a password for the user www-data with the command</p>
<pre><code>passwd www-data
</code></pre>
<p>Then allow shell access for www-data with the command :</p>
<pre><code>usermod -s /bin/bash www-data
</code></pre>
<p>After that you will be able to use the sftp client of your choice and to upload the magento archive in your website folder with the correct permissions.<br>
If you are looking for a sftp client for Windows, I recommend you <a href="https://cyberduck.io" target="_blank">Cyberduck</a>.</p>
<p>Then go into your website folder and unzip the magento archive.</p>
<pre><code>cd /var/www/yourdomain.com/htdocs
unzip Magento-CE-2.1.6_sample_data-2017-03-29-04-34-51.zip

## set www-data as the owner of the directory and all magento files
cd .. 
chown -R www-data:www-data htdocs
</code></pre>
<p>But to be able to launch the installer with nginx, we have to edit the site configuration, for that we will use the nginx.conf.sample file included with magento.</p>
<p>I have edit this file with the correct settings for EasyEngine and you can download it here :<br>
<a href="https://gist.github.com/VirtuBox/bf3179612294e59316691883a9512647" target="_blank">magento.conf</a></p>
<p>You have just to upload this file in /var/www/yourdomain.com/conf/nginx, because with easyengine, all configurations files in this folder are automatically include in your website configuration.</p>
<p>Then edit your website configuration in /etc/nginx/sites-available/yourdomain.com to look like :</p>
<pre><code>server {

    server_name yourdomain.com www.yourdomain.com;
    set $MAGE_ROOT /var/www/yourdomain.com/htdocs;

    access_log /var/log/nginx/yourdomain.com.access.log rt_cache;
    error_log /var/log/nginx/yourdomain.com.error.log;

    include /var/www/yourdomain.com/conf/nginx/*.conf;
}

</code></pre>
<p>Check your nginx configuration with the command <code>nginx -t</code> and apply it with <code>service nginx reload</code></p>
<p>We can now launch the installation by reaching the domain with our browser<br>
<img src="https://anystack.xyz/content/images/2016/11/magento-install.png" alt="How to setup Magento 2.1.7 with EasyEngine - Nginx &amp;  Redis-cache" loading="lazy"></p>
<p>Just follow the step, and use the databases user credentials available in the file /var/www/yourdomain.com/ee-config.php</p>
<p><img src="https://anystack.xyz/content/images/2016/11/magento-check.png" alt="How to setup Magento 2.1.7 with EasyEngine - Nginx &amp;  Redis-cache" loading="lazy"></p>
<p>To run properly, Magento require to add some cronjobs. If you are already logged as www-data, you have just to use the command : <code>crontab -e</code> and to add the following lines. Just replace yourdomain.com with your real domain.</p>
<pre><code>* * * * * php /var/www/yourdomain.com/htdocs/bin/magento cron:run | grep -v &quot;Ran jobs by schedule&quot; &gt;&gt; /var/www/yourdomain.com/htdocs/var/log/magento.cron.log
* * * * * php /var/www/yourdomain.com/htdocs/update/cron.php &gt;&gt; /var/www/yourdomain.com/htdocs/var/log/update.cron.log
* * * * * php /var/www/yourdomain.com/htdocs/bin/magento setup:cron:run &gt;&gt; /var/www/yourdomain.com/htdocs/var/log/setup.cron.log
</code></pre>
<p>Some other useful command to get started with the magento cli</p>
<pre><code>## deploy the magento sample data
php bin/magento sampledata:deploy

## upgrade your magento install
php bin/magento setup:upgrade

## Generates DI configuration after setup:upgrade
php bin/magento setup:di:compile

## clean magento cache
php bin/magento cache:clean

## backup magento
php bin/magento setup:backup
</code></pre>
<p>Your Magento instance is now running properly, but we want to make it faster. For that we will use redis for session storage and full-page caching.<br>
I let you read the Magento DevDocs to understand  <a href="http://devdocs.magento.com/guides/v2.0/config-guide/redis/config-redis.html#why-redis-is-better" target="_blank">why Redis is better</a>.</p>
<h3 id="useredisforsessionandpagecache">Use redis for session and page cache</h3>
<p>So, to use Redis-server, there are no plugins like for WordPress, but we have just to edit the file app/etc/env.php and to set the correct settings to use redis for the session storage and the full page caching instead of files. You can use the following example : <a href="https://gist.github.com/VirtuBox/54d527531eb2d91d5c92fea99345d34a" target="_blank">env.php</a></p>
<p>There are two blocks to add to use redis-server, it require to use a database for each block :</p>
<ol>
<li>session caching</li>
</ol>
<pre><code>&apos;session&apos; =&gt; 
   array (
   &apos;save&apos; =&gt; &apos;redis&apos;,
   &apos;redis&apos; =&gt; 
      array (
	&apos;host&apos; =&gt; &apos;127.0.0.1&apos;,
	&apos;port&apos; =&gt; &apos;6379&apos;,
	&apos;password&apos; =&gt; &apos;&apos;,
	&apos;timeout&apos; =&gt; &apos;2.5&apos;,
	&apos;persistent_identifier&apos; =&gt; &apos;magento2:&apos;,
	&apos;database&apos; =&gt; &apos;1&apos;,
	&apos;compression_threshold&apos; =&gt; &apos;2048&apos;,
	&apos;compression_library&apos; =&gt; &apos;gzip&apos;,
	&apos;log_level&apos; =&gt; &apos;1&apos;,
	&apos;max_concurrency&apos; =&gt; &apos;6&apos;,
	&apos;break_after_frontend&apos; =&gt; &apos;5&apos;,
	&apos;break_after_adminhtml&apos; =&gt; &apos;30&apos;,
	&apos;first_lifetime&apos; =&gt; &apos;600&apos;,
	&apos;bot_first_lifetime&apos; =&gt; &apos;60&apos;,
	&apos;bot_lifetime&apos; =&gt; &apos;7200&apos;,
	&apos;disable_locking&apos; =&gt; &apos;0&apos;,
	&apos;min_lifetime&apos; =&gt; &apos;60&apos;,
	&apos;max_lifetime&apos; =&gt; &apos;2592000&apos;,
    ),
</code></pre>
<ol start="2">
<li>Full-page caching</li>
</ol>
<pre><code>&apos;cache&apos; =&gt;
array(
   &apos;frontend&apos; =&gt;
   array(
      &apos;default&apos; =&gt;
      array(
         &apos;backend&apos; =&gt; &apos;Cm_Cache_Backend_Redis&apos;,
         &apos;backend_options&apos; =&gt;
         array(
            &apos;server&apos; =&gt; &apos;127.0.0.1&apos;,
            &apos;port&apos; =&gt; &apos;6379&apos;,
            ),
    ),
    &apos;page_cache&apos; =&gt;
    array(
      &apos;backend&apos; =&gt; &apos;Cm_Cache_Backend_Redis&apos;,
      &apos;backend_options&apos; =&gt;
       array(
         &apos;server&apos; =&gt; &apos;127.0.0.1&apos;,
         &apos;port&apos; =&gt; &apos;6379&apos;,
         &apos;database&apos; =&gt; &apos;3&apos;,
         &apos;compress_data&apos; =&gt; &apos;0&apos;,
       ),
    ),
  ),
),
</code></pre>
<p>You can now refresh the Magento cache to make sure you are using Redis. You can also use EasyEngine to install phpRedisAdmin to see the redis databases with <code>ee stack install --phpredisadmin</code></p>
<h3 id="multiplestoresconfiguration">Multiple stores configuration</h3>
<p>That&apos;s one of the main feature of Magento, the ability to host several stores/websites on the same magento instance. At first you have to create a new website, store and store view in the Admin panel. For this part just follow the <a href="http://devdocs.magento.com/guides/v2.1/config-guide/multi-site/ms_websites.html" target="_blank">Magento Guide</a>.<br>
Then create your additional nginx vhost with :</p>
<pre><code>ee site create your2domain.com
</code></pre>
<p>And edit it to look like :</p>
<pre><code>server {

    server_name your2domain.com   www.your2domain.com;
    access_log /var/log/nginx/your2domain.com.access.log ;
    error_log /var/log/nginx/your2domain.com.error.log;

    set $MAGE_ROOT /var/www/yourdomain.com/htdocs;

    index  index.html index.htm;

    include /var/www/yourdomain.com/conf/nginx/*.conf;
}
</code></pre>
<p>You have to make sure you have included the same magento.conf file than for the main website. After that we have to use the Nginx map directive to pass the values of the Magento variables to nginx, so we will create a file map.conf in /etc/nginx/conf.d with the following content :</p>
<pre><code>map $http_host $MAGE_RUN_CODE {
   yourdomain.com yourdomain-code;
   your2domain.com your2domain-code;
}
</code></pre>
<p>So if you want to add another store later, you will just have to create another vhost and to add a line in this file with the new domain and the associated website code.<br>
Then edit the file /etc/nginx/fastcgi_params and add the following line at the end :</p>
<pre><code>fastcgi_param MAGE_RUN_TYPE website;
fastcgi_param MAGE_RUN_CODE $MAGE_RUN_CODE;
</code></pre>
<p>Reload nginx with <code>nginx -t &amp;&amp; service nginx reload</code> and you can now check if your two stores are working properly.</p>
<p>If you have any issue to setup Magento with EasyEngine, post a reply on the <a href="http://community.rtcamp.com/t/anyone-using-magento-2-with-easyengine/7545" target="_blank">Magento thread</a> already available. I will answer to your questions.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Good bye WordPress - Welcome Ghost !]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I&apos;m using WordPress for few years now, but that&apos;s always the same problem, WordPress require plugins to have some functionalities and plugins make WordPress running slower.</p>
<p>Even with an advanced caching system like redis, that&apos;s always a lot of work to make wordpress running</p>]]></description><link>https://anystack.xyz/good-bye-wordpress-welcome-ghost/</link><guid isPermaLink="false">5c40c890c86475242ab3853c</guid><category><![CDATA[EasyEngine]]></category><category><![CDATA[sysadmin]]></category><category><![CDATA[vps]]></category><category><![CDATA[cloudflare]]></category><category><![CDATA[nginx]]></category><category><![CDATA[nodejs]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Wed, 26 Oct 2016 13:54:29 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/11/Ghost-Transparent-for-LIGHT-BG-1.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/11/Ghost-Transparent-for-LIGHT-BG-1.png" alt="Good bye WordPress - Welcome Ghost !"><p>I&apos;m using WordPress for few years now, but that&apos;s always the same problem, WordPress require plugins to have some functionalities and plugins make WordPress running slower.</p>
<p>Even with an advanced caching system like redis, that&apos;s always a lot of work to make wordpress running fast and safe.</p>
<p>So I have done some tests with Ghost using Docker, and it&apos;s really the perfect blog solution for me, because it already include all the features needed to write an article.<br>
No need to look for a plugin to improve SEO or to install a caching system.<br>
You can write you articles in markdown, work with slack and use it as a team, and the theme system is really clean and lightweight.</p>
<p>But I can&apos;t post this article without making a tutorial about Ghost.</p>
<h4 id="1installnodejsv4lts">1) Install NodeJs v4 LTS</h4>
<pre><code>wget https://deb.nodesource.com/setup_4.x
chmod +x setup_4.x
./setup_4.x
apt-get install nodejs -y
</code></pre>
<h4 id="2installghost">2) Install Ghost</h4>
<pre><code>mkdir /var/www/ghost
cd /var/www/ghost
curl -L https://ghost.org/zip/ghost-latest.zip -o ghost.zip
unzip ghost.zip
npm install --production
</code></pre>
<h4 id="3startingghost">3) Starting Ghost</h4>
<pre><code>npm start --production
</code></pre>
<p>Then you can access to your blog using <code>http://localhost:2368/ghost/signup</code><br>
All the configuration can be found in the file config.js.</p>
<p>But as you can see, we have to use the port 2368 to access to Ghost. To fix that, the easiest is to use Nginx as reverse proxy. Let&apos;s use easyengine !</p>
<pre><code>## install easyengine
wget -qO ee rt.cx/ee &amp;&amp; bash ee

## create a proxy with your domain
ee site create anystack.xyz --proxy=127.0.0.1:2368
</code></pre>
<p>Then you will be able to use your domain to access to ghost. Don&apos;t forget to change your blog url in config.js. And if you want to run Ghost forever, so use forever ...</p>
<pre><code>npm install forever -g
## start ghost
NODE_ENV=production forever start index.js

## stop ghost
forever stop index.js
</code></pre>
<p>Last tips ? How to use Ghost with Nginx as reverse proxy with Cloudflare SSL.<br>
Go into you Cloudflare account and in the Crypto tabs, create your origin certificate.</p>
<p><img src="https://anystack.xyz/content/images/2016/10/Screenshot_1.png" alt="Good bye WordPress - Welcome Ghost !" loading="lazy"></p>
<p>Then create a first file yourdomain-pvkey.pem with the private key generated by Cloudflare. And another file yourdomain-crt.pem with the origin certificate from cloudflare but also the Cloudflare root certificate you can find <a href="https://support.cloudflare.com/hc/en-us/articles/218689638-What-are-the-root-certificate-authorities-CAs-used-with-CloudFlare-Origin-CA-">here</a></p>
<p>Then your nginx conf for you domain should look like</p>
<pre><code>server {

    server_name anystack.xyz;
    listen 443 ssl http2;
    ssl on;
    ssl_certificate     /etc/nginx/ssl/anystack-crt.pem;
    ssl_certificate_key     /etc/nginx/ssl/anystack-key.pem;
    access_log /var/log/nginx/dev.anystack.xyz.access.log rt_cache;
    error_log /var/log/nginx/dev.anystack.xyz.error.log;

    location / {
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_pass http://127.0.0.1:2368/;
        }

}
</code></pre>
<p>And if you want to add a redirect from http to a https, create a file yourdomain.com-ssl.conf in /etc/nginx/conf.d with</p>
<pre><code>	server {
	listen 80;
	server_name anystack.xyz;
	return 301 https://anystack.xyz$request_uri;
}
</code></pre>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Optimize easily your WordPress images without any plugin]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>You want to improve your pagespeed score by optimizing your images in WordPress ? But you don&apos;t want to pay a subscription for a plugin ? If you are using a VPS or a dedicated server, you don&apos;t need any plugin to optimize all your images easily.</p>
<p>For</p>]]></description><link>https://anystack.xyz/optimize-wordpress-images-without-plugin/</link><guid isPermaLink="false">5c40c890c86475242ab3852e</guid><category><![CDATA[server]]></category><category><![CDATA[linux]]></category><category><![CDATA[WordPress]]></category><category><![CDATA[optimization]]></category><category><![CDATA[vps]]></category><category><![CDATA[CDN]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Sun, 23 Oct 2016 05:52:28 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/Optimize--2--min.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/Optimize--2--min.png" alt="Optimize easily your WordPress images without any plugin"><p>You want to improve your pagespeed score by optimizing your images in WordPress ? But you don&apos;t want to pay a subscription for a plugin ? If you are using a VPS or a dedicated server, you don&apos;t need any plugin to optimize all your images easily.</p>
<p>For that you can use this script :</p>
<pre><code># For debian/Ubuntu
wget -qO optimize.sh https://git.virtubox.net/virtubox/wp-optimize/raw/master/deb-wp-optimize.sh &amp;&amp; bash optimize.sh

#For Centos/RedHat
cd /var/www
wget -qO optimize.sh https://git.virtubox.net/virtubox/wp-optimize/raw/master/centos-wp-optimize.sh &amp;&amp; bash optimize.sh
</code></pre>
<p>If you want to do the process manually</p>
<pre><code># Debian/Ubuntu
apt-get update &amp;&amp; apt-get install optipng jpegoptim -y

# Centos
yum update &amp;&amp; yum install optipng jpegoptim -y
</code></pre>
<p>Then you just have to go in your web directory and to run the following commands :</p>
<pre><code>cd /var/www
find . -name *.jp* | xargs jpegoptim --strip-all -m76
find . -iname &apos;*.png&apos; -print0 | xargs -0 optipng -o7 -preserve
</code></pre><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[Making WordPress faster by running wp-cron with Linux]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>WordPress use wp-cron to check updates for themes, plugins and some other process but it could have an impact on your website speed because WordPress execute it on every page-loading. So if you have a lot of traffic, it will (no benchmark proof at the moment)&#xA0;delay page loading</p>]]></description><link>https://anystack.xyz/making-wordpress-faster-running-wp-cron-linux/</link><guid isPermaLink="false">5c40c890c86475242ab38536</guid><category><![CDATA[hosting]]></category><category><![CDATA[server]]></category><category><![CDATA[linux]]></category><category><![CDATA[WordPress]]></category><category><![CDATA[optimization]]></category><category><![CDATA[vps]]></category><category><![CDATA[sysadmin]]></category><category><![CDATA[Tutorials]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Thu, 15 Sep 2016 05:54:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/AnyStack---wp-cron--2--1.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/AnyStack---wp-cron--2--1.png" alt="Making WordPress faster by running wp-cron with Linux"><p>WordPress use wp-cron to check updates for themes, plugins and some other process but it could have an impact on your website speed because WordPress execute it on every page-loading. So if you have a lot of traffic, it will (no benchmark proof at the moment)&#xA0;delay page loading for users.</p>
<p>So if you are using a linux server (VPS or dedicated), you can easily create a cron job to run it each 5 minutes or each 10 minutes. But remember WordPress need wp-cron to work properly, so don&apos;t disable it &#xA0;totally !</p>
<p>To disable wp-cron, just add the following line in wp-config.php  :</p>
<pre><code>define(&apos;DISABLE_WP_CRON&apos;, true); </code></pre>
<p>Then to add a cronjob you have to a :</p>
<pre><code>## Run the crontab with your server or vhost user 
crontab -u yourserveruser -e

## method 1 : using curl to run the script
*/10 * * * * curl http://example.com/wp-cron.php &gt; /dev/null 2&gt;&amp;1

## method 2 : using php to run it
*/10 * * * * cd /var/www/example.com/htdocs; php /var/www/example.com/htdocs/wp-cron.php &gt; /dev/null 2&gt;&amp;1
</code></pre>
<p>The first method use PHP-CGI when the second use PHP-CLI, the only difference is CLI does not have time limit to run a script.<br>
Because this way, the wp-cron will not impact page loading speed, it&apos;s highly recommended to use linux cron instead of default WordPress cron.</p>
<p>You can change */10 with */5 to run the cron each 5 minutes instead of each 10 minutes.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[How to use Nginx as reverse proxy with Docker]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I have already write <a href="https://anystack.xyz/tag/easyengine/" target="_blank">some articles</a> about <a href="https://easyengine.io" target="_blank">EasyEngine</a>, and I&apos;m really in love with this command line tool, because it make Nginx easier to use than Apache. But I haven&apos;t talk about all functionality of EE yet. If it provide you the ability to setup a</p>]]></description><link>https://anystack.xyz/how-nginx-reverse-proxy-docker/</link><guid isPermaLink="false">5c40c890c86475242ab38537</guid><category><![CDATA[Docker]]></category><category><![CDATA[linux]]></category><category><![CDATA[nginx]]></category><category><![CDATA[EasyEngine]]></category><category><![CDATA[sysadmin]]></category><category><![CDATA[Tutorials]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Sun, 04 Sep 2016 06:57:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/dockeenginx-1.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/dockeenginx-1.png" alt="How to use Nginx as reverse proxy with Docker"><p>I have already write <a href="https://anystack.xyz/tag/easyengine/" target="_blank">some articles</a> about <a href="https://easyengine.io" target="_blank">EasyEngine</a>, and I&apos;m really in love with this command line tool, because it make Nginx easier to use than Apache. But I haven&apos;t talk about all functionality of EE yet. If it provide you the ability to setup a WordPress website easily, you can also use EasyEngine to create a vhost for a static html website ... Or use Nginx as a reverse proxy !</p>
<p>And that make of EE the most complete tool available to use Nginx without having to read thousands of documentation pages to understand how to create a vhost. But don&apos;t worry, this article will not only talk about this awesome tool which is EasyEngine.</p>
<p>I have used docker several times in the past, because it&apos;s the fastest way to test an application without having to setup a VPS especially for that. But to run several Docker containers in a single VPS, it could quickly be a problem because some container provide you the ability to use a domain like WordPress for example. And some other will use directly your VPS IP and the port of your choice, which is not very friendly when your app is running on <a href="http://192.168.0.1:3000">http://192.168.0.1:3000</a> ...</p>
<p>That&apos;s why we will use Nginx to act as a reverse proxy for our Docker containers, and we will be able to run several containers on the same server and to access them with the domain of our choice. So the first step is to install Docker. Don&apos;t worry you should not need to read the documentation if you are using a VPS with a recent linux distribution and a kernel 3.13+</p>
<pre><code>### install Docker with a single command on debian/ubuntu/centos
wget -qO- https://get.docker.com/ | sh
</code></pre>
<p>Docker is now running on your server ! So let&apos;s install EasyEngine :</p>
<pre><code>## Install EasyEngine Debian7/8 or Ubuntu 14.04/16.04 LTS
wget -qO ee rt.cx/ee &amp;&amp; bash ee
</code></pre>
<p>So we have now Docker and EasyEngine installed and we can launch our first Docker App before routing it with Nginx.<br>
We will start with Rocket.Chat, a complete live chat solution to build a community or to provide live support.</p>
<pre><code>## Launch MongoDB container 
docker run --name db -d mongo:3.0 --smallfiles

## Run Rocket.Chat linked to the db and expose port 3000
docker run --name rocketchat -p 3000:3000 --env ROOT_URL=http://localhost --link db -d rocket.chat
</code></pre>
<p>So you should be able to access to Rocket.Chat using <a href="http://YOUR-VPS-IP:3000">http://YOUR-VPS-IP:3000</a>.<br>
And to use Nginx as reverse proxy with your domain :</p>
<pre><code>ee site create yourdomain.com --proxy=127.0.0.1:3000</code></pre>
<p>That&apos;s it ! You can now use <a href="http://yourdomain.com">http://yourdomain.com</a> to access to Rocket.Chat</p>
<p>Some other apps to run with Nginx as reverse proxy :</p>
<pre><code>## Hastebin
docker run --name redis -d redis
docker run --name hastebin -d -p 7777:7777 --link redis:redis -e STORAGE_HOST=redis rlister/hastebin

## Pasteboard
docker run --name pasteboard -e ORIGIN=mydomain.tld -e MAX=7 -v /srv/pasteboard/images:/pasteboard/public/storage -p 4000:4000 anthodingo/docker-pasteboard
</code></pre><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[NIXStats - Server and domains monitoring]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Today a very small post to talk about <a href="https://nixstats.com" target="_blank">NIXStats</a>, a new server and domains monitoring service currently in beta and totally free. You can monitor your server using a bash script or a python script and you domain to receive an alert in case of downtime. You can also have</p>]]></description><link>https://anystack.xyz/nixstats-server-domains-monitoring/</link><guid isPermaLink="false">5c40c890c86475242ab38535</guid><category><![CDATA[hosting]]></category><category><![CDATA[sysadmin]]></category><category><![CDATA[webmaster]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Thu, 25 Aug 2016 06:56:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/anystack.xyz-monitoring.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/anystack.xyz-monitoring.png" alt="NIXStats - Server and domains monitoring"><p>Today a very small post to talk about <a href="https://nixstats.com" target="_blank">NIXStats</a>, a new server and domains monitoring service currently in beta and totally free. You can monitor your server using a bash script or a python script and you domain to receive an alert in case of downtime. You can also have some stats about your server speed so I recommend you to test it during the beta.</p>
<p><img src="https://anystack.xyz/content/images/2016/10/anystack-vps-monitoring.png" alt="NIXStats - Server and domains monitoring" loading="lazy"></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[HTTP2 & Web Optimization - How to have a fast website in 2016]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>Few years ago, the HTTPs protocol was slower than the http, due the the initial handshake of any SSL transaction. But with the HTTP2, there are several improvements available and some rules have change when we talk about web optimization. Most of the PageSpeed tools will recommend you to use</p>]]></description><link>https://anystack.xyz/http2-web-optimization-fast-website-2016/</link><guid isPermaLink="false">5c40c890c86475242ab3853b</guid><category><![CDATA[server]]></category><category><![CDATA[optimization]]></category><category><![CDATA[cloudflare]]></category><category><![CDATA[CDN]]></category><category><![CDATA[sysadmin]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Thu, 11 Aug 2016 06:48:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/diagram-asynchronous-resource-loading.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/diagram-asynchronous-resource-loading.png" alt="HTTP2 &amp; Web Optimization - How to have a fast website in 2016"><p>Few years ago, the HTTPs protocol was slower than the http, due the the initial handshake of any SSL transaction. But with the HTTP2, there are several improvements available and some rules have change when we talk about web optimization. Most of the PageSpeed tools will recommend you to use domain sharding or to combine your assets to have a website faster. But is it still true ?</p>
<p>The most important feature of the HTTP2 is the <a href="https://http2.github.io/faq/#why-is-http2-multiplexed">multiplexing</a>, it allow to download multiple files with an unique TCP connection when we have to open a new one for each file in HTTP1.1</p>
<p><img src="https://anystack.xyz/content/images/2016/10/http2-multiplexing-1.jpg" alt="HTTP2 &amp; Web Optimization - How to have a fast website in 2016" loading="lazy"></p>
<h2>1) No more assets concatenation</h2>
<p>We used to combine as much as possible our assets with HTTP1.1, that&apos;s not true with HTTP2 anymore. Because if it reduce the size of the requests done, it also make the rules for caching harder to define and could have &#xA0;bad results if you don&apos;t need a part of the assets on each page of your website</p>
<p><img src="https://anystack.xyz/content/images/2016/10/http-1-1-file-concatenation.png" alt="HTTP2 &amp; Web Optimization - How to have a fast website in 2016" loading="lazy"></p>
<p><img src="https://anystack.xyz/content/images/2016/10/http-2-file-concatenation-1.png" alt="HTTP2 &amp; Web Optimization - How to have a fast website in 2016" loading="lazy"></p>
<p>&#xA0;</p>
<p>&#xA0;</p>
<h2>2) No more domain sharding</h2>
<p>It was already a &quot;trick&quot; but the domain sharding is not a part of the past. It was used to open more TCP connection than a browser was supposed to. But you will have a negative result by using it with HTTP2 because it will only require unnecessary DNS request and more if the connection is established under TLS.</p>
<p><img src="https://anystack.xyz/content/images/2016/10/domain-sharding-1-2.png" alt="HTTP2 &amp; Web Optimization - How to have a fast website in 2016" loading="lazy"></p>
<p>But there are also rules which are still Best Pratices to have a fast website</p>
<ul>
    <li>Reduce DNS lookup -&gt; store all assets on the same domain or with a CDN</li>
    <li>Browser Caching</li>
    <li>Minimize HTTP Requests -&gt; cookies and query strings</li>
    <li>Minimize HTTP Response -&gt; Minify your assets</li>
</ul><!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[HOW CLOUDFLARE SPEED UP AND PROTECT YOUR WEBSITE – PART 2.]]></title><description><![CDATA[<!--kg-card-begin: markdown--><h2>Cloudflare SSL : 3 security levels</h2>
<p>You are maybe aware than https will become a standard for all websites in the next few years, because it&apos;s encrypt the connection between your visitors and your website, making it safer for them.</p>
<p>With Cloudflare you have 3 level of SSL security.</p>]]></description><link>https://anystack.xyz/cloudflare-speed-protect-secure/</link><guid isPermaLink="false">5c40c890c86475242ab38534</guid><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Wed, 10 Aug 2016 04:56:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/ssl-cert-diagram-sha1-2-cert-optimization.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><h2>Cloudflare SSL : 3 security levels</h2>
<img src="https://anystack.xyz/content/images/2016/10/ssl-cert-diagram-sha1-2-cert-optimization.png" alt="HOW CLOUDFLARE SPEED UP AND PROTECT YOUR WEBSITE &#x2013; PART 2."><p>You are maybe aware than https will become a standard for all websites in the next few years, because it&apos;s encrypt the connection between your visitors and your website, making it safer for them.</p>
<p>With Cloudflare you have 3 level of SSL security. The first one name &quot;Flexible&quot; will not require you to install SSL on your server, acting as a proxy Cloudflare will only use SSL between your visitors and their servers. If your visitors will be able to navigate on your website with an encrypted connexion, this configuration is not really secured as anyone can intercept data between cloudflare and your server. This kind of attack are named &quot;man-in-the-middle&quot;.<br>
<img src="https://anystack.xyz/content/images/2016/10/ssl.png" alt="HOW CLOUDFLARE SPEED UP AND PROTECT YOUR WEBSITE &#x2013; PART 2." loading="lazy"></p>
<p>The second level of SSL with cloudflare will require for you to setup a valid SSL certificate. That doesn&apos;t mean you will have top pay for that. You can use letsencrypt to secure your server, and then use cloudflare in &quot;Full SSL&quot; to have this time a totally secured connection between your server and your visitor.</p>
<p>For me, if you want to use SSL, the Full SSL is the minimum to setup. The flexible mode is really useless as it doesn&apos;t protect properly your visitors. And the next level the Full &quot;Strict&quot; will require a valid certificate, signed by a trusted authority. This also require to use the HSTS, which is a mechanism to force a browser to use ssl on a website for a fixed period. That mean, if your website don&apos;t use SSL all the time, any modern browser will block the connection to protect the user. So when you are using HSTS, you have to be sure than the SSL certificate will always be valid. This is the most secure level to setup with Cloudflare, but it should not be required if you don&apos;t need a very high-level of security to process credit card or other transaction.</p>
<h2>How to use https instead of http ?</h2>
<p>At first you have to be sure than all the content available on your website can be delivered to your visitors using https. That mean you will have to check your if there are not some external css or javascript which is process using http. The easiest way &#xA0;to have files compatible under https is to link all your assets like that :</p>
<pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;//thedomain.com/css/yourtheme.css&quot; type=&quot;text/css&quot; /&gt;</code></pre>
<p>But even with this method, if a file could not be processed under https, it will be blocked by the visitor&apos;s browser and it will not see the green padlock in his browser. So check properly the sources of your assets, there are a lot of wordpress themes which still request google fonts using http.</p>
<p>So now, we will use letsencrypt to get a free SSL certificate. But before, if you are already using Cloudflare, you will have to disable the proxy mode, because to validate your domain ownership, letsencrypt create a small file named &quot;.well-known&quot; on your webspace and try to access it by resolving your IP. That mean if you are using Cloudflare, it will try to validate the proxy and it will fail.</p>
<p>For Apache on Ubuntu/Debian :</p>
<pre><code>apt-get install git
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
cd /opt/letsencrypt

## you can use it also for a subdomain like -d subdomain.example.com
./letsencrypt-auto --apache -d example.com -d www.example.com

</code></pre>
<p>Let&apos;s do the same with Nginx</p>
<pre><code>apt-get install git
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
cd /opt/letsencrypt
./letsencrypt-auto certonly --webroot -w /var/www/example.com/htdocs/ -d  example.com -d www.example.com --email contact@example.com --text --agree-tos

## then to activate it with Nginx, add this on your server { } config
    listen 443 ssl http2;
    ssl on;
    ssl_certificate     /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key     /etc/letsencrypt/live/example.com/privkey.pem;

## and reload nginx
nginx -t &amp;&amp; service nginx reload

## And if you want to force http to https 
nano /etc/nginx/conf.d/force-ssl.conf
## then add
    server {
    listen 80;
    server_name example.com;
    return 301 https://example.com$request_uri;
}

</code></pre>
<p>And if you want to renew automatically your certificate, it&apos;s not very hard</p>
<pre><code>## to renew automatically your certificate
sudo crontab -e
## then enter
30 2 * * 1 /opt/letsencrypt/letsencrypt-auto renew &gt;&gt; /var/log/le-renew.log

## to update letsencrypt
cd /opt/letsencrypt
sudo git pull
</code></pre>
<p>So, you have now a valid SSL certificate, and you should see the small green padlock in your browser. And you can now use Cloudflare in &quot;Full SSL&quot; and that mean your website should be safer for your visitors.</p>
<p>And the last level of security with Cloudflare is now really easier, because it was required to buy an SSL certificate in the past, it&apos;s now over because Cloudflare will issue it for you, and it&apos;s totally free. So you will have to go to your Cloudflare account in the crypto tabs of your domain. And in the section Origin certificates, you will be able to create a certificate, and then to install it on your server by following the tutorials available for each web server.</p>
<p>But if you are using a control panel like Plesk, it doesn&apos;t work the same than with a classic web server. It will require to create a CSR (Certificate Signing request) like if you are planning to buy a certificate. But you will just have to enter your personal details, and then to click on request to have the CSR and you private key. Then you just have to download the .pem file and to open it will a text editor to copy the details at Cloudflare.<br>
And it will give you the certificate to add in your control panel. <strong>BUT</strong> you will also have to enter the Cloudflare root certificate which is the authority to validate it. It take me few hours to find the post about it on the Cloudflare knowledge base : <a href="https://support.cloudflare.com/hc/en-us/articles/218689638-What-are-the-root-certificate-authorities-CAs-used-with-CloudFlare-Origin-CA-">Root Certificate Cloudflare</a></p>
<p>So you should have your CSR on your control panel, and you private key, your certificate and the root authority, and you will just have to copy them in the text area available to have a real certificate, validated by an authority. It will allow you to use the Cloudflare &quot;Full SSL (Strict)&quot; mode which is the last security level with Cloudflare.<br>
So all the data between your visitors and your website will be fully encrypted, and you should have the best result at SSLabs when you will test the security level of your SSL server.</p>
<p><img src="https://anystack.xyz/content/images/2016/10/ssla-640x400.png" alt="HOW CLOUDFLARE SPEED UP AND PROTECT YOUR WEBSITE &#x2013; PART 2." loading="lazy"></p>
<p>&#xA0;</p>
<p>And when the https was slower than http few years ago, because it require an initial handshake during the first connection, it include now several features and the biggest one is the HTTP2.</p>
<p>But I will write another post about that later, because it will require a complete article.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[New VPS for the Blog - Setup Guide]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>I was using a VPS with Plesk Onyx to host the Blog, but even with Redis in a Docker container to make it faster, it wasn&apos;t enough ...</p>
<p>So I have setup a small VPS on my dedicated server with Ubuntu 16.04 LTS using VMware vSphere 6. I</p>]]></description><link>https://anystack.xyz/new-vps-blog-setup-guide/</link><guid isPermaLink="false">5c40c890c86475242ab3853d</guid><category><![CDATA[linux]]></category><category><![CDATA[nginx]]></category><category><![CDATA[WordPress]]></category><category><![CDATA[EasyEngine]]></category><category><![CDATA[redis-server]]></category><category><![CDATA[optimization]]></category><category><![CDATA[vps]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Fri, 05 Aug 2016 18:59:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/wordpressvps.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/wordpressvps.png" alt="New VPS for the Blog - Setup Guide"><p>I was using a VPS with Plesk Onyx to host the Blog, but even with Redis in a Docker container to make it faster, it wasn&apos;t enough ...</p>
<p>So I have setup a small VPS on my dedicated server with Ubuntu 16.04 LTS using VMware vSphere 6. I will make another post about virtualization but in this post, we will talk only about the VPS setup with easyengine, which is really my favorite tool for WordPress setup. You can also read my first post about easyengine : <a href="https://anystack.xyz/blazing-fast-wordpress-nginx-php7-redis/">Here</a></p>
<p>First step, easyengine install :</p>
<pre><code> wget -qO ee rt.cx/ee &amp;&amp; bash ee </code></pre>
<p>Then WordPress setup :</p>
<pre><code> ee site create anystack.xyz --wpredis --php7 --letsencrypt </code></pre>
<p>And it&apos;s already good for the server setup with nginx, php7, mariadb, redis-cache and let&apos;s encrypt for the SSL. Check your DNS are pointing to your server before launching let&apos;s encrypt or it will fail to setup the SSL certificate.</p>
<p>But the work is not finished yet, because I have to upload my database and my files to get my content back. For that i will need to have access to the database, so let&apos;s do that with phpmyadmin :</p>
<pre><code> ee stack install --phpmyadmin </code></pre>
<p>phpmyadmin is now available at <a href="http://my-server-ip:22222">http://my-server-ip:22222</a></p>
<p>Butt protected by an ACL, and to change the user and the password, you just have to use :</p>
<pre><code> ee secure --auth </code></pre>
<p>And to have your login details for phpmyadmin :</p>
<pre><code> ee site info anystack.xyz </code></pre>
<p>So I have now uploaded my database, and I need my files. But it&apos;s not needed to install ftp. The easiest way to do, is to add a password to www-data and to allow sftp access :</p>
<pre><code> passwd www-data </code></pre>
<p>And you will just have to replace /usr/sbin/nologin by /bin/bash in the file /etc/passwd. As FTP/SFTP client, I use <a href="https://cyberduck.io/">Cyberduck</a> which is the fastest client I have found, and you can use it for almost all protocol, including S3 storage at AWS or Google Drive.</p>
<p>After uploading my files, just have to purge the redis cache, and that&apos;s already over.<br>
<img src="https://anystack.xyz/content/images/2016/10/Screenshot_2--1-.png" alt="New VPS for the Blog - Setup Guide" loading="lazy"></p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[How to make your code more beautiful on WordPress]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>&#xA0;</p>
<p>Because I have started using it only few days ago, I have to make a small article about it. If you are using TinyMCE on WordPress, you should already have more functionality for the code rendering in an article. But if you want to have beautiful colors and perfectly</p>]]></description><link>https://anystack.xyz/make-code-beautiful-wordpress-2/</link><guid isPermaLink="false">5c40c890c86475242ab38533</guid><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Fri, 05 Aug 2016 04:50:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/hihglistgs.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/hihglistgs.png" alt="How to make your code more beautiful on WordPress"><p>&#xA0;</p>
<p>Because I have started using it only few days ago, I have to make a small article about it. If you are using TinyMCE on WordPress, you should already have more functionality for the code rendering in an article. But if you want to have beautiful colors and perfectly readable code there is a small jquery plugin for that.</p>
<pre><code>/////////////////////////////////////////////////////////////////

                          highlightjs

/////////////////////////////////////////////////////////////////
</code></pre>
<p>This small jquery code will automatically color 162 languages with 74 styles available.<br>
So let&apos;s see how to use it !<br>
You just have to add this code in your theme header:</p>
<pre><code>&lt;link rel=&quot;stylesheet&quot; href=&quot;//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/styles/railscasts.min.css&quot;&gt;
&lt;script src=&quot;//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min.js&quot;&gt;&lt;/script&gt;
&lt;script&gt;hljs.initHighlightingOnLoad();&lt;/script&gt;
</code></pre>
<p>And you can replace <strong>railscasts</strong>.min.css with another style available on the <a src="https://highlightjs.org/">highlightjs</a> website. Currently I&apos;m using gist-github style.</p>
<p>To use highlightjs in your article, just add :</p>
<pre><code>&lt;pre&gt;&lt;code&gt; 
Your code
&lt;/code&gt;&lt;/pre&gt;</code></pre>
<p>So let&apos;s add some code to our articles !</p>
<!--kg-card-end: markdown-->]]></content:encoded></item><item><title><![CDATA[How Cloudflare speed up and protect your website - Part 1.]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p style="text-align: justify;"><strong>You don&apos;t know what is Cloudflare ?&#xA0;<span style="line-height: 1.5;">So let&apos;s see how cloudflare make your website loading faster, and why you should already use it for all your websites.</span></strong></p>
<ol style="text-align: justify;">
    <li>
<h2><span style="font-size: 18pt;"><strong>) Cloudflare DNS - Free &amp; Fast</strong></span></h2>
</li>
</ol>
<p style="text-align: justify;">Cloudflare provide at first one of the best DNS hosting service available.</p>]]></description><link>https://anystack.xyz/cloudflare-speed-protect-website/</link><guid isPermaLink="false">5c40c890c86475242ab38539</guid><category><![CDATA[server]]></category><category><![CDATA[linux]]></category><category><![CDATA[optimization]]></category><category><![CDATA[cloudflare]]></category><category><![CDATA[CDN]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Mon, 01 Aug 2016 18:57:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/network-map.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/network-map.png" alt="How Cloudflare speed up and protect your website - Part 1."><p style="text-align: justify;"><strong>You don&apos;t know what is Cloudflare ?&#xA0;<span style="line-height: 1.5;">So let&apos;s see how cloudflare make your website loading faster, and why you should already use it for all your websites.</span></strong></p>
<ol style="text-align: justify;">
    <li>
<h2><span style="font-size: 18pt;"><strong>) Cloudflare DNS - Free &amp; Fast</strong></span></h2>
</li>
</ol>
<p style="text-align: justify;">Cloudflare provide at first one of the best DNS hosting service available. And to make a website faster you can already start with using a fast DNS hosting.</p>
<p style="text-align: justify;"><strong>DNS Provider Speed Comparison by&#xA0;solvedns.com</strong></p>
![](/content/images/2016/10/draw.jpg)
<p style="text-align: justify;">It&apos;s only few Milliseconds but as you can see, Cloudflare is faster than many other providers and most of them offer paid services only. So before paying few dollars for a Premium DNS package, you should try cloudflare. Another feature you will love, is a propagation time around 5 minutes when you edit a record on your DNS. So if you need to migrate your website soon, this is really a good reason to register now.</p>
<h2 style="text-align: justify;"><span style="font-size: 18pt;"><strong>2. ) Cloudflare - Reverse Proxy with caching&#xA0;</strong></span></h2>
<p style="text-align: justify;">But cloudflare does not provide only DNS Hosting. It&apos;s also a complete solution to speed up and secure your website. For that when Cloudflare manage your DNS if you activate the optimization and security (orange cloud), instead of sending your server IP when a visitor make a DNS request, it will act as a proxy and all your visitors will view only the Cloudflare servers IP when they do a request.</p>
![](/content/images/2016/10/overview.png)
<p style="text-align: justify;">And Cloudflare will not only act as a simple proxy, it will also cache all the static files and deliver them all around the World to your visitors from the nearest Cloudflare datacenter.</p>
<p style="text-align: justify;">The result is awesome because it will make your website faster as it will handle less requests, and it will also save a lot of bandwidth by limiting the number of file requests.</p>
<p><img src="https://anystack.xyz/content/images/2016/10/0ea0ab24-290b-4b40-b974-57b2499162cf.png" alt="How Cloudflare speed up and protect your website - Part 1." loading="lazy"></p>
<p style="text-align: justify;">As you can see, with 80 000 visitors per month, it&apos;s more than 20GB of bandwidth saved and also more than 20GB of static assets which have been delivered faster.</p>
<h2 style="text-align: justify;"><strong><span style="font-size: 18pt;">3) Cloudflare - Website Protection</span></strong></h2>
<p style="text-align: justify;">By acting as a proxy Cloudflare also provide a complete security solution which include :</p>
<ul style="text-align: justify;">
    <li style="text-align: justify;"><strong>Browser integrity check</strong> : Each visitor request is checked using the HTTP header and if a thread is found it can be challenged using a captcha or blocked.</li>
    <li style="text-align: justify;"><strong>Visitor reputation</strong> : Cloudflare analyze daily thousands of IP, and if a visitor try several times to perform any form of hack, it will be marked as a potential thread for Cloudflare</li>
    <li style="text-align: justify;"><strong>Page rules :&#xA0;</strong>You can use the page rules to allow or disallow access to a part of your website. For example with wordpress your can use a high level of secuirty onthe page &#xA0;http://yourdomain.com/wp-login.php to protect your website.</li>
    <li style="text-align: justify;"><strong>DDoS protection</strong> : As &#xA0;your visitors have to use cloudflare servers to get access to your website, &#xA0;they will never have access to your server IP and any attack attempt will simply be blocked by the Cloudflare servers.&#xA0;
<p><img src="https://anystack.xyz/content/images/2016/10/reflection-attack-2.png" alt="How Cloudflare speed up and protect your website - Part 1." loading="lazy"></p>
<p style="text-align: justify;"><strong>But to protect totally your server, you have to be sure there is not any records which point directly to your server. The most common error will be to have a email server with a MX record&#xA0;pointing&#xA0; on your server IP. &#xA0;In this case, Cloudflare will not be able to protect your website because the attacker will send the traffic directly on your server IP, and will not have to use the Cloudflare proxy.</strong></p>
<p style="text-align: justify;"><span style="font-size: 18pt;"><strong>4) Cloudflare - Website Optimization</strong></span></p>
<p style="text-align: justify;">And if it wasn&apos;t enough, Cloudflare is also able to optimize your website. It can minify all your assets, including the html, reduce the number of connections, and with rocket loader it will make deliver your assets asynchronously. That mean instead of waiting for each file to be downloaded, with cloudflare your browser will download all the assets in the same time when you visit your website, and it will be up to 3x times faster.</p>
<p><img src="https://anystack.xyz/content/images/2016/10/optimization-asynchronous-loading.png" alt="How Cloudflare speed up and protect your website - Part 1." loading="lazy"></p>
<p style="text-align: justify;">The last optimization tool available for free is Rocket Loader, currently in beta, it&apos;s a script used by cloudflare to deliver your assets, without blocking the page display. It use the asynchronous loading to load your javascript at the end of the page display and this way it will really improve your pagespeed score. But like any beta, it could create error with some javascript or break your website design by loading too late some assets.</p>
<p style="text-align: justify;">For this reason you have 2 mode to use Rocket loader :</p>
<ul style="text-align: justify;">
    <li>Automatic : Rocket loader will optimize any javascript available on your website but you have the ability to forbid the optimization manually by adding &#xA0;data-cfasync=&quot;false&quot; before the script source.</li>
</ul>
<pre><code>
&lt;script type=&quot;text/javascript&quot; data-cfasync=&quot;false&quot; src=&quot;/js/tether.min.js&quot;&gt;&lt;/script&gt;
</code></pre>
<p>Manual : This time you will have to add <strong>data-cfasync=&quot;true&quot;</strong>&#xA0;for each script you want to optimize with Rocket Loader</p>
<p><strong>I will complete this article with the HTTP2 and Cloudflare in the next few days.</strong></p>
<!--kg-card-end: markdown--></li></ul>]]></content:encoded></item><item><title><![CDATA[Remove Query strings and add featured images in WordPress feeds]]></title><description><![CDATA[<!--kg-card-begin: markdown--><p>A small post today to share with you a small tips to remove all the queries strings from WordPress static assets, and also to add featured images of your posts in the WordPress feeds.</p>
<ol>
    <li>Go into your WordPress dashboard &gt; Appearance &gt; Editor</li>
    <li>Then find the file functions.php of</li></ol>]]></description><link>https://anystack.xyz/make-code-beautiful-wordpress/</link><guid isPermaLink="false">5c40c890c86475242ab38531</guid><category><![CDATA[WordPress]]></category><category><![CDATA[optimization]]></category><category><![CDATA[Tutorials]]></category><dc:creator><![CDATA[Thomas @VirtuBox]]></dc:creator><pubDate>Thu, 30 Jun 2016 00:45:00 GMT</pubDate><media:content url="https://anystack.xyz/content/images/2016/10/Screenshot_17.png" medium="image"/><content:encoded><![CDATA[<!--kg-card-begin: markdown--><img src="https://anystack.xyz/content/images/2016/10/Screenshot_17.png" alt="Remove Query strings and add featured images in WordPress feeds"><p>A small post today to share with you a small tips to remove all the queries strings from WordPress static assets, and also to add featured images of your posts in the WordPress feeds.</p>
<ol>
    <li>Go into your WordPress dashboard &gt; Appearance &gt; Editor</li>
    <li>Then find the file functions.php of your theme</li>
    <li>Add this code at the end of &#xA0;functions.php</li>
</ol>
<hr>
<pre><code>
//remove queries from static assets
function _remove_script_version( $src ){
$parts = explode( &apos;?ver&apos;, $src );
return $parts[0];
}
add_filter( &apos;script_loader_src&apos;, &apos;_remove_script_version&apos;, 15, 1 );
add_filter( &apos;style_loader_src&apos;, &apos;_remove_script_version&apos;, 15, 1 );

// Include thumbnails is the RSS feed
function rss_post_thumbnail($content) {
global $post;
if(has_post_thumbnail($post-&gt;ID)) {
$content = &apos;&lt;p&gt;&apos; . get_the_post_thumbnail($post-&gt;ID) .
&apos;&lt;/p&gt;&apos; . get_the_content();
}
return $content;
}
add_filter(&apos;the_excerpt_rss&apos;, &apos;rss_post_thumbnail&apos;);
add_filter(&apos;the_content_feed&apos;, &apos;rss_post_thumbnail&apos;);
</code></pre>
<hr>
<p>You can now try with GTMetrix.com if you have succefully remove the query strings. For the feed, you can test it with any RSS feed reader. Your WordPress feed are normally available at <a href="http://yourdomain.com/feed/">http://yourdomain.com/feed/</a>.</p>
<!--kg-card-end: markdown-->]]></content:encoded></item></channel></rss>