User Tools

Site Tools


freebsd_apache

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

freebsd_apache [2023/08/06 14:36] – created chrisfreebsd_apache [2026/02/08 02:37] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +=== Apache ===
 +
 +<code>
 +pkg install apache24 ap24-mod_mpm_itk ap24-mod_security mod_php81 php81
 +</code>
 +
 +<code>
 +vim /path/apache24/httpd.conf
 +Uncomment what you need I uncomment almost all extras
 +
 +I also edit most default to use more secure defaults such as Prod
 +and I always have userdir enabled.
 +</code>
 +
 +<code>
 +One important note about php
 +
 +<FilesMatch "\.php$">
 +    SetHandler application/x-httpd-php
 +</FilesMatch>
 +<FilesMatch "\.phps$">
 +    SetHandler application/x-httpd-php-source
 +</FilesMatch>
 +<IfModule mpm_itk_module>
 +    AssignUserId chris chris
 +</IfModule>
 +</code>
 +
 +itk is awesome as it allows you to not have to worry about perms, and PHP apps not working right. as the server runs the files as the user listed. This is also more secure as the files are normally chown'ed to a user rather root.
 +
 +PHP is a horrible language but it runs 80% of the interwebs so we are stuck using it, messing with it.
 +
  

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki