首先,在我在hostgator的专用服务器上安装OSQA之前,我想知道要求。 我不想搞砸我的服务器,所以最好先问问题。 我已经在互联网上阅读了很多关于Django的教程,但是在继续之前我想澄清一些事情。 在我的专用服务器上,我不使用FCGI。 相反,我使用Mod SuPHP。 很多教程都在讨论使用FCGI安装python。 我的问题是如果我使用SuPHP安装Python是否安全? 在这个链接上使用教程是否安全: http : //wiki.osqa.net/display/docs/Installing+OSQA+on+CentOS6?focusedCommentId=4784144 在此先感谢您的帮助。
我在一个rackspace服务器上使用apache2和MySQL的PHP,它是非托pipe的cluoud托pipe。 我正在使用虚拟主机托pipe多个网站。 现在我想使用它的Django。 一个网站需要django,所以我已经安装了django和mod_wsgi使用apt-get install 。 然后我在httpd.conf中写了下面几行 WSGIScriptAlias / /var/www/djangosite/pyproject/mysite/mysite/wsgi.py WSGIPythonPath /var/www/djangosite/pyproject/mysite/ <Directory /var/www/djangosite/pyproject/mysite/mysite/> <Files wsgi.py> Order deny,allow Allow from all </Files> </Directory> 但是,只有django在所有网站上工作,只有该特定的项目出现在所有网站上。 所以如果我只想要它为特定的网站工作,我需要什么? 以便其他网站可以在以前使用PHP工作时工作。 我需要设置服务器名称等在哪里?
我是一个应用程序开发人员,几乎没有网站开发经验,现在不得不在虚拟服务器上检查一些工作,似乎工作正常,但我找不到主机的configuration[这项工作是由一个系统pipe理员是在度假,所以同时我只需要一些真正的基本configuration,如果指出我可以找出的位置], 所以服务器与Django和PHP的工作,已经有一个Django的网站,我可以看到,该网站的主机configuration $/etc/hosts 喜欢这个: 106.187.93.147 applounge.com.au 问题是,有一个https hello世界的网站,我似乎无法find主机configuration, https://106.187.93.147/tests/hello.html 那么,我在哪里可以find这个httpsconfiguration? 正如指出的主办与Django和PHP的工作,所以在PHP的configuration应该是? $/etc/httpd 但是我的$ / etc中没有这样的文件夹 谢谢!
加载dynamic生成的图像时,我有一个非常奇怪的Http500错误。 由于某种原因,它只是偶尔发生。 apache错误日志不显示任何错误。 django开发服务器曾经为它们提供了很好的开发服务。 来自日志的示例: 174.255.117.79 – – [04/Feb/2013:12:00:46 -0600] "GET /images/gender/ HTTP/1.1" 500 531 "http://okstereotype.me/results/" "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; XT862 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30" 174.255.117.79 – – [04/Feb/2013:12:00:46 -0600] "GET /images/bodytype/ HTTP/1.1" 500 531 "http://okstereotype.me/results/" "Mozilla/5.0 (Linux; U; Android 4.0.4; en-us; XT862 Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 […]
我在Amazon EC2上使用Django Bitnami Stack。 我试图同步数据库的初始设置,但我有问题。 运行以下命令时,收到一条错误消息: Python manage.py syncdb “无法通过套接字”/tmp/mysql.sock“(2)”连接到本地MySQL服务器“) 我明白这是因为无法build立到MySQL服务器的连接。 但是,当我从命令行运行此我可以连接: Mysql –u root –p // "Then entering my password” 以下是settings.py中的数据库设置: DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'djangostack', 'HOST': 'localhost', 'PORT': '3306', 'USER': 'root', 'PASSWORD': 'bitnami' } } 我试图重新启动MySQL服务器使用sudo service mysqld restart但我收到一条消息,指出mysql是一个无法识别的服务。 这是my.cnf文件: [mysqladmin] user=root [mysqld] basedir=/opt/bitnami/mysql datadir=/opt/bitnami/mysql/data port=3306 socket=/opt/bitnami/mysql/tmp/mysql.sock tmpdir=/opt/bitnami/mysql/tmp bind-address=127.0.0.1 […]
我在Ubuntu Linode上运行一个生产Django站点,带有4GB内存。 主要进程是Apache2,MongoDB,Memcache,PostgreSQL,Tomcat6和Redis。 Apache OOM每天大约10次。 我多次调整了apache2.conf中的值,并没有发现任何效果。 请求数量和内存峰值或请求和内存峰值之间没有明显的相关性。 我说“spikes”,因为通常Apache只消耗很less的内存,然后在一秒钟内突然跳到3.5GB并被内核杀死。 使用JMeter(负载testing软件)我无法人为地触发尖峰,正常情况下负载下的内存消耗非常低且稳定。 内存使用的24小时图(来自Linode Longview): http : //i.imgur.com/ysIYe8l.png 这也看起来像内存使用也在缓慢攀升。 从系统日志: kernel: apache2 invoked oom-killer: … kernel: 11705 total pagecache pages kernel: 5472 pages in swap cache kernel: Swap cache stats: add 76719087, delete 76713615, find 92563708/94246314 kernel: Free swap = 0kB kernel: Total swap = 2097148kB kernel: 1050623 pages […]
所以我试图用我的Django应用程序的uwsgi设置Nginx。 这是我的/etc/nginx/nginx.conf文件: # /etc/nginx/nginx.conf user richard richard; ## Default: nobody worker_processes 5; ## Default: 1 error_log /var/log/nginx/error.log; pid /var/log/nginx/nginx.pid; worker_rlimit_nofile 8192; events { worker_connections 4096; ## Default: 1024 } http { include /etc/nginx/mime.types; include /etc/nginx/proxy.conf; index index.html index.htm; default_type application/octet-stream; log_format main '$remote_addr – $remote_user [$time_local] $status ' '"$request" $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; access_log […]
最近,我想把我的一个WSGI应用程序放到一个子目录中,这样其他包含各种脚本的目录就像以前一样工作。 为了做到这一点,我在全局命名空间的httpd.conf中添加了下面的指令(也试图把它放在VirtualHost ,它给出了相同的效果): WSGIScriptAlias /hello/ /var/www/hello/hello.wsgi 然后,我跑了django-admin startproject hello 。 重新加载Apacheconfiguration后,我可以确认http://localhost/hello/指向一个Django的“欢迎”屏幕。 然后,我编辑了hello/urls.py在urlpatterns元组中添加下面一行: url(r'^hello/', 'hello.views.home'), 接下来,我创build了具有以下内容的hello / views.py: from django.http import HttpResponse def hello(request): return HttpResponse("Hello world") 不幸的是,当我尝试访问http://localhost/hello/hello ,我得到一个标准的Apache 404消息,并在错误日志中input以下内容: [Mon Dec 23 19:49:44 2013] [error] [client 31.182.131.38] Target WSGI script not found or unable to stat: /var/www/hello/hello.wsgihello 注意hello.wsgihello 。 第二个hello是URL中/hello/之后出现的文本。 对于http://localhost/hello/unknown ,这将是hello.wsgiunknown 。 这里是我的hello.wsgi : […]
我一直试图在Ubuntu 12.04上设置一个开发环境太久。 我的意图是在后面的生产环境中设置一切,所以我按照这个教程来学习如何将Nginx设置为Apache 2的反向代理。 我一直在寻找,我的问题与这个问题非常相似,但没有给出答案,我不能评论它来增加我的一些研究。 让我们进入文件: Apache和wsgi 首先,我从apt-get安装了mod_wsgi,然后在/ etc / apache2 / sites-available中创build了一个mysite文件: <VirtualHost *:8080> ServerAdmin [email protected] ServerName mysite.dev ErrorLog /path/to/developmentfolder/mysite/logs/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel debug CustomLog /path/to/developmentfolder/mysite/logs/access.log combined WSGIDaemonProcess mysite WSGIProcessGroup mysite WSGIScriptAlias / /path/to/developmentfolder/mysite/apache/django.wsgi <Directory /path/to/developmentfolder/mysite/apache> Order allow,deny Allow from all </Directory> </VirtualHost> […]
试图了解如何强制www。 在我的域名并redirect像ww.example.com或test.example.com – > www.example.com 一切正常,当我去www.example.com或example.com,我只是试图掩盖自己,如果人们尝试去错误的领域,我不应该添加任何比'www.example.com'和' example.com'在我的django ALLOWED_HOSTS 我把所有东西都按照: 如何使用Django的一键安装图像 upstream app_server { server 127.0.0.1:9000 fail_timeout=0; } server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; root /usr/share/nginx/html; index index.html index.htm; client_max_body_size 4G; server_name _; keepalive_timeout 5; # Your Django project's media files – amend as required location /media { alias /home/django/django_project/django_project/media; } # your […]