sudo vim /etc/apache2/httpd.conf
ServerName localhost:80

DocumentRoot “/Users/bhr/Sites”
<Directory “/Users/bhr/Sites”>
Options FollowSymLinks Multiviews
MultiviewsMatch Any
AllowOverride None
Require all granted
</Directory>

LoadModule php7_module libexec/apache2/libphp7.so
LoadModule perl_module libexec/apache2/mod_perl.so
LoadModule userdir_module libexec/apache2/mod_userdir.so
LoadModule include_module libexec/apache2/mod_include.so
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
LoadModule vhost_alias_module libexec/apache2/mod_vhost_alias.so
LoadModule socache_shmcb_module libexec/apache2/mod_socache_shmcb.so
LoadModule ssl_module libexec/apache2/mod_ssl.so

Include /private/etc/apache2/extra/httpd-userdir.conf
Include /private/etc/apache2/extra/httpd-vhosts.conf
Include /private/etc/apache2/extra/httpd-ssl.conf

sudo vim /private/etc/apache2/extra/httpd-userdir.conf
Include /private/etc/apache2/users/*.conf

<IfModule bonjour_module>
RegisterUserSite customized-users
</IfModule>

sudo vim /private/etc/apache2/extra/httpd-vhosts.conf
<FilesMatch “.+\.html$”>
SetHandler application/x-httpd-php
</FilesMatch>

<VirtualHost *:80>
DocumentRoot “/Users/bhr/Sites/localhost”
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
ServerAdmin bhensler@gmail.com
DocumentRoot “/Users/bhr/Sites/bernhard.hensler.net”
ServerName bernhard.hensler.net
Redirect / https://bernhard.hensler.net
ServerAlias bernhard.hensler.net
ErrorLog “/private/var/log/apache2/bernhard.hensler.net-error_log”
CustomLog “/private/var/log/apache2/bernhard.hensler.net-access_log” common
</VirtualHost>

sudo vim /private/etc/apache2/extra/httpd-ssl.conf
Listen 443

SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLProxyCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLHonorCipherOrder on
SSLProtocol all -SSLv3
SSLProxyProtocol all -SSLv3
SSLPassPhraseDialog builtin
SSLSessionCache “shmcb:/private/var/run/ssl_scache(512000)”
SSLSessionCacheTimeout 300

<VirtualHost *:443>
ServerName localhost
DocumentRoot “/Users/bhr/Sites/localhost”

<Directory “/Users/bhr/Sites/localhost”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/apache2/ssl/localhost.crt
SSLCertificateKeyFile /etc/apache2/ssl/localhost.key
</VirtualHost>

<VirtualHost *:443>
ServerAdmin bhensler@gmail.com
DocumentRoot “/Users/bhr/Sites/bernhard.hensler.net”
ServerName bernhard.hensler.net
ServerAlias bernhard.hensler.net

<Directory “/Users/bhr/Sites/bernhard.hensler.net”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>

ErrorLog “/private/var/log/apache2/bernhard.hensler.net-error_log”
CustomLog “/private/var/log/apache2/bernhard.hensler.net-access_log” common

SSLEngine on
SSLCertificateFile “/Users/bhr/Sites/ssl/bernhard.hensler.net.crt”
SSLCertificateKeyFile “/Users/bhr/Sites/ssl/bernhard.hensler.net.key
SSLCACertificateFile “/Users/bhr/Sites/ssl/1_root_bundle.crt”
</VirtualHost>

sudo vim /etc/apache2/users/bhr.conf
<Directory “/Users/bhr/Sites/”>
AddLanguage en .en
AddHandler perl-script .pl
PerlHandler ModPerl::Registry
Options Indexes MultiViews FollowSymLinks ExecCGI
AllowOverride None
Require host localhost
</Directory>

sudo vim wp-config.php
/** MySQL hostname */
define(‘DB_HOST’, ‘127.0.0.1’);

sudo apachectl configtest
sudo apachectl restart

sudo chown -R _www ~/Sites/bernhard.hensler.net/
sudo chmod 644 /etc/apache2/users/bhr.conf

sudo find ~/Sites/bernhard.hensler.net/ -type d -exec chmod 755 {} +
sudo find ~/Sites/bernhard.hensler.net/ -type f -exec chmod 644 {} +

 

 

 

Setting up a local web server on a Mac
https://discussions.apple.com/docs/DOC-3083

Set up localhost on macOS High Sierra (Apache, MySQL, and PHP 7) with SSL/HTTPS
https://websitebeaver.com/set-up-localhost-on-macos-high-sierra-apache-mysql-and-php-7-with-sslhttps

How to Set up Apache in macOS Sierra 10.12
https://medium.com/@JohnFoderaro/how-to-set-up-apache-in-macos-sierra-10-12-bca5a5dfffba

macOS 10.13 High Sierra Apache Setup: SSL
https://getgrav.org/blog/macos-sierra-apache-ssl

How to Fix File and Folder Permissions Error in WordPress
http://www.wpbeginner.com/beginners-guide/how-to-fix-file-and-folder-permissions-error-in-wordpress/

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.