Apache HTTP Server -
The Apache HTTP Server, or Apache for short, is a very popular web server, developed by the Apache Software Foundation.
Apache is often used together with a scripting language such as PHP and database such as MySQL. This combination is often referred to as a LAMP stack (Linux, Apache, MySQL, PHP). This article describes how to set up Apache and how to optionally integrate it with PHP and MySQL.
# xbps-install -S apache
To setup the service, link the service file
# ln -s /etc/sv/apache /var/service
# xbps-install -S php-apache
/etc/apache/httpd.conf, comment the line:
#LoadModule mpm_event_module modules/mod_mpm_event.so
and uncomment the line:
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
To enable PHP, add these lines to
- Place this at the end of the
LoadModule php7_module /ust/libexec/httpd/modules/libphp7.so AddHandler php7-script .php
httpd.service using runit.
# sv restart apache
To test whether PHP was correctly configured: create a file called
test.php in your Apache
DocumentRoot directory (e.g.
/srv/www/apache/ with the following contents:
<?php phpinfo(); ?>
To see if it works go to: http://localhost/test.php