Pages : 1
#1 Le 10/11/2014, à 21:59
- xunil2003
Innstaller lamp
Bonjour,
Je suis sur Kubuntu 14.04 LTS x64.
J'ai installé :
1/ Lamp
sudo apt-get install lamp-server
2/ Apache
sudo apt-get install apache2 php5 mysql-server libapache2-mod-php5 php5-mysql
Puis j'ai créé une page phpinfo.
sudo touch /www/var/phpinfo.php
sudo echo "<?php phpinfo(); ?>" > /www/var/phpinfo.php
3/ Phmyadmin
sudo apt-get install libapache2-mod-auth-mysql phpmyadmin
Phpmyadmin fonctionne,
Mais quand je tape dans le navigateur
http://localhost/phpinfo.php
J'ai ceci qui s'affiche :
Not Found
The requested URL /phpinfo.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Pourtant il y a bien le fichier dans le dossier
laurent@Laurent-Bureau:~$ ls -al /var/www
total 36
drwxr-xr-x 4 root root 4096 nov. 9 22:20 .
drwxr-xr-x 15 root root 4096 oct. 24 08:44 ..
drwxr-xr-x 2 root root 4096 nov. 9 21:51 html
-rw-r--r-- 1 root root 245 nov. 10 14:21 index.html
drwx------ 2 root root 16384 oct. 23 08:02 lost+found
-rw-r--r-- 1 root root 20 nov. 10 19:56 phpinfo.php
laurent@Laurent-Bureau:~$
Et quand je tape dans le navigateur
http://localhost/
J'ai ceci qui s'affiche :
Ubuntu Logo Apache2 Ubuntu Default Page
It works!
This is the default welcome page used to test the correct operation of the Apache2 server after installation on Ubuntu systems. It is based on the equivalent page on Debian, from which the Ubuntu Apache packaging is derived. If you can read this page, it means that the Apache HTTP server installed at this site is working properly. You should replace this file (located at /var/www/html/index.html) before continuing to operate your HTTP server.
If you are a normal user of this web site and don't know what this page is about, this probably means that the site is currently unavailable due to maintenance. If the problem persists, please contact the site's administrator.
Configuration Overview
Ubuntu's Apache2 default configuration is different from the upstream default configuration, and split into several files optimized for interaction with Ubuntu tools. The configuration system is fully documented in /usr/share/doc/apache2/README.Debian.gz. Refer to this for the full documentation. Documentation for the web server itself can be found by accessing the manual if the apache2-doc package was installed on this server.
The configuration layout for an Apache2 web server installation on Ubuntu systems is as follows:
/etc/apache2/
|-- apache2.conf
| `-- ports.conf
|-- mods-enabled
| |-- *.load
| `-- *.conf
|-- conf-enabled
| `-- *.conf
|-- sites-enabled
| `-- *.conf
apache2.conf is the main configuration file. It puts the pieces together by including all remaining configuration files when starting up the web server.
ports.conf is always included from the main configuration file. It is used to determine the listening ports for incoming connections, and this file can be customized anytime.
Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/ directories contain particular configuration snippets which manage modules, global configuration fragments, or virtual host configurations, respectively.
They are activated by symlinking available configuration files from their respective *-available/ counterparts. These should be managed by using our helpers a2enmod, a2dismod, a2ensite, a2dissite, and a2enconf, a2disconf . See their respective man pages for detailed information.
The binary is called apache2. Due to the use of environment variables, in the default configuration, apache2 needs to be started/stopped with /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not work with the default configuration.
Document Roots
By default, Ubuntu does not allow access through the web browser to any file apart of those located in /var/www, public_html directories (when enabled) and /usr/share (for web applications). If your site is using a web document root located elsewhere (such as in /srv) you may need to whitelist your document root directory in /etc/apache2/apache2.conf.
The default Ubuntu document root is /var/www/html. You can make your own virtual hosts under /var/www. This is different to previous releases which provides better security out of the box.
Reporting Problems
Please use the ubuntu-bug tool to report bugs in the Apache2 package with Ubuntu. However, check existing bug reports before reporting a new bug.
Please report bugs specific to modules (such as PHP and others) to respective packages, not to the web server itself.
Pourquoi ma page index.html et phpinfo.php ne s'affiche pas dans mon navigateur ?
Merci.
- AMD R9 5950x 64 Go Ram / Intel Pentium I7 960 - 12 Go Ram - 6 T0 - Kubuntu 12.04 x64 / Kubuntu 14.04 x64 / Kubuntu 16.04 x64 / Kubuntu 18.04 x64 / Kubuntu 20.04 x64 / Mint
- DreamPlug Multi Boot / Marvel 1.22 Ghz / Architecture ARM / 512 Mo Ram / Carte-sd 16 Go class 10 / 5 Watts / Debian Squeeze 2.6.39.4
- Raspberry PI 1 / Raspberry PI 2 / Raspberry PI 3 / Raspberry PI 4 : 4Gb
JE SUIS CHARLIE
Hors ligne
#2 Le 10/11/2014, à 22:06
- jplemoine
Re : Innstaller lamp
Parce que tu n'as pas mis les fichiers au bon endroit...
Ce n'est pas /var/www mais /var/www/html
Membre de l'ALDIL (Association Lyonnaise pour le Développement de l'Informatique Libre)
- En pro, après 20 ans de développement, administrateur Linux / Unix depuis Avril 2019.
- En privé, sous Ubuntu-Xubuntu depuis 2009.
Hors ligne
#3 Le 10/11/2014, à 22:16
- Rufus T. Firefly
Re : Innstaller lamp
Salut,
Et si tu les préfères dans /var/www, il suffit de modifier /etc/apache2/sites-available/000-default.conf en conséquence. C'est-à-dire remplacer :
DocumentRoot /var/www/html
par
DocumentRoot /var/www
Puis relancer apache...
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
#4 Le 10/11/2014, à 22:34
- jplemoine
Re : Innstaller lamp
Changer les valeurs par défaut ne me parait pas être une bonne idée. En cas de nouvelle version, il faudra remettre les valeurs.
Il faut mieux désactiver le vhost par défaut et créer son propre vhost.
Membre de l'ALDIL (Association Lyonnaise pour le Développement de l'Informatique Libre)
- En pro, après 20 ans de développement, administrateur Linux / Unix depuis Avril 2019.
- En privé, sous Ubuntu-Xubuntu depuis 2009.
Hors ligne
#5 Le 10/11/2014, à 22:39
- Rufus T. Firefly
Re : Innstaller lamp
Bien sûr. De toutes façons il vaut mieux crée un vhost par site, qui pointe sur le site, où qu'il se trouve...
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
#6 Le 10/11/2014, à 22:43
- jplemoine
Re : Innstaller lamp
D'après ce qu'avait dit tiramiseb, c'est sous /srv mais je ne sais plus la suite (les sous-répertoire).
Il est contre le fait d'utiliser la valeur par défaut (que ce soit /var/www ou /var/www/html)
Membre de l'ALDIL (Association Lyonnaise pour le Développement de l'Informatique Libre)
- En pro, après 20 ans de développement, administrateur Linux / Unix depuis Avril 2019.
- En privé, sous Ubuntu-Xubuntu depuis 2009.
Hors ligne
#7 Le 10/11/2014, à 23:03
- Rufus T. Firefly
Re : Innstaller lamp
Ce n'est pas compliqué. Tu fais un truc comme ça :
<VirtualHost *:80>
DocumentRoot /srv/toto
<Directory /srv/toto/>
Options FollowSymLinks Indexes MultiViews
Require all granted
</Directory>
</VirtualHost>
Tu enregistres ça comme /etc/apache2/sites-available/toto.conf
Tu l'actives
sudo a2ensite toto
Tu relances apache et tu n'as plus qu'à créer /srv/toto et à le remplir...
Bien sûr, le vhost que j'ai donné là est extrêmement rudimentaire. Il faut consulter la doc d'apache pour voir tout ce qu'on peut y mettre (des histoires de droits entre autres)
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
#8 Le 10/11/2014, à 23:06
- jplemoine
Re : Innstaller lamp
ok. Je pensais que c'était plus dur que ça....
Faut juste retrouver la norme qui décrit la structure de /srv.
Membre de l'ALDIL (Association Lyonnaise pour le Développement de l'Informatique Libre)
- En pro, après 20 ans de développement, administrateur Linux / Unix depuis Avril 2019.
- En privé, sous Ubuntu-Xubuntu depuis 2009.
Hors ligne
#9 Le 11/11/2014, à 03:03
- xunil2003
Re : Innstaller lamp
Bonsoir,
Parce que tu n'as pas mis les fichiers au bon endroit...
Ce n'est pas /var/www mais /var/www/html
J'ai copié mes fichiesr dans /var/www/html
laurent@Laurent-Bureau:~$ ls -al /var//www/html
total 28
drwxr-xr-x 2 root root 4096 nov. 11 01:29 .
drwxr-xr-x 4 root root 4096 nov. 11 01:28 ..
-rw-r--r-- 1 root root 245 nov. 10 14:21 index2.html
-rw-r--r-- 1 root root 11510 nov. 9 21:51 index.html
-rw-r--r-- 1 root root 20 nov. 10 19:56 phpinfo.php
laurent@Laurent-Bureau:~$
C'est pareil, quand je tape dans l'url du navigateur
http://localhost/html/phpinfo.php
Le navigateur affiche :
Not Found
The requested URL /html/phpinfo.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Idem pour index2.html
http://localhost/html/index2.html
Le navigateur affiche :
Not Found
The requested URL /html/phpinfo.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Et pour le fichier "index.html" déja présent dans le dossier "/var/www/html/" c'est pareil .
http://localhost/html/index.html
Le navigateur affiche la aussi :
Not Found
The requested URL /html/phpinfo.php was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
D'après ce qu'avait dit tiramiseb, c'est sous /srv mais je ne sais plus la suite (les sous-répertoire).
Il est contre le fait d'utiliser la valeur par défaut (que ce soit /var/www ou /var/www/html)
Pourquoi est il contre, sur la 12.02 jLTS j'utilisé /var/www ?
D'après ce que dit "Rufus T. Firefly"
Je cré un dossier au nom de son site dans /srv
Puis je cré un ficier conf au nom de mon site dans le dossier /etc/apache2/sites-available/
et je met ceci dans le fichier conf de mon site :
<VirtualHost *:80>
DocumentRoot /srv/monsite
<Directory /srv/monsite/>
Options FollowSymLinks Indexes MultiViews
Require all granted
</Directory>
</VirtualHost>
J'ai fait ceci est ça marche pas non plus.
laurent@Laurent-Bureau:/srv$ sudo touch /etc/apache2/sites-available/maison.conf
[sudo] password for laurent:
no talloc stackframe at ../source3/param/loadparm.c:4864, leaking memory
laurent@Laurent-Bureau:/srv$
laurent@Laurent-Bureau:/srv$ sudo gedit /etc/apache2/sites-available/maison.conf
(gedit:26867): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
(gedit:26867): Gtk-WARNING **: Calling Inhibit failed: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files
laurent@Laurent-Bureau:/srv$
laurent@Laurent-Bureau:/srv$ sudo a2ensite maison
Enabling site maison.
To activate the new configuration, you need to run:
service apache2 reload
laurent@Laurent-Bureau:/srv$
laurent@Laurent-Bureau:/srv$ sudo /etc/init.d/apache2 restart
* Restarting web server apache2 AH00112: Warning: DocumentRoot [/srv/maison] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
[ OK ]
laurent@Laurent-Bureau:/srv$
laurent@Laurent-Bureau:/srv$ mkdir maison
laurent@Laurent-Bureau:/srv$
Et quand je tape dans le navigaeur
http://localhost/maison/index.html
Il m'affiche :
Not Found
The requested URL /maison/index.html was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Merci
Dernière modification par xunil2003 (Le 11/11/2014, à 03:36)
- AMD R9 5950x 64 Go Ram / Intel Pentium I7 960 - 12 Go Ram - 6 T0 - Kubuntu 12.04 x64 / Kubuntu 14.04 x64 / Kubuntu 16.04 x64 / Kubuntu 18.04 x64 / Kubuntu 20.04 x64 / Mint
- DreamPlug Multi Boot / Marvel 1.22 Ghz / Architecture ARM / 512 Mo Ram / Carte-sd 16 Go class 10 / 5 Watts / Debian Squeeze 2.6.39.4
- Raspberry PI 1 / Raspberry PI 2 / Raspberry PI 3 / Raspberry PI 4 : 4Gb
JE SUIS CHARLIE
Hors ligne
#10 Le 11/11/2014, à 03:48
- Rufus T. Firefly
Re : Innstaller lamp
Regarde ton virtual host par défaut : /etc/apache2/sites-available (dans sites-enabled tu as juste des liens vers ceux des précédents que tu veux activer : c'est là qu'apache va chercher les renseignements).
donc : 000-default.conf
Il ressemble à ça :
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html <== c'est là que ça se passe
# 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
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
Quand tu tapes http://localhost (ou même si tu cliques sur ce lien, qui enverra une requête à ton apache), apache explore le virtual host par défaut pour y trouver ça :
DocumentRoot /var/www/html
C'est-à-dire la racine du site par défaut.
Et quand tu tapes localhost/html apache cherche dans DocumentRoot/html donc dans /var/www/html/html et bien sûr il ne trouve pas, parce que ce répertoire n'existe pas...
Dernière modification par Rufus T. Firefly (Le 11/11/2014, à 03:53)
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
#11 Le 11/11/2014, à 04:02
- Rufus T. Firefly
Re : Innstaller lamp
Et quand je tape dans le navigaeur
http://localhost/maison/index.html
Il m'affiche :
Not Found The requested URL /maison/index.html was not found on this server. Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Merci
Pour l'instant ton répertoire /srv/maison est vide. Donc il ne peut pas t'afficher le fichier index.html censé être dedans...
D'autre part, par défaut, apache lit et affiche les fichiers de type index.htm, index.html, index.php (les priorités sont définies dans la config d'apache). Donc, s'il y a un fichier index.html, http://localhost/maison/index.html et simplement http://localhost/maison affichent ce fichier index.html
Edit : je viens de voir ce warning :
DocumentRoot [/srv/maison] does not exist
Quand tu as relancé apache, c'était vrai (je suis peut-être allé un peu vite, tout à l'heure). Si ça ne veut toujours pas, relance apache, puisque maintenant il existe, ce répertoire
Dernière modification par Rufus T. Firefly (Le 11/11/2014, à 04:11)
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
#12 Le 11/11/2014, à 19:29
- xunil2003
Re : Innstaller lamp
Bonsoir,
Pour l'instant ton répertoire /srv/maison est vide.
non, il y avait déja les fichiers.
laurent@Laurent-Bureau:~$ ls -al /srv/maison
total 28
drwxr-xr-x 2 root root 4096 nov. 11 02:21 .
drwxr-xr-x 3 root root 4096 nov. 11 02:21 ..
-rw-r--r-- 1 root root 245 nov. 10 14:21 index2.html
-rw-r--r-- 1 root root 11510 nov. 9 21:51 index.html
-rw-r--r-- 1 root root 20 nov. 10 19:56 phpinfo.php
laurent@Laurent-Bureau:~$
Quand vous dites "Regarde ton virtual host par défaut : /etc/apache2/sites-available" c'est quel fichier ?
Edit : je viens de voir ce warning :
DocumentRoot [/srv/maison] does not exist
Quand tu as relancé apache, c'était vrai (je suis peut-être allé un peu vite, tout à l'heure). Si ça ne veut toujours pas, relance apache, puisque maintenant il existe, ce répertoire
Non ça marche toujours pas ?
Merci.
- AMD R9 5950x 64 Go Ram / Intel Pentium I7 960 - 12 Go Ram - 6 T0 - Kubuntu 12.04 x64 / Kubuntu 14.04 x64 / Kubuntu 16.04 x64 / Kubuntu 18.04 x64 / Kubuntu 20.04 x64 / Mint
- DreamPlug Multi Boot / Marvel 1.22 Ghz / Architecture ARM / 512 Mo Ram / Carte-sd 16 Go class 10 / 5 Watts / Debian Squeeze 2.6.39.4
- Raspberry PI 1 / Raspberry PI 2 / Raspberry PI 3 / Raspberry PI 4 : 4Gb
JE SUIS CHARLIE
Hors ligne
#13 Le 11/11/2014, à 20:17
- Rufus T. Firefly
Re : Innstaller lamp
J'étais un peu dans les choux, tard cette nuit.
Si tu veux que localhost pointe sur /srv il faut aussi modifier /etc/apache2/apache2.conf
Vers la ligne 160 tu devrais trouver ça :
<Directory /var/www>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Remplace par ça :
<Directory /srv>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
Puis relance apache.
Edit : chez debian le vhost par défaut se nomme 000-default.conf mais c'est peut-être autre chose (de semblable) chez ubuntu
Dernière modification par Rufus T. Firefly (Le 11/11/2014, à 20:22)
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
#14 Le 11/11/2014, à 22:36
- xunil2003
Re : Innstaller lamp
Bonsoir
Y a rien qui fonctionne ??
Le vhost :
laurent@Laurent-Bureau:/srv$ cat -n /etc/apache2/sites-available/000-default.conf
1 <VirtualHost *:80>
2 # The ServerName directive sets the request scheme, hostname and port that
3 # the server uses to identify itself. This is used when creating
4 # redirection URLs. In the context of virtual hosts, the ServerName
5 # specifies what hostname must appear in the request's Host: header to
6 # match this virtual host. For the default virtual host (this file) this
7 # value is not decisive as it is used as a last resort host regardless.
8 # However, you must set it for any further virtual host explicitly.
9 #ServerName www.example.com
10
11 ServerAdmin webmaster@localhost
12 #DocumentRoot /var/www/html
13 DocumentRoot /srv/maison
14
15 # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
16 # error, crit, alert, emerg.
17 # It is also possible to configure the loglevel for particular
18 # modules, e.g.
19 #LogLevel info ssl:warn
20
21 ErrorLog ${APACHE_LOG_DIR}/error.log
22 CustomLog ${APACHE_LOG_DIR}/access.log combined
23
24 # For most configuration files from conf-available/, which are
25 # enabled or disabled at a global level, it is possible to
26 # include a line for only one particular virtual host. For example the
27 # following line enables the CGI configuration for this host only
28 # after it has been globally disabled with "a2disconf".
29 #Include conf-available/serve-cgi-bin.conf
30 </VirtualHost>
31
32 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
laurent@Laurent-Bureau:/srv$
Fichier : apache2.conf
laurent@Laurent-Bureau:/srv$ cat -n /etc/apache2/apache2.conf
1 # This is the main Apache server configuration file. It contains the
2 # configuration directives that give the server its instructions.
3 # See http://httpd.apache.org/docs/2.4/ for detailed information about
4 # the directives and /usr/share/doc/apache2/README.Debian about Debian specific
5 # hints.
6 #
7 #
8 # Summary of how the Apache 2 configuration works in Debian:
9 # The Apache 2 web server configuration in Debian is quite different to
10 # upstream's suggested way to configure the web server. This is because Debian's
11 # default Apache2 installation attempts to make adding and removing modules,
12 # virtual hosts, and extra configuration directives as flexible as possible, in
13 # order to make automating the changes and administering the server as easy as
14 # possible.
15
16 # It is split into several files forming the configuration hierarchy outlined
17 # below, all located in the /etc/apache2/ directory:
18 #
19 # /etc/apache2/
20 # |-- apache2.conf
21 # | `-- ports.conf
22 # |-- mods-enabled
23 # | |-- *.load
24 # | `-- *.conf
25 # |-- conf-enabled
26 # | `-- *.conf
27 # `-- sites-enabled
28 # `-- *.conf
29 #
30 #
31 # * apache2.conf is the main configuration file (this file). It puts the pieces
32 # together by including all remaining configuration files when starting up the
33 # web server.
34 #
35 # * ports.conf is always included from the main configuration file. It is
36 # supposed to determine listening ports for incoming connections which can be
37 # customized anytime.
38 #
39 # * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/
40 # directories contain particular configuration snippets which manage modules,
41 # global configuration fragments, or virtual host configurations,
42 # respectively.
43 #
44 # They are activated by symlinking available configuration files from their
45 # respective *-available/ counterparts. These should be managed by using our
46 # helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See
47 # their respective man pages for detailed information.
48 #
49 # * The binary is called apache2. Due to the use of environment variables, in
50 # the default configuration, apache2 needs to be started/stopped with
51 # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not
52 # work with the default configuration.
53
54
55 # Global configuration
56 #
57
58 #
59 # ServerRoot: The top of the directory tree under which the server's
60 # configuration, error, and log files are kept.
61 #
62 # NOTE! If you intend to place this on an NFS (or otherwise network)
63 # mounted filesystem then please read the Mutex documentation (available
64 # at <URL:http://httpd.apache.org/docs/2.4/mod/core.html#mutex>);
65 # you will save yourself a lot of trouble.
66 #
67 # Do NOT add a slash at the end of the directory path.
68 #
69 #ServerRoot "/etc/apache2"
70
71 #
72 # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
73 #
74 Mutex file:${APACHE_LOCK_DIR} default
75
76 #
77 # PidFile: The file in which the server should record its process
78 # identification number when it starts.
79 # This needs to be set in /etc/apache2/envvars
80 #
81 PidFile ${APACHE_PID_FILE}
82
83 #
84 # Timeout: The number of seconds before receives and sends time out.
85 #
86 Timeout 300
87
88 #
89 # KeepAlive: Whether or not to allow persistent connections (more than
90 # one request per connection). Set to "Off" to deactivate.
91 #
92 KeepAlive On
93
94 #
95 # MaxKeepAliveRequests: The maximum number of requests to allow
96 # during a persistent connection. Set to 0 to allow an unlimited amount.
97 # We recommend you leave this number high, for maximum performance.
98 #
99 MaxKeepAliveRequests 100
100
101 #
102 # KeepAliveTimeout: Number of seconds to wait for the next request from the
103 # same client on the same connection.
104 #
105 KeepAliveTimeout 5
106
107
108 # These need to be set in /etc/apache2/envvars
109 User ${APACHE_RUN_USER}
110 Group ${APACHE_RUN_GROUP}
111
112 #
113 # HostnameLookups: Log the names of clients or just their IP addresses
114 # e.g., www.apache.org (on) or 204.62.129.132 (off).
115 # The default is off because it'd be overall better for the net if people
116 # had to knowingly turn this feature on, since enabling it means that
117 # each client request will result in AT LEAST one lookup request to the
118 # nameserver.
119 #
120 HostnameLookups Off
121
122 # ErrorLog: The location of the error log file.
123 # If you do not specify an ErrorLog directive within a <VirtualHost>
124 # container, error messages relating to that virtual host will be
125 # logged here. If you *do* define an error logfile for a <VirtualHost>
126 # container, that host's errors will be logged there and not here.
127 #
128 ErrorLog ${APACHE_LOG_DIR}/error.log
129
130 #
131 # LogLevel: Control the severity of messages logged to the error_log.
132 # Available values: trace8, ..., trace1, debug, info, notice, warn,
133 # error, crit, alert, emerg.
134 # It is also possible to configure the log level for particular modules, e.g.
135 # "LogLevel info ssl:warn"
136 #
137 LogLevel warn
138
139 # Include module configuration:
140 IncludeOptional mods-enabled/*.load
141 IncludeOptional mods-enabled/*.conf
142
143 # Include list of ports to listen on
144 Include ports.conf
145
146
147 # Sets the default security model of the Apache2 HTTPD server. It does
148 # not allow access to the root filesystem outside of /usr/share and /var/www.
149 # The former is used by web applications packaged in Debian,
150 # the latter may be used for local directories served by the web server. If
151 # your system is serving content from a sub-directory in /srv you must allow
152 # access here, or in any related virtual host.
153 <Directory />
154 Options FollowSymLinks
155 AllowOverride None
156 Require all denied
157 </Directory>
158
159 <Directory /usr/share>
160 AllowOverride None
161 Require all granted
162 </Directory>
163
164 #<Directory /var/www/>
165 # Options Indexes FollowSymLinks
166 # AllowOverride None
167 # Require all granted
168 #</Directory>
169
170 <Directory /srv>
171 Options Indexes FollowSymLinks
172 AllowOverride None
173 Require all granted
174 </Directory>
175
176
177
178
179 # AccessFileName: The name of the file to look for in each directory
180 # for additional configuration directives. See also the AllowOverride
181 # directive.
182 #
183 AccessFileName .htaccess
184
185 #
186 # The following lines prevent .htaccess and .htpasswd files from being
187 # viewed by Web clients.
188 #
189 <FilesMatch "^\.ht">
190 Require all denied
191 </FilesMatch>
192
193
194 #
195 # The following directives define some format nicknames for use with
196 # a CustomLog directive.
197 #
198 # These deviate from the Common Log Format definitions in that they use %O
199 # (the actual bytes sent including headers) instead of %b (the size of the
200 # requested file), because the latter makes it impossible to detect partial
201 # requests.
202 #
203 # Note that the use of %{X-Forwarded-For}i instead of %h is not recommended.
204 # Use mod_remoteip instead.
205 #
206 LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
207 LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
208 LogFormat "%h %l %u %t \"%r\" %>s %O" common
209 LogFormat "%{Referer}i -> %U" referer
210 LogFormat "%{User-agent}i" agent
211
212 # Include of directories ignores editors' and dpkg's backup files,
213 # see README.Debian for details.
214
215 # Include generic snippets of statements
216 IncludeOptional conf-enabled/*.conf
217
218 # Include the virtual host configurations:
219 IncludeOptional sites-enabled/*.conf
220
221 # vim: syntax=apache ts=4 sw=4 sts=4 sr noet
laurent@Laurent-Bureau:/srv$
Le navigateur :
http://localhost/maison
Not Found
The requested URL /maison was not found on this server.
Apache/2.4.7 (Ubuntu) Server at localhost Port 80
Là je suis perdu ?
Merci.
Dernière modification par xunil2003 (Le 11/11/2014, à 22:39)
- AMD R9 5950x 64 Go Ram / Intel Pentium I7 960 - 12 Go Ram - 6 T0 - Kubuntu 12.04 x64 / Kubuntu 14.04 x64 / Kubuntu 16.04 x64 / Kubuntu 18.04 x64 / Kubuntu 20.04 x64 / Mint
- DreamPlug Multi Boot / Marvel 1.22 Ghz / Architecture ARM / 512 Mo Ram / Carte-sd 16 Go class 10 / 5 Watts / Debian Squeeze 2.6.39.4
- Raspberry PI 1 / Raspberry PI 2 / Raspberry PI 3 / Raspberry PI 4 : 4Gb
JE SUIS CHARLIE
Hors ligne
#15 Le 11/11/2014, à 23:11
- Rufus T. Firefly
Re : Innstaller lamp
localhost sans rien répond quoi ?
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
#16 Le 11/11/2014, à 23:17
- jplemoine
Re : Innstaller lamp
IL faut que tu essaies http://localhost --> tu dois avoir ce qu'il y a sans /srv/maison
Membre de l'ALDIL (Association Lyonnaise pour le Développement de l'Informatique Libre)
- En pro, après 20 ans de développement, administrateur Linux / Unix depuis Avril 2019.
- En privé, sous Ubuntu-Xubuntu depuis 2009.
Hors ligne
#17 Le 12/11/2014, à 19:02
- xunil2003
Re : Innstaller lamp
Bonsoir,
localhost sans rien répond quoi ?
Voila le retour :
http://localhost/
Ubuntu Logo Apache2 Ubuntu Default Page
It works!
This is the default welcome page used to test the correct operation of the Apache2 server after installation on Ubuntu systems. It is based on the equivalent page on Debian, from which the Ubuntu Apache packaging is derived. If you can read this page, it means that the Apache HTTP server installed at this site is working properly. You should replace this file (located at /var/www/html/index.html) before continuing to operate your HTTP server.
If you are a normal user of this web site and don't know what this page is about, this probably means that the site is currently unavailable due to maintenance. If the problem persists, please contact the site's administrator.
Configuration Overview
Ubuntu's Apache2 default configuration is different from the upstream default configuration, and split into several files optimized for interaction with Ubuntu tools. The configuration system is fully documented in /usr/share/doc/apache2/README.Debian.gz. Refer to this for the full documentation. Documentation for the web server itself can be found by accessing the manual if the apache2-doc package was installed on this server.
The configuration layout for an Apache2 web server installation on Ubuntu systems is as follows:
/etc/apache2/
|-- apache2.conf
| `-- ports.conf
|-- mods-enabled
| |-- *.load
| `-- *.conf
|-- conf-enabled
| `-- *.conf
|-- sites-enabled
| `-- *.conf
apache2.conf is the main configuration file. It puts the pieces together by including all remaining configuration files when starting up the web server.
ports.conf is always included from the main configuration file. It is used to determine the listening ports for incoming connections, and this file can be customized anytime.
Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/ directories contain particular configuration snippets which manage modules, global configuration fragments, or virtual host configurations, respectively.
They are activated by symlinking available configuration files from their respective *-available/ counterparts. These should be managed by using our helpers a2enmod, a2dismod, a2ensite, a2dissite, and a2enconf, a2disconf . See their respective man pages for detailed information.
The binary is called apache2. Due to the use of environment variables, in the default configuration, apache2 needs to be started/stopped with /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not work with the default configuration.
Document Roots
By default, Ubuntu does not allow access through the web browser to any file apart of those located in /var/www, public_html directories (when enabled) and /usr/share (for web applications). If your site is using a web document root located elsewhere (such as in /srv) you may need to whitelisil y avait déjà les fichierst your document root directory in /etc/apache2/apache2.conf.
The default Ubuntu document root is /var/www/html. You can make your own virtual hosts under /var/www. This is different to previous releases which provides better security out of the box.
Reporting Problems
Please use the ubuntu-bug tool to report bugs in the Apache2 package with Ubuntu. However, check existing bug reports before reporting a new bug.
Please report bugs specific to modules (such as PHP and others) to respective packages, not to the web server itself.
C'est justement ce que je ne comprends pas, pourquoi ce message ?
Merci.
Dernière modification par xunil2003 (Le 12/11/2014, à 19:04)
- AMD R9 5950x 64 Go Ram / Intel Pentium I7 960 - 12 Go Ram - 6 T0 - Kubuntu 12.04 x64 / Kubuntu 14.04 x64 / Kubuntu 16.04 x64 / Kubuntu 18.04 x64 / Kubuntu 20.04 x64 / Mint
- DreamPlug Multi Boot / Marvel 1.22 Ghz / Architecture ARM / 512 Mo Ram / Carte-sd 16 Go class 10 / 5 Watts / Debian Squeeze 2.6.39.4
- Raspberry PI 1 / Raspberry PI 2 / Raspberry PI 3 / Raspberry PI 4 : 4Gb
JE SUIS CHARLIE
Hors ligne
#18 Le 12/11/2014, à 20:31
- Rufus T. Firefly
Re : Innstaller lamp
A mon avis, c'est tout simplement ton fichier /srv/maison/index.html
Puisque tu as précisé ça, dans ton vhost par défaut :
DocumentRoot /srv/maison
Renomme-le autrement. Ou vire-le... Et pour être sûr que c'est bien lui, renomme phpinfo.php en index.php
Puis refais localhost
Dernière modification par Rufus T. Firefly (Le 12/11/2014, à 20:41)
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
#19 Le 12/11/2014, à 21:27
- pires57
Re : Innstaller lamp
Et tiramiseb a parfaitement raison pour /srv ( qui est d'ailleurs utilisé paar defaut sur archlinux)
Utilisateur d'Archlinux, Ubuntu et Kali Linux
Administrateur système et réseau spécialisé Linux.
LinkedIn
Hors ligne
#20 Le 12/11/2014, à 23:47
- xunil2003
Re : Innstaller lamp
Bonsoir,
Vous aviez raison Rufus T. Firefly.
Dans le dossier : /srv/maison/
J'ai renomé le fichier index.html par index1.htm et mon fichier index2.htm en index.html
Resultat du navigateur
http://localhost/
Il fonctionne!
Ceci est la page Web par défaut pour ce serveur.
Vous êtes sur le pc 192.168.0.6
Le logiciel de serveur Web fonctionne, mais aucun contenu a été ajouté, encore.
Mais j'ai deux questions :
1/ Quand j'ai créé les partitions pour l'installation de Kubuntu j'avais prévu d'utiliser /var/vvvv pour mes sites internet. (Voir /dev/sda3).
laurent@Laurent-Bureau:~$ df -h
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
/dev/sda2 33G 12G 21G 36% /
none 4,0K 0 4,0K 0% /sys/fs/cgroup
udev 12G 4,0K 12G 1% /dev
tmpfs 2,4G 2,0M 2,4G 1% /run
none 5,0M 0 5,0M 0% /run/lock
none 12G 1,3M 12G 1% /run/shm
none 100M 20K 100M 1% /run/user
/dev/sda3 7,1G 17M 6,7G 1% /var/www
/dev/sda6 1,8T 785G 895G 47% /home
laurent@Laurent-Bureau:~$
Maintenant il faut /srv au lieu de /var/www .
J'ai fait :
sudo umount /var/www
sudo mount /dev/sda3 /srv
Puis je collé mes fichiers dans /srv .
Ok j'ai vérifié ça marche.
laurent@Laurent-Bureau:/srv$ df -h
Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
/dev/sda2 33G 12G 21G 36% /
none 4,0K 0 4,0K 0% /sys/fs/cgroup
udev 12G 4,0K 12G 1% /dev
tmpfs 2,4G 2,0M 2,4G 1% /run
none 5,0M 0 5,0M 0% /run/lock
none 12G 1,3M 12G 1% /run/shm
none 100M 20K 100M 1% /run/user
/dev/sda6 1,8T 785G 895G 47% /home
/dev/sda3 7,1G 17M 6,7G 1% /srv
laurent@Laurent-Bureau:/srv$
laurent@Laurent-Bureau:/srv$ ls -alh /srv
total 40K
drwxr-xr-x 5 root root 4,0K nov. 12 23:43 .
drwxr-xr-x 25 root root 4,0K nov. 12 22:25 ..
drwxr-xr-x 2 root root 4,0K nov. 11 01:29 html
-rw-r--r-- 1 root root 245 nov. 10 14:21 index.html
drwx------ 2 root root 16K oct. 23 08:02 lost+found
drwxr-xr-x 2 root root 4,0K nov. 12 22:26 maison
-rw-r--r-- 1 root root 20 nov. 10 19:56 phpinfo.php
laurent@Laurent-Bureau:/srv$
laurent@Laurent-Bureau:/srv$ ls -alh /srv/maison
total 28K
drwxr-xr-x 2 root root 4,0K nov. 12 22:26 .
drwxr-xr-x 5 root root 4,0K nov. 12 23:43 ..
-rw-r--r-- 1 root root 12K nov. 9 21:51 index1.html
-rw-r--r-- 1 root root 245 nov. 10 14:21 index.html
-rw-r--r-- 1 root root 20 nov. 10 19:56 phpinfo.php
laurent@Laurent-Bureau:/srv$
2/ Dans /var/www l'utilisateur était www-data , là comment ça ce passe ?
Merci.
Dernière modification par xunil2003 (Le 13/11/2014, à 10:39)
- AMD R9 5950x 64 Go Ram / Intel Pentium I7 960 - 12 Go Ram - 6 T0 - Kubuntu 12.04 x64 / Kubuntu 14.04 x64 / Kubuntu 16.04 x64 / Kubuntu 18.04 x64 / Kubuntu 20.04 x64 / Mint
- DreamPlug Multi Boot / Marvel 1.22 Ghz / Architecture ARM / 512 Mo Ram / Carte-sd 16 Go class 10 / 5 Watts / Debian Squeeze 2.6.39.4
- Raspberry PI 1 / Raspberry PI 2 / Raspberry PI 3 / Raspberry PI 4 : 4Gb
JE SUIS CHARLIE
Hors ligne
#21 Le 13/11/2014, à 18:55
- Rufus T. Firefly
Re : Innstaller lamp
Pour www-data, c'est "compliqué".
Qui doit accéder aux fichiers qui sont dans /srv/maison ?
1) toi, évidemment, puisque c'est toi qui les crées et les modifies.
Donc c'est logique que tu en sois propriétaire, avec tes permissions habituelles (rw)
2) apache (= www-data) quand on lui en demande un. Et ça c'est un accès en lecture uniquement (en principe)
Tant que tu n'es pas en ligne mais seulement en local, tu peux tout simplement faire :
sudo chown -R laurent:laurent /srv/maison
Tu auras donc ça :
-rw-r--r-- 1 laurent laurent 245 nov. 10 14:21 index.html
Donc toi tu peux directement modifier ce que tu veux (rw), et apache (www-data) pourra lire, puisque "autres" ont le droit de lire (le 3ème r).
Dernière modification par Rufus T. Firefly (Le 13/11/2014, à 18:59)
La provocation est une façon de remettre la réalité sur ses pieds. (Bertolt Brecht)
Il n'y a pas de route royale pour la science et ceux-là seulement ont chance d'arriver à ses sommets lumineux qui ne craignent pas de se fatiguer à gravir ses sentiers escarpés. (Karl Marx)
Il est devenu plus facile de penser la fin du monde que la fin du capitalisme
Hors ligne
Pages : 1