[LINUX] Premiers pas avec apache2

official page

apache2 official page

how to install

$ sudo apt update
$ sudo apt install apache2

how to start

$ sudo service apache2 start

comand line option

Usage: apache2 [-D name] [-d directory] [-f file]
            [-C "directive"] [-c "directive"]
            [-k start|restart|graceful|graceful-stop|stop]
            [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X]
Options:
-D name            : define a name for use in <IfDefine name> directives
-d directory       : specify an alternate initial ServerRoot
-f file            : specify an alternate ServerConfigFile
-C "directive"     : process directive before reading config files
-c "directive"     : process directive after reading config files
-e level           : show startup errors of level (see LogLevel)
-E file            : log startup errors to file
-v                 : show version number
-V                 : show compile settings
-h                 : list available command line options (this page)
-l                 : list compiled in modules
-L                 : list available configuration directives
-t -D DUMP_VHOSTS  : show parsed vhost settings
-t -D DUMP_RUN_CFG : show parsed run settings
-S                 : a synonym for -t -D DUMP_VHOSTS -D DUMP_RUN_CFG
-t -D DUMP_MODULES : show all loaded modules 
-M                 : a synonym for -t -D DUMP_MODULES
-t                 : run syntax check for config files
-T                 : start without DocumentRoot(s) check
-X                 : debug mode (only one worker, do not detach)

Citation) https://httpd.apache.org/

check for config files

# run syntax check for config files
$ apache2 -t

/var/www/html

Assurez-vous qu'apache2 est en cours d'exécution.

$ curl localhost && echo success || echo failed

Le html qu'Apache envoie au navigateur est / var / www / html /.

Cela s'appelle ** Document Root **.

En plaçant le fichier ici, il sera possible de s'y référer via Apache.

Aller à la racine du document

$ cd /var/www/html
$ touch test.html
$ echo "Hello World!" > ./test.html

Démarrez le navigateur et entrez ce qui suit. [Adresse IP] / test.html

Changer la racine du document

/etc/apahce2/apache2.conf

Changer.

<Directory /var/www/> 
</Directory>

Changez la partie qui est comme suit.

<Directory /home/ubuntu/www>    
</Directory>

Ensuite, redémarrez apache2.

$ sudo service apache2 restart 

Recommended Posts

Premiers pas avec apache2
Premiers pas avec Android!
1.1 Premiers pas avec Python
Premiers pas avec Python
Premiers pas avec Django 1
Introduction à l'optimisation
Premiers pas avec Numpy
Premiers pas avec Spark
Premiers pas avec Python
Premiers pas avec Pydantic
Premiers pas avec Jython
Premiers pas avec Django 2
Traduire Premiers pas avec TensorFlow
Introduction aux fonctions Python
Introduction à Tkinter 2: Button
Premiers pas avec Go Assembly
Premiers pas avec PKI avec Golang ―― 4
Premiers pas avec Python Django (1)
Django Getting Started: intégration 3_Apache
Premiers pas avec Python Django (4)
Premiers pas avec Python Django (3)
Introduction à Python Django (6)
Premiers pas avec Django avec PyCharm
Premiers pas avec Python Django (5)
Matériel à lire lors de la mise en route d'Apache Beam
Premiers pas avec Python responder v2
Introduction à Git (1) Stockage d'historique
Premiers pas avec Sphinx. Générer docstring avec Sphinx
Premiers pas avec les applications Web Python
Premiers pas sur Docker Apache Hadoop
Premiers pas avec Sparse Matrix avec scipy.sparse
Premiers pas avec Julia pour Pythonista
Premiers pas avec Python Bases de Python
Premiers pas avec Cisco Spark REST-API
Commençant par USD sur Windows
Premiers pas avec les algorithmes génétiques Python
Premiers pas avec Python 3.8 sous Windows
Premiers pas avec Python pour les fonctions PHPer
Premiers pas avec CPU Steal Time
Grails pour commencer
Premiers pas avec python3 # 1 Apprenez les connaissances de base
Premiers pas avec Python Web Scraping Practice
Premiers pas avec Python pour PHPer-Super Basics
Premiers pas avec Python Web Scraping Practice
Premiers pas avec Dynamo de Python boto
Premiers pas avec Lisp pour Pythonista: Supplément
Premiers pas avec Heroku, déploiement de l'application Flask
Premiers pas avec TDD avec Cyber-dojo chez MobPro
Démarrer avec Python avec 100 coups sur le traitement du langage
Django 1.11 a démarré avec Python3.6
Principes de base de MongoDB: Premiers pas avec CRUD avec JAVA
Premiers pas avec le dessin avec matplotlib: écrire des fonctions simples
Premiers pas avec la traduction japonaise du modèle séquentiel Keras
[Français] Premiers pas avec Rust pour les programmeurs Python
Django Getting Started Part 2 avec eclipse Plugin (PyDev)
Démarrez avec MicroPython