0

我想运行 www.example.com 以供 django 访问和管理。和,

www.example.com/about 或 www.example.com/about/...

www.example.com/wordpress 或 www.example.com/wordpress/...

由wordpress管理。

因此,wordpress 管理员将位于 www.example.com/wordpress,它生成的页面将位于 www.example.com/about/...

我不知道该怎么做。如何将这两个东西托管在同一个 apache 服务器上?

这是我当前的 wsgi 文件,django 应用程序在 www.example.com 上运行。但是当我访问 www.example.com/about/ 时,它会尝试通过 urls.py 并没有找到任何东西。我怎么把我的wordpress页面放在这里?

LoadModule wsgi_module modules/mod_wsgi.so

WSGIScriptAlias / "C:\Users\Nikunj\Documents\Aptana Studio 3 Workspace\myapp\myapp\wsgi.py"

Alias / "C:\Users\Nikunj\Documents\Aptana Studio 3 Workspace\myapp\myapp\"

<Directory />
Order allow,deny
Allow from all
</Directory>

谢谢你的帮助!!:)

编辑这是我使用 jdi 的答案的新文件,但它仍然不起作用:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / "C:\Users\Nikunj\Documents\Aptana Studio 3 Workspace\myapp\myapp\wsgi.py"

Alias /wordpress/ "C:\wamp\www\wordpress\wp-admin\"
Alias / "C:\Users\Nikunj\Documents\Aptana Studio 3 Workspace\myapp\myapp\"

<Directory "C:/wamp/www/wordpress/wp-admin/">
  AllowOverride All
  Order Deny,Allow
  Allow from all
</Directory>

<Directory />
  Order allow,deny
  Allow from all
</Directory>
4

2 回答 2

2

在您的 apache conf 中创建多个目录条目:http ://httpd.apache.org/docs/2.0/mod/core.html#directory

一个是为wordpress设置的,一个是为django设置的。现在,每一点流量总是流向你的 django 应用程序。

它可能看起来像这样(只是猜测):

Alias /about/ "C:/path/to/wordpress/"
Alias /wordpress/ "C:/path/to/wordpress/wp-admin/"

Alias / "C:/Users/Nikunj/Documents/Aptana Studio 3 Workspace/myapp/myapp/"

<Directory "C:/path/to/wordpress/">
  AllowOverride All
  Order Deny,Allow
  Allow from all
</Directory>

<Directory />
  Order allow,deny
  Allow from all
</Directory>
于 2012-06-08T21:29:12.817 回答
0

最终答案:

LoadModule wsgi_module modules/mod_wsgi.so
WSGIScriptAlias / "C:/wamp/www/myapp/myapp/wsgi.py"

Alias /about/ "C:/wamp/www/wordpress/"
<Directory "C:/wamp/www/wordpress/">
  AllowOverride All
  Order Deny,Allow
  Allow from all
</Directory>

<Directory "C:/wamp/www/myapp">
  Order deny,allow
  Allow from all
</Directory>

www.example.com <- django

www.example.com/about <- wp

谢谢!

于 2012-06-09T00:54:48.947 回答