GNU/Linux >> Linux Esercitazione >  >> Ubuntu

Come abilitare la cache apache2 per velocizzare il tuo sito Web su Ubuntu

Per prima cosa abilita le mod:

sudo a2enmod file_cache
sudo a2enmod headers
sudo a2enmod expires
Code language: Bash (bash)

Quindi modifica l'host virtuale:

pico /etc/apache2/sites-enabled/000-default.conf
Code language: Bash (bash)

E aggiungi ifmodule tra host virtuale:

<VirtualHost *:80>
ServerName www.lateweb.info
ServerAdmin [email protected]
DocumentRoot /home/latewebi/public_html

# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
#Include conf-available/serve-cgi-bin.conf
<IfModule mod_expires.c>
# Turn on the module.
ExpiresActive on
# Set the default expiry times.
ExpiresDefault "access plus 2 days"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType text/css "now plus 1 month"
ExpiresByType image/ico "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 month"
ExpiresByType text/html "access plus 600 seconds"
</IfModule>
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Code language: Apache (apache)

Quindi riavvia il servizio Apache:

service apache2 restart
Code language: Bash (bash)

Ubuntu
  1. Come abilitare SSH su Ubuntu 18.04

  2. Come controllare la tua versione di Ubuntu

  3. Come abilitare il desktop remoto di Ubuntu

  4. Come abilitare la luce notturna su Ubuntu 17.10

  5. Ubuntu 20.04 – Come abilitare Hwe?

Come velocizzare il menu Applicazioni in Ubuntu 18.04

Come abilitare SSH in Ubuntu

Come velocizzare Ubuntu

Come rendere il tuo PC Ubuntu un punto di accesso wireless

Come accedere al tuo account Google Drive in Ubuntu

Come proteggere il tuo sito Web con Let's Encrypt su Ubuntu 20.04