我试图用Django和PHP制作本地服务器,我想在其他计算机上访问。我试图创建两个文件夹,一个与django文件和其他名为PHP的PHP文件命名Django。我是初学者在Apache和到现在为止我只作了这样的:如何在Django1.8中配置Apache以及在服务器中使用PHP Debian
/etc/apache2/sites-available/etc/apache2/sites-available/000-default.conf:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
WSGIScriptAlias//var/www/wsgi_test/app.wsgi
<Directory /var/www/wsgi_test/>
Require all granted
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
应用。 WSGI:
def application(environ, start_response):
status = '200 OK'
output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'),
('Content-Length', str(len(output)))]
start_response(status, response_headers)
return [output]
我可以在本地主机(10.1.1.20)访问,以及任何子域的其他计算机,例如:10.1.1.20/whatever打开的“Hello World”的文件,但我想访问我的文件夹中的Django ,但它显示“Hello World”
// UPDATE
我解决与以下的答案:Django and PHP together in server with single ip and port only
Fox混合PHP和mod_wsgi也读取http://blog.dscpl.com.au/2014/09/hosting-php-web-applications-in.html –
@GrahamDumpleton谢谢! –