通配符和自动子域

问题描述 投票:0回答:2

我正在浏览互联网,我不知道发生了什么。

我有一个带有 Centos webpanel 的 vps,vps 上有一个脚本,应该为想要添加名片的用户自动创建子域。

OVH 中的域名,我在 dns 区域条目中添加:* .mysite.eu A IP vps。

文件 /usr/local/apache/conf.d/vhosts.conf

ServerName myserver
ServerAlias *.mysite.eu
ServerAlias www.mysite.eu
ServerAdmin [email protected]
DocumentRoot /home/lupus/public_html
UseCanonicalName Off
ScriptAlias /cgi-bin/ /home/lupus/public_html/cgi-bin/

# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/lupus/mysite.eu/*.conf

<IfModule mod_userdir.c>
    UserDir disabled
    UserDir enabled lupus
</IfModule>

<IfModule mod_suexec.c>
    SuexecUserGroup lupus lupus
</IfModule>

<IfModule mod_suphp.c>
    suPHP_UserGroup lupus lupus
    suPHP_ConfigPath /home/lupus
</IfModule>

<Directory "/home/lupus/public_html">
    AllowOverride All
</Directory>

尝试创建名片时,地址是:https://mysite.eu/company/%26nbsp%3B(在这些奇怪的字符后面,我可以输入公司名称)

它应该是:https://company/mysite.eu

出了什么问题?

wildcard
2个回答
1
投票

我已经向 CWP 团队发送了此功能的功能请求。

不管怎样,暂时可以通过这段代码创建通配符子域名。通过 SSH 或文件管理器将此代码粘贴到 /usr/local/apache/conf.d/vhosts.conf 文件末尾

# vhost_start *.yourdomain.com
ServerName _wildcard_.yourdomain.com
ServerAlias *.yourdomain.com
ServerAdmin [email protected]
DocumentRoot "/home/yourdoma/public_html"
ErrorLog "/home/yourdoma/public_html/error.log"
ScriptAlias /cgi-bin/ /home/yourdoma/public_html/cgi-bin/
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/yourdoma/*.yourdomain.com/*.conf
SuexecUserGroup yourdoma yourdoma
suPHP_UserGroup yourdoma yourdoma
 &lt;Directory "/home/yourdoma/public_html"&gt;
 AllowOverride All
# vhost_end *.yourdomain.com

不要忘记将 yourdomain.com 替换为您自己的域名,将 yourdoma 替换为帐户的用户名。

保存文件并开始在您的帐户上使用通配符子域。


-2
投票

这是一个非常旧的东西,它不起作用。请更新新答案

© www.soinside.com 2019 - 2024. All rights reserved.