IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Serveurs (Apache, IIS,...) Discussion :

Droits et compilation Lighttpd


Sujet :

Serveurs (Apache, IIS,...)

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 16
    Points : 12
    Points
    12
    Par défaut Droits et compilation Lighttpd
    Bonjour,

    Je cherche à compiler le serveur lighttpd sur un RPS d'OVH. Je suis les indications de ce HOW TO : http://www.cyberciti.biz/tips/instal...ver-howto.html

    J'ai une petite question :
    Je cherche à installer lighttpd dans /opt/lighttpd pour simplifier, et créer un utilisateur lighttpd du groupe webadmin. Donc pour ce faire, je fais :
    téléchargement des sources dans /tmp et extraction,

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    mkdir /opt/lighttpd
    groupadd webadmin
    useradd -g webadmin -d /opt/var/ -s /sbin/nologin lighttpd   
    #/opt/var= racine du site, spécifié plus tard dans le fichier de conf lighttpd
    chown -R lighttpd:webadmin /opt/lighttpd
    
    ./configure --host=x86_64-debian-linux-gnu \
    --build=x86_64-debian-linux-gnu \
    --target=x86_64-debian-redhat-linux \
    --program-prefix= --prefix=/opt/lighttpd \
    --exec-prefix=/opt/lighttpd \
    --bindir=/opt/lighttpd/bin \
    --sbindir=/opt/lighttpd/sbin \
    --sysconfdir=/opt/lighttpd/etc \
    --datadir=/opt/lighttpd/share \
    --includedir=/opt/lighttpd/include \
    --libdir=/opt/lighttpd/lib \
    --libexecdir=/opt/lighttpd/libexec \
    --localstatedir=/opt/lighttpd/var \
    --sharedstatedir=/opt/lighttpd/com \
    --mandir=/opt/lighttpd/share/man \
    --infodir=/opt/lighttpd/share/info \
    --with-openssl \
    --with-pcre \
    --with-zlib \
    --with-bzip2 \
    --disable-ipv6 \
    --with-PACKAGE=mod_redirect \
    --with-rewrite \
    --with-redirect \
    --with-ssi
    Puis je suis la procédure du wiki officiel : http://redmine.lighttpd.net/projects...tallFromSource

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    sed -e 's/FOO/lighttpd/g' doc/rc.lighttpd > /etc/init.d/lighttpd
    chmod a+rx /etc/init.d/lighttpd
    cp -p doc/sysconfig.lighttpd /etc/sysconfig/lighttpd
    install -Dp ./doc/lighttpd.conf /etc/lighttpd/lighttpd.conf
    update-rc.d lighttpd defaults
    Sauf que ensuite :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    /etc/init.d/lighttpd start
    ne donne rien.

    Est ce que sa serait un problème de droits? lighttpd doit peut être faire partie du groupe root, ça risque de poser problème plus tard pour que lighttpd écoute sur le port 80 si il ne fait pas partie du groupe root? ou alors peut etre un problème de chmod dans /opt/lighttpd ?

    Merci pour votre aide !

  2. #2
    Invité
    Invité(e)
    Par défaut
    Hello,

    Tu dois spécifier le démon que tu souhaites démarrer.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    /etc/init.d/lighttpd start

  3. #3
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 16
    Points : 12
    Points
    12
    Par défaut
    autant pour moi, c'est une erreur de copié collé. Je spécifie bien le service lighttpd... Je corrige le post.

  4. #4
    Invité
    Invité(e)
    Par défaut
    peux-tu fournir le contenu de /etc/init.d/lighttpd

    Peux-tu également spécifier la distribution que tu utilises? car je vois que tu configures la compilation pour un système de type redhat alors que tu inscrit le service avec un utilitaire pour debian/ubuntu (rc-update)

  5. #5
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 16
    Points : 12
    Points
    12
    Par défaut
    Bon c'était encore une erreur de copié collé, désolé. J'avais bien mis x86_64-debian-linux-gnu.
    Sinon voici le script /etc/init.d/lighttpd :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    #!/bin/sh
    #
    # lighttpd     Startup script for the lighttpd server
    #
    # chkconfig: - 85 15
    # description: Lightning fast webserver with light system requirements
    #
    # processname: lighttpd
    # config: /etc/lighttpd/lighttpd.conf
    # config: /etc/sysconfig/lighttpd
    # pidfile: /var/run/lighttpd.pid
    #
    # Note: pidfile is assumed to be created
    # by lighttpd (config: server.pid-file).
    # If not, uncomment 'pidof' line.
    
    # Source function library
    . /etc/rc.d/init.d/functions
    
    if [ -f /etc/sysconfig/lighttpd ]; then
    	. /etc/sysconfig/lighttpd
    fi
    
    if [ -z "$LIGHTTPD_CONF_PATH" ]; then
    	LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
    fi
    
    prog="lighttpd"
    lighttpd="/usr/sbin/lighttpd"
    RETVAL=0
    
    start() {
    	echo -n $"Starting $prog: "
    	daemon $lighttpd -f $LIGHTTPD_CONF_PATH
    	RETVAL=$?
    	echo
    	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
    	return $RETVAL
    }
    
    stop() {
    	echo -n $"Stopping $prog: "
    	killproc $lighttpd
    	RETVAL=$?
    	echo
    	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
    	return $RETVAL
    }
    
    reload() {
    	echo -n $"Reloading $prog: "
    	killproc $lighttpd -HUP
    	RETVAL=$?
    	echo
    	return $RETVAL
    }
    
    case "$1" in
    	start)
    		start
    		;;
    	stop)
    		stop
    		;;
    	restart)
    		stop
    		start
    		;;
    	condrestart)
    		if [ -f /var/lock/subsys/$prog ]; then
    			stop
    			start
    		fi
    		;;
    	reload)
    		reload
    		;;
    	status)
    		status $lighttpd
    		RETVAL=$?
    		;;
    	*)
    		echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
    		RETVAL=1
    esac
    
    exit $RETVAL
    Je pense que c'est ce script qui ne fonctionne pas, car quand je fais un ./configure sans option, le script ne marche pas plus, alors que je peux lancer lighttpd à la main (lighttpd -f nomfichierdeconf.conf)

    Edit :
    Voici la ligne qui met le bazard : . /etc/rc.d/init.d/functions

    Sa doit être pour redhat je pense... Sur debian, vers où faut-il faire pointer le chemin?

    Edit 2 :
    Bon j'ai modifié /etc/rc.d/init.d/functions par /etc/init.d/, et :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if [ -z "$LIGHTTPD_CONF_PATH" ]; then
    	LIGHTTPD_CONF_PATH="/etc/lighttpd/lighttpd.conf"
    par
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if [ -z "$LIGHTTPD_CONF_PATH" ]; then
    	LIGHTTPD_CONF_PATH="cheminversmonfichierdeconf"
    et fais :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    echo "LIGHTTPD_CONF_PATH=cheminversmonfichierdeconf" > /etc/sysconfig/ligttpd
    sauf que j'ai un message d'erreur en lançant ou arrêtant lighttpd :

    en lançant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    /etc/init.d/lighttpd: line 18: .: /etc/init.d/: is a directory
    Starting lighttpd: /etc/init.d/lighttpd: line 34: daemon: command not found
    en arrêtant :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    /etc/init.d/lighttpd: line 18: .: /etc/init.d/: is a directory
    Stopping lighttpd: /etc/init.d/lighttpd: line 43: killproc: command not found
    Là je bloque...

  6. #6
    Invité
    Invité(e)
    Par défaut
    sysconfig, chkconfig => script init pour redhat like et non pour debian like.
    C'est la raison pour laquelle ton script ne fonctionne pas.

  7. #7
    Membre à l'essai
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    16
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 16
    Points : 12
    Points
    12
    Par défaut
    Après une petite recherche, voici un script init.d adapté par mes soins, qui a l'air de fonctionner :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    #! /bin/sh
    ### BEGIN INIT INFO
    # Provides:          skeleton
    # Required-Start:    $remote_fs
    # Required-Stop:     $remote_fs
    # Default-Start:     2 3 4 5
    # Default-Stop:      0 1 6
    # Short-Description: Example initscript
    # Description:       This file should be used to construct scripts to be
    #                    placed in /etc/init.d.
    ### END INIT INFO
    
    # Author: Foo Bar <foobar@baz.org>
    #
    # Please remove the "Author" lines above and replace them
    # with your own name if you copy and modify this script.
    
    # Do NOT "set -e"
    
    # PATH should only include /usr/* if it runs after the mountnfs.sh script
    PATH=/sbin:/usr/sbin:/bin:/usr/bin
    DESC="Serveur lighttpd"
    NAME=lighttpd
    DAEMON=/usr/local/sbin/$NAME
    DAEMON_ARGS="-f /opt/lighttpd/lighttpd.conf"
    PIDFILE=/var/run/$NAME.pid
    SCRIPTNAME=/etc/init.d/$NAME
    
    # Exit if the package is not installed
    [ -x "$DAEMON" ] || exit 0
    
    # Read configuration variable file if it is present
    #[ -r /opt/default/$NAME ] && . /etc/default/$NAME
    
    # Load the VERBOSE setting and other rcS variables
    . /lib/init/vars.sh
    
    # Define LSB log_* functions.
    # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
    . /lib/lsb/init-functions
    
    #
    # Function that starts the daemon/service
    #
    do_start()
    {
    	# Return
    	#   0 if daemon has been started
    	#   1 if daemon was already running
    	#   2 if daemon could not be started
    	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
    		|| return 1
    	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
    		$DAEMON_ARGS \
    		|| return 2
    	# Add code here, if necessary, that waits for the process to be ready
    	# to handle requests from services started subsequently which depend
    	# on this one.  As a last resort, sleep for some time.
    }
    
    #
    # Function that stops the daemon/service
    #
    do_stop()
    {
    	# Return
    	#   0 if daemon has been stopped
    	#   1 if daemon was already stopped
    	#   2 if daemon could not be stopped
    	#   other if a failure occurred
    	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
    	RETVAL="$?"
    	[ "$RETVAL" = 2 ] && return 2
    	# Wait for children to finish too if this is a daemon that forks
    	# and if the daemon is only ever run from this initscript.
    	# If the above conditions are not satisfied then add some other code
    	# that waits for the process to drop all resources that could be
    	# needed by services started subsequently.  A last resort is to
    	# sleep for some time.
    	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
    	[ "$?" = 2 ] && return 2
    	# Many daemons don't delete their pidfiles when they exit.
    	rm -f $PIDFILE
    	return "$RETVAL"
    }
    
    #
    # Function that sends a SIGHUP to the daemon/service
    #
    do_reload() {
    	#
    	# If the daemon can reload its configuration without
    	# restarting (for example, when it is sent a SIGHUP),
    	# then implement that here.
    	#
    	start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
    	return 0
    }
    
    case "$1" in
      start)
    	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
    	do_start
    	case "$?" in
    		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    	esac
    	;;
      stop)
    	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
    	do_stop
    	case "$?" in
    		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
    		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
    	esac
    	;;
      #reload|force-reload)
    	#
    	# If do_reload() is not implemented then leave this commented out
    	# and leave 'force-reload' as an alias for 'restart'.
    	#
    	#log_daemon_msg "Reloading $DESC" "$NAME"
    	#do_reload
    	#log_end_msg $?
    	#;;
      restart|force-reload)
    	#
    	# If the "reload" option is implemented then remove the
    	# 'force-reload' alias
    	#
    	log_daemon_msg "Restarting $DESC" "$NAME"
    	do_stop
    	case "$?" in
    	  0|1)
    		do_start
    		case "$?" in
    			0) log_end_msg 0 ;;
    			1) log_end_msg 1 ;; # Old process is still running
    			*) log_end_msg 1 ;; # Failed to start
    		esac
    		;;
    	  *)
    	  	# Failed to stop
    		log_end_msg 1
    		;;
    	esac
    	;;
      *)
    	#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
    	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
    	exit 3
    	;;
    esac
    
    :
    Je passe le thread en résolu après quelques tests.

Discussions similaires

  1. Réponses: 4
    Dernier message: 23/03/2015, 20h43
  2. Compiler avec droits administrateur
    Par franckcl dans le forum Langage
    Réponses: 7
    Dernier message: 29/05/2013, 12h07
  3. [A-03] Compiler Gauche/Droite et caractères
    Par Fvandermeulen dans le forum Requêtes et SQL.
    Réponses: 2
    Dernier message: 16/02/2009, 11h19
  4. problème de compilation de la fonction droite
    Par dimdoom dans le forum Requêtes et SQL.
    Réponses: 7
    Dernier message: 21/06/2007, 11h35
  5. Réponses: 1
    Dernier message: 27/05/2002, 01h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo