|
Reviews -
Linux
|
De installatie van een Apache webserver met PHP in OS X is heel gemakkelijk. Standaard staat Apache en PHP al geïnstalleerd op Apple computers. Het enige wat je hoeft te doen is de PHP module activeren en Apache starten. Dit kun je op de volgende manier doen.
PHP5 ActiverenOpen een terminal terminal venster. Het Apache configuratiebestand kan op 2 plekken staan. Probeer de onderstaande regels uit. Een van de 2 commando's werkt. sudo vi /etc/httpd/httpd.conf of sudo vi /etc/apache2/httpd.conf Zoek de volgende regel op #LoadModule php5_module libexec/apache2/libphp5.so Klik op de i op het toetsenbord. Je komt nu in de modus waarin je het bestand kunt bewerken. Haal het hekje voor de regel weg. De regel ziet er dan zo uit. LoadModule php5_module libexec/apache2/libphp5.so Klik op esc om uit de schrijfmodus te gaan. Typ :wq. Het bestend wordt weggeschreven. De PHP5 module is nu in apache geactiveerd.
Apache activerenKlik op het appeltje links boven in de hoek. Klik op Systeemvoorkeuren..., Delen. Zet vervolgens een vinkje voor Webserver. De Apache webserver wordt nu geactiveerd en kan gelijk gebruikt worden. Aan de rechterkant van het venster zie je een link naar de website. Iedere gebruiker op de computer heeft zijn eigen website te vinden onder http://localhost/~gebruikersnaam. Er is ook een hoofd pagina http://localhost/. Je persoonlijke website verwijst naar Finder, Webpagina's. De hoofdpagina verwijst naar /Library/WebServer/Documents/.
|
Als ik de regel sudo vi /etc/apache2/httpd.conf intyp, krijg ik het volgende resultaat:
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See for detailed information.
# In particular, see
#
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "/private/var/log/apache2/foo_log"
# with ServerRoot set to "/usr" will be interpreted by the
# server as "/usr//private/var/log/apache2/foo_log".
#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
"/etc/apache2/httpd.conf" 488L, 17727C
Hierin komt nergens de regel
#LoadModule php5_module libexec/apache2/libphp5.so
voor. Wat doe ik nu?