$Id: $
Apache2 HTTP server setup on MacOS
and Web development environment
Note: Difference from Apache2 on Ubuntu
brew is a really slow package manager.
you need /Users/doctor/
.htaccess
If you need ln -s /Users /home,
see tips here
Summary: Setting files:
/usr/local/etc/
httpd.conf
you need /Users/doctor/
.htaccess
/etc/apache2/extra/
httpd-userdir.conf
/usr/local/var/www/
index.html
Preparations:
brew install apache2
brew install emacs
brew install svn
Notes: There are two apahce2s?
/etc/apache2/
/etc/apache2/httpd.conf
DocumentRoot "/Library/WebServer/Documents"
AccessLog /var/log/apache2/access.log
ErorrLog /var/log/apache2/error.log
Listen
Listen 8080
Listen 80
/etc/apache2/extra/httpd-userdir.conf
UserDir Sites
IfModule
IfModule bonjour_module> RegisterUserSite customized-users
/usr/local/etc/httpd/
# it seems this is installed by brew.
/usr/local/etc/
httpd.conf
DocumentRoot "/usr/local/var/www/"
AccessLog /usr/local/var/log/httpd/access.log
ErorrLog /usr/local/var/log/httpd/error.log
Listen 8080
/etc/apache2/extra/
httpd-userdir.conf
UserDir public_html
Apache2 setup:
edit /etc/apache2/httpd.conf
$emacs httpd.conf
set the port 80 #easy to find it.
uncmment userdir.so and "Include Userdir"
edit /etc/apache2/extra/httpd-userdir.conf
$emacs httpd-userdir.conf
set userdir public_html
$sudo brew services restart httpd
$sudo brew services list # to check no errors.
Reference
Apache2 setup on Ubuntu
Go back to Computer