Logo : un manchot sur fond d'étoile rouge
Alexandre Norman
de choses et d’autres
  • Blog
  • Projets
  • CV
Projets Python
  • python-gantt
  • python-nmap
  • pyClamd
Catégories
  • Asterisk
  • django
  • Outils
  • Poules
  • Raspberry Pi
  • Archives
Tags
  • asterisk (1)
  • bash (2)
  • Bricolage (1)
  • debian (6)
  • django (2)
  • dovecot (1)
  • GPS (1)
  • LDAP (1)
  • lighttpd (1)
  • méthode (3)
  • mpd (1)
  • Nagios (1)
  • openvpn (1)
  • OSM (3)
  • outils (6)
  • Palettes (1)
  • postfix (1)
  • postgrey (1)
  • Poules (1)
  • Python (6)
  • Raspberry Pi (6)
  • raspbian (6)
  • selenium (1)
  • shellscript (2)
  • voip (1)
  • wazo (1)
  • wifi (1)

Configuration d’un serveur lighttpd sur Raspbian

Publication : 2015.08.14
Catégorie : Raspberry Pi

Tags: Raspberry Pi debian raspbian lighttpd

Ce post n°5 fait partie de la série “Configuration d’un Raspberry PI sous Raspbian”.

  1. Installation de la distribution Raspbian sur un Raspberry Pi 2
  2. Configuration d’un point d’accès wifi sur Raspbian
  3. Configuration d’un serveur de mail postfix sur Raspbian
  4. Configuration d’un serveur openvpn sur Raspbian
  5. Configuration d’un serveur lighttpd sur Raspbian
  6. Configuration d’un serveur mpd sur Raspbian

Installation de paquets supplémentaires

Installation des paquets nécessaires :

apt-get install lighttpd php5-cgi php5-cli php5-common php5-curl \
  php5-gd php5-geoip php5-geos php5-imagick php5-intl php5-json \
  php5-mcrypt php5-memcache php5-memcached php5-mysql \
  php5-sqlite php5-tidy mysql-server

Configuration lighttpd

Editez le fichier de configuration de lighttpd pour réaliser la configuration que vous souhaitez. Afin de permettre l’utilisation de PHP en cgi, il faut ajouter un fichier supplémentaire : /etc/lighttpd/conf-available/10-fastcgi.conf

# /usr/share/doc/lighttpd/fastcgi.txt.gz
# http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions#mod_fastcgi-fastcgi

server.modules += ( "mod_fastcgi" )

## Start an FastCGI server for php (needs the php5-cgi package)
fastcgi.server    = ( ".php" => 
    ((
        "bin-path" => "/usr/bin/php-cgi",
        "socket" => "/var/tmp/lighttpd/php-fastcgi.socket" + var.PID,
        "max-procs" => "2",
        "idle-timeout" => "50",
        "bin-environment" => ( 
            "PHP_FCGI_CHILDREN" => "2",
            "PHP_FCGI_MAX_REQUESTS" => "200"
        ),
        "bin-copy-environment" => (
            "PATH", "SHELL", "USER"
        ),
        "broken-scriptfilename" => "enable"
    ))
)

Pour permettre la communication avec lighttpd :

mkdir /var/tmp/lighttpd/
chown www-data:www-data /var/tmp/lighttpd/

Redémarrer lighttpd :

: : :sh service lighttpd restart

Configuration de mysql

L’installation de mysql se fait toute seule, rien de particulier à faire.

On peut tenter l’optimiser mysql pour notre petit serveur. Pour cela, éditer le fichier /etc/mysql/my.cnf.

# Optimisations MYSQL
# Source : http://lowendbox.com/blog/yes-you-can-run-18-static-sites-on-a-64mb-link-1-vps/
# ------------------------------------------------------------------------------------
key_buffer = 16K
max_allowed_packet = 4M
table_cache = 4
sort_buffer_size = 64K
read_buffer_size = 256K
read_rnd_buffer_size = 256K
net_buffer_length = 2K
thread_stack = 64K

# Optimisations rompr
# ----------------------------------
query_cache_limit       = 16M
query_cache_size        = 64M
binlog_ignore_db = romprdb
innodb_buffer_pool_size = 64M
innodb_flush_log_at_trx_commit = 0

La suite

C’est par là : configuration de mpd

Site géré avec Pelican - thème personnel
font dyslexia Increase text size Decrease text size Flux RSS Twitter