Home >Backend Development >PHP Tutorial >apache configuration - apache2 cannot resolve php when configuring secondary domain name resolution?

apache configuration - apache2 cannot resolve php when configuring secondary domain name resolution?

WBOY
WBOYOriginal
2016-07-06 13:52:331148browse

已经在服务商那边搞好了二级域名的指向。
httpd.conf:

<code><VirtualHost *:80>
        DocumentRoot /var/www/www/
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:10000/var/www/www/$1
    DirectoryIndex index.html index.php
</VirtualHost>


<VirtualHost *:80>
  DocumentRoot /var/www/www/a
  ServerName a.abc.com
  DirectoryIndex  index.php
</VirtualHost>

</code>

现在我可以通过a.abc.com访问到abc.com/a,但是里面的php脚本无法运行,这是为什么呢?

回复内容:

已经在服务商那边搞好了二级域名的指向。
httpd.conf:

<code><VirtualHost *:80>
        DocumentRoot /var/www/www/
    ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:10000/var/www/www/$1
    DirectoryIndex index.html index.php
</VirtualHost>


<VirtualHost *:80>
  DocumentRoot /var/www/www/a
  ServerName a.abc.com
  DirectoryIndex  index.php
</VirtualHost>

</code>

现在我可以通过a.abc.com访问到abc.com/a,但是里面的php脚本无法运行,这是为什么呢?

这多明显,你没有设置php转发代理。。。

<code class="apache">ProxyPassMatch ^/(.*\.php)$ fcgi://127.0.0.1:10000/var/www/www/a/$1</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn