html - 如何在站点服务器中设置子域?

标签 html linux webserver

我有一个域名 hacks4liveprojects.com ,但我想创建一个子域; somehere.hacks4liveprojects.com 或类似的东西。我的网站托管在 Ubuntu 17.10 服务器上。

如何做到这一点?

我的网站位于:/var/www/html/如果您想知道...

编辑:语法

最佳答案

  • 在/var/www/html 中创建一个名为 somehere 的目录
  • 转到/etc/apache2/sites-available
  • 将 000-default.conf 复制到 somehere.conf
  • 编辑此处.conf
  • 将服务器名称更改为 somethinghere.hacks4liveprojects.com,将目录/var/www/html 更改为 目录/var/www/html/somethinghere。 DocumentRoot 也是如此
  • 然后使用 sudo a2ensite Somethinghere.conf 激活它,并使用 sudo service apache2 reload 重新加载您的 apache 设置

关于html - 如何在站点服务器中设置子域?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49686174/

相关文章:

javascript - 使用 CSS 更改当前页面的链接颜色

javascript - 带有垂直文本的 CSS 垂直按钮

linux - 为什么我的计时器不是周期性的而是只过期一次?

asp.net - 请求静态内容时避免使用 cookie

javascript - 如何检测 DOM 元素的类属性何时发生变化?

html - 在不设置静态宽度的情况下将工具提示水平居中放置在父项下方

linux - ifconfig 统计信息 : where are they from?

linux - 如果在 shell 中运行 'exec ls' 会发生什么?为什么?

java - netty.io 提供静态网页内容

c - 用 C 写一个网络服务器