所需行为
我希望能够在localhost/rockmongo
访问RockMongo。
当前行为
我得到了:
Error: 404 Not Found
Sorry, the requested URL 'http://localhost/rockmongo' caused an error:
Not found: '/rockmongo'
环境
mod_wsgi
virtualenv
/etc/apache2/sites-available/000-default.conf
WSGIPythonHome /var/www/html/ENV
WSGIPythonPath /var/www/html:/var/www/html/ENV/lib/python2.7/site-packages:/var/www/html/wsgi
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
WSGIScriptAlias / /var/www/html/wsgi/application
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
目录权限
/无功/网络
drwxr-xr-x 3 root root 4096 Nov 23 08:58 www
的/ var / www / html等
drwxr-xr-x 10 me me 4096 Nov 26 23:46 html
/无功/网络/ HTML / rockmongo
drwxr-xr-x 5 me me 4096 Jun 6 23:04 rockmongo
Apache错误日志
没有与此相关的错误。
答案 0 :(得分:0)
我得到了它的工作,但我很想确认这是正确的方法,并没有为RockMongo创建任何安全问题或干扰mod_wsgi
功能的其他方面。
我在下面添加了Alias
行和Directory
块。
<强> /etc/apache2/sites-available/000-default.conf 强>
WSGIPythonHome /var/www/html/ENV
WSGIPythonPath /var/www/html:/var/www/html/ENV/lib/python2.7/site-packages:/var/www/html/wsgi
<VirtualHost *:80>
# for all content in static folder - css, js, img, fonts
Alias /static/ /var/www/html/wsgi/static/
# for rockmongo
Alias /rockmongo /var/www/html/rockmongo
<Directory /var/www/html/rockmongo>
Order deny,allow
Allow from all
</Directory>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
WSGIScriptAlias / /var/www/html/wsgi/application
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>