Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

坑爹的阿里云 & Swap 的重要性 :: Colinx Blog — Colin的个人博客 #16

Open
Colin-XKL opened this issue Nov 23, 2021 · 0 comments

Comments

@Colin-XKL
Copy link
Owner

https://blog.colinx.one/posts/%E6%A0%91%E8%8E%93%E6%B4%BE-apache2-%E8%AE%BE%E7%BD%AE%E7%89%B9%E5%AE%9A%E5%9F%9F%E5%90%8D%E8%BD%AC%E5%8F%91%E5%88%B0%E7%89%B9%E5%AE%9A%E7%AB%AF%E5%8F%A3/

随着树莓派上部署的项目越来越多,每次使用 IP + 端口访问也越来越不方便。考虑使用 Apache 来特定子域名跳转到不同端口对应的不同应用。
树莓派 3B+ Raspbian 系统 Apache2 自己的域名 在 Apache2 的配置文件(路径 /etc/Apache2/Apache2.conf ) 文件末尾加上以下配置:
<VirtualHost *:80> ServerName YOUR_DOMAIN.COM #此处为本条规则绑定的域名,下同 ServerAlias YOUR_DOMAIN.COM ProxyPreserveHost On ProxyRequests Off ProxyPass / http://localhost:8080/ #修改此处的端口号为实际所需,下同 ProxyPassReverse / http://localhost:8080/ </VirtualHost> 之后开启 Apache2 的相关模块
a2enmod rewrite a2enmod proxy a2enmod proxy_http 最后重启 Apache2 即可 sudo systemctl restart Apache2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant