Apache2 MacOS

Apache2 version: sudo apachectl -v

Apache2 diename: /etc/apache2

Apache2 config path: /etc/apache2/httpd.conf

Defualt Web source dirname DoucumentRoot: /Library/WebServer/Documents

  • httpd.conf
DocumentRoot "/Library/WebServer/Documents"

Listen 80

sudo apachectl start/restart/stop

Enable virtual host

sudo vi /etc/apache2/httpd.conf

# Include /private/etc/apache2/extra/httpd-vhosts.conf, remove '#'

Config virtual host

sudo vi /etc/apache2/extra/httpd-vhosts.conf

<VirtualHost *:80>
    ServerAdmin webmaster@jerrylsu.local
    DocumentRoot "/Users/jerry/Documents/blog/output"
    ServerName jerrylsu.local
    ServerAlias www.jerrylsu.local
    ErrorLog "/private/var/log/apache2/jerrylsu.local-error_log"
    CustomLog "/private/var/log/apache2/jerrylsu.local-access_log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@isso.jerrylsu.local
    DocumentRoot "/Users/jerry/Documents/blog/isso"
    ServerName isso.jerrylsu.local
    ErrorLog "/private/var/log/apache2/isso.jerrylsu.local-error_log"
    CustomLog "/private/var/log/apache2/isso.jerrylsu.local-access_log" common
</VirtualHost>
                    more ...
                


Deploy my blog quickly

Date Tags Blog

1. Clone Blog

$ git clone git@github.com:jerrylsu/blog.git

2. Create virtual environment

$ conda create -n blog python=3.6.8

$ conda activate blog

$ pip install pelican -i https://pypi.doubanio.com/simple

$ pip install bs4 markdown webassets cssmin -i https://pypi.doubanio.com/simple

3. Install themes …

more ...