解析apache中的子域

发布于 2024-07-28 22:29:39 字数 1448 浏览 3 评论 0原文

不确定我是如何修复它的,或者我是否修复了它。 可能要花很长时间才能解决 DNS 之类的问题,但现在它可以工作了。 显然,即使我在下面列出的网站显示所有内容都指向正确的地址,但某些地方的某些内容无法正确解决。 - - - - - 原始信息 - - - - - - - - 我不确定这里出了什么问题,但我一直在尝试设置子域,但无法解决它。

我已通过在该网站中输入网址来检查域设置是否正确 http://www.selfseo.com/find_ip_address_of_a_website.php 检查子域是否指向正确的服务器,并且它返回我的服务器 IP(我还检查了未设置的子域,并且它无法解析,因此该站点确实可以工作)。

所以,现在我认为问题一定出在我的 apache 配置文件中。

虚拟主机详细信息是这样的,

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html
    ServerName mysite.com
    ErrorLog logs/mysite-error_log
    CustomLog logs/mysite-access_log common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/liveTest
    ServerName liveTest.mysite.com
    ErrorLog logs/mysitetest-error_log
    CustomLog logs/mysitetest-access_log common
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !\.(php|html|css|js|gif|png|jpe?g)$
    RewriteRule (.*)$ /index.php [L]
</VirtualHost>

我重新启动了服务器,但什么也没有得到,但是转到 http://mysite/liveTest 可以工作,因此目录结构都是正确的。

知道我这里出了什么问题吗?

Not sure how I fixed it, or if I did. might have just been taking forever for the dns to get resolved or something, but it works now. Apparently even though the site I listed below showed everything pointing to the right address, something somewhere wasn't resolving properly.
--------- original message ---------------
I'm not sure what has gone wrong here, but I've been trying to get a subdomain set-up, and i can't get it to resolve.

I've checked that the domain is set-up properly by typing the url into this site
http://www.selfseo.com/find_ip_address_of_a_website.php
to check that the subdomain is pointing to the correct server, and it returns my server ip (I also checked a subdomain not set-up, and it doesn't resolve, so that site does work).

So, now i'm figuring the problem must be in my apache config file.

The virtual host details are like this

<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html
    ServerName mysite.com
    ErrorLog logs/mysite-error_log
    CustomLog logs/mysite-access_log common
</VirtualHost>
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/liveTest
    ServerName liveTest.mysite.com
    ErrorLog logs/mysitetest-error_log
    CustomLog logs/mysitetest-access_log common
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !\.(php|html|css|js|gif|png|jpe?g)$
    RewriteRule (.*)$ /index.php [L]
</VirtualHost>

i restarted the server, and I get nothing, but going to http://mysite/liveTest works, so the directory structure is all correct.

Any idea what I've got wrong here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

懒的傷心 2024-08-04 22:29:39

你有< 虚拟主机 *:80 > < /虚拟主机> 围绕两个代码块中的每一个? <-- 好吧,你已经知道了。

那你检查过日志吗? 也许尝试删除第二个 URL 中的重写,以消除可能的错误源。

Do you have < VirualHost *:80 > < /VirtualHost> surrounding each of the two code blocks? <-- ok, you have that.

Then have you checked the logs? Maybe try to remove the Rewriting in the second URL, to eliminate possible error sources.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文