xdtianyu / scripts

scripts for work
https://www.xdty.org
1.03k stars 243 forks source link

如何在一台机器上配多个站? #7

Closed gamefriends closed 8 years ago

gamefriends commented 8 years ago

一台机器有多个站,例如: www.domain.com 对应-> /home/wwwroot/www.domian.com static.domain.com 对应-> /home/wwwroot/static.domain.com

那个DOMAIN_DIR该如何配置呢?

xdtianyu commented 8 years ago

做两个配置文件,脚本运行两次。如果你不愿意这么做,可以临时调整你的web配置,指向到同一个目录。

gamefriends commented 8 years ago

了解了,非常感谢。

RYAN-JIM commented 8 years ago

脚本运行两次,生成的account.key,domain.key等文件会不会覆盖原先的?

xdtianyu commented 8 years ago

@RYAN-JIM 不会覆盖

RYAN-JIM commented 8 years ago

折腾了一个下午,用的apache,可用的资料很少,证书是获取了,但配不起来,yum install mod_ssl 运行后 结果覆盖文件,导致apache无法启动。现在恢复了,却不敢再折腾了。

我邮箱:joomlavisually{@}gmail.com 可以的话,希望能跟你更好的交流和学习下

官方脚本和acme-tiny都用过,配不起来。

xdtianyu commented 8 years ago

@RYAN-JIM 可以参考这里 http://www.freehao123.com/lets-encrypt/

RYAN-JIM commented 8 years ago

第一个参考的就是你说的这个,他下面的apache配置是修改自军哥的,是错误的。会导致apache无法启动 证书都已经在/etc/letsencrypt/live/域名.com目录下了。只差正确的配置

RYAN-JIM commented 8 years ago

在日本人的网站上看到配置,没测试,不懂的是/var/www/example这个地方是不是要改成站点路径? <VirtualHost *:443> ServerName example.com DocumentRoot "/var/www/example"

SSLEngine on SSLHonorCipherOrder on Header set Strict-Transport-Security "max-age=31536000; includeSubDomains" SSLProtocol -All +TLSv1 +TLSv1.1 +TLSv1.2 SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5

SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem

<Directory "/var/www/example">
    Options FollowSymLinks
    AllowOverride None
    Require all granted
</Directory>

SetEnvIf Request_URI "\.(gif|jpg|png|css|js)$" nolog
ErrorLog logs/error_log
CustomLog logs/access_log combined env=!nolog

xdtianyu commented 8 years ago

是的,要改成域名指向的目录。如果有这类问题请先检查下 apache 的错误日志,再搜索/思索下是哪里的问题。