serveur web ( apache ) sous linux

Upload: clubtutorielinformatique

Post on 11-Feb-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/23/2019 Serveur Web ( Apache ) sous Linux

    1/4

    IT NISROCLUB TUTORIEL INFORMATIQUE

    Configuration Apache (serveur web ) Sous Linux:

    Step1: vrification et linstallation Des packages :

    # rpm -qa|grep httpd

    #rpm -ivh httpd-3.0.5-3.el5.i386.rpm

    #yum install httpd

    Step2: configuration des fichiers principales :

    1) Editez le fichier de configuration et ajoutez les modifications ncessaires

    ##################### start of /etc/httpd/conf/httpd.conf #########################

    # DocumentRoot: The directory out of which you will serve your

    # documents. By default, all requests are taken from this directory, but

    # symbolic links and aliases may be used to point to other locations.

    DocumentRoot "/var/www/html/Web" // Spcifie le repertoire de base de site Nassir.lan

    # This should be changed to whatever you set DocumentRoot to.

    // Spcifie le repertoire de base de site Nassir.lan

    # Control access to UserDir directories. The following is an example

    # for a site where these directories are restricted to read-only.

    // Donn le droite a toute les utilisateur de consulter notre page web

    AllowOverride FileInfo AuthConfig Limit

    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec

    Order allow,deny

    Allow from all // ici a la place de deny On met Allow

    #

    # Order deny,allow

    # Deny from all

    #

  • 7/23/2019 Serveur Web ( Apache ) sous Linux

    2/4

    IT NISROCLUB TUTORIEL INFORMATIQUE

    # VirtualHost example:

    # Almost any Apache directive may go into a VirtualHost container.

    # The first VirtualHost section is used for requests without a known

    # server name.

    // cette etape si pour la configuration dun hote virtuele cest a dire utilser des entet dhote pour accecder

    a notre page web et pour cela il faut ajouter un enregistrement A dans la zone de DNS qui fait la

    corresspendance entre le nom dhote et ladresse IP

    ServerName www.nassir.lan

    ServerAdmin [email protected]

    DocumentRoot /var/www/html/Web

    ErrorLog logs/dummy-host.nassir.lan-error_log

    CustomLog logs/dummy-host.nassir.lan-access_log common

    ########################## End Of httpd.conf file ###########################

    ############################ Zone nassir.lan ##############################

    $TTL 86400

    nassir.lan. IN SOA ns1.nassir.lan. dnsmaster.nassir.lan. (

    2011042311

    10800

    3600

    604800

    38400 )

    @ IN NS ns1.nassir.lan.

    ns1 IN A 1.1.1.1

    www IN A 1.1.1.1

    ########################################################################

    2) Demmrage de dmon httpd

    # service httpd start

  • 7/23/2019 Serveur Web ( Apache ) sous Linux

    3/4

    IT NISROCLUB TUTORIEL INFORMATIQUE

    3) Testez

    Sous un navigateur web On met http:// localhost pour vrifiez localment :

    Sous un navigateur web On met http:// 1.1.1.1 l@ ip de serveur apache pour vrifiez dans le

    rseau :

  • 7/23/2019 Serveur Web ( Apache ) sous Linux

    4/4

    IT NISROCLUB TUTORIEL INFORMATIQUE

    Sous un navigateur web On met http://www.nassir.lan pour vrifiez dans le rseau est ce que

    la rsolution DNS ca marche :

    http://www.nassir.lan/http://www.nassir.lan/http://www.nassir.lan/http://www.nassir.lan/