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 ...
Apache2 Deploy Multi-sites
1. Isso as systemd service¶
Switch back to your privileged(root) user and create new service file.
vim /etc/systemd/system/isso.service
Paste the following in it.
[Unit]
Description=Isso Commenting Server
After=network.target
[Service]
Type=simple
User=isso
WorkingDirectory=/home/isso
ExecStart=/home/isso/.local/bin/isso -c /home/isso/isso.conf
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
Enable and start the service.
systemctl enable isso
systemctl start isso
Check the status.
systemctl status isso
apache2 Multi-sites
阿里云二级域名
Apach2 as reverse proxy