apache2

The logs of POST/GET requests from Django application on Apache

◇◆丶佛笑我妖孽 提交于 2020-01-24 22:18:07
问题 Django development server is really nice, it shows the log of all POST/GET requests as well as other events in real time. Example of logs from Django dev server: [04/Jul/2012 19:23:27] "GET /static/images/sprites/submit_url_hover.png HTTP/1.1" 200 7088 [04/Jul/2012 19:23:42] "POST /validate_link HTTP/1.1" 200 0 [04/Jul/2012 19:23:44] "POST /download_link HTTP/1.1" 200 0 It's very useful for debugging, figuring out the sources of 500 errors, etc. I've recently deployed my Django app on Apache

Apache2 Configuration That Allows a Subdomain Point to an Machine:Port

▼魔方 西西 提交于 2020-01-24 19:48:05
问题 I own the domain, "peterlee.com.cn", and I added an A Record in my domain control panel: RR Destination IP TTL rs.peterlee.com.cn 10.50.10.75 1 hour I have an RoR (Ruby on Rails) project running on 10.50.10.75:9051 , which means the user can visit my RoR application by http://10.50.10.75:9051 I want to let the user visit it by http://rs.peterlee.com.cn, so I added the following VirtualHost File/Site: <VirtualHost *:80> ServerName rs.peterlee.com.cn DocumentRoot /usr/website/myapp/current

How can I use SetEnvIf based on matches in the query string?

本秂侑毒 提交于 2020-01-24 16:17:20
问题 The URL I'm using is, let's say, example.com/subdir/index.php?foo=bar index.php contains this: <?php echo getenv("testenvvar"); ?> I'm setting an enviroment variable in .htaccess like so: SetEnvIf Request_URI (index) TestEnv=Worked This prints "Worked". If I change it to SetEnvIf Request_URI (bar) TestEnv=Worked , it does not. How can I do this? 回答1: To match query string you will need mod_rewrite rules instead of mod_setenv . Place this code in root .htaccess: RewriteEngine On RewriteCond %

How can I use SetEnvIf based on matches in the query string?

坚强是说给别人听的谎言 提交于 2020-01-24 16:17:12
问题 The URL I'm using is, let's say, example.com/subdir/index.php?foo=bar index.php contains this: <?php echo getenv("testenvvar"); ?> I'm setting an enviroment variable in .htaccess like so: SetEnvIf Request_URI (index) TestEnv=Worked This prints "Worked". If I change it to SetEnvIf Request_URI (bar) TestEnv=Worked , it does not. How can I do this? 回答1: To match query string you will need mod_rewrite rules instead of mod_setenv . Place this code in root .htaccess: RewriteEngine On RewriteCond %

Symfony 3 Apache 500 Internal Server Error

纵然是瞬间 提交于 2020-01-22 12:59:11
问题 I'm using Symfony 3.2.3 and switched from PHP built-in Web Server to Apache (http://symfony.com/doc/current/setup/web_server_configuration.html, Apache 2.4.18). It works for the root Symfony page (http://example.com/, without Symfony routing), but when I'm creating a controller with a routing (e.g. @Route("/development", name="development")), I got an Apache 500 Internal Server Error. When requesting this side (/development) with PHP built-in Web Server, it works fine. In Apache log I do not

OpenSSL not working on Windows, errors 0x02001003 0x2006D080 0x0E064002

我只是一个虾纸丫 提交于 2020-01-18 21:34:26
问题 Problem: OpenSSL is not working in my Windows environment. OpenSSL repeatedly reports errors 0x02001003, 0x2006D080 and 0x0E064002. Environment: Windows NT x 6.1 build 7601 (Windows 7 Business Edition Service Pack 1) i586 Apache/2.4.4 (Win32) PHP/5.4.13 x86 PHP Directory: E:\wamp\php\ Virtual Host Directory: E:\Projects\1\public_html What I've Attempted: Installation Instructions http://www.php.net/manual/en/openssl.installation.php PHP.ini extension=php_openssl.dll Openssl.cnf E:\wamp\php

Django/Python How should this cronjob be executed

隐身守侯 提交于 2020-01-16 19:17:10
问题 I created a simple python script that allows me to update a chosen animal to be displayed on the sites frontpage. when I am in my ssh, I run it like this. cd /www/site/mydirectory python perform_daily_action.py How do I run this in my crontab as a cronjob. I tried to do 30 09 * * * cd /www/site/mydirectory;python perform_daily_action.py Although this does not seem to work. Suggestions? 回答1: Try use this instead 30 09 * * * python /www/site/mydirectory/perform_daily_action.py 回答2: The other

How I can retrieve and play audio file in cakephp

回眸只為那壹抹淺笑 提交于 2020-01-16 18:32:30
问题 I am uploading audio files using cakephp app. I can move file successfully to folder and can update its path in database too. But I can not retrive that file successfully. server reply with 206 Partial Content AND some times with 304 Not Modified status. can anyone help me to figure out why server respondig with such status? 回答1: You are using chromium. Mp3 is not supported in both chromium and firefox for ubuntu. You can convert mp3 to ogg to play them in chromium and firefox. Or you can

XAMPP v1.7.4 installation issues,local host not working

坚强是说给别人听的谎言 提交于 2020-01-16 18:25:08
问题 I had an older version on XAMPP and it was working fine. I uninstalled it to install the new version.Since then local host has stopped working. XAMPP control panel says Apache and MySQL running.Can some one help please? I have got this in the httpd-vhosts.conf,do i make any changes here? ##<VirtualHost *:80> ##ServerAdmin postmaster@dummy-host.localhost ##DocumentRoot "C:/xampp/htdocs/dummy-host.localhost" ##ServerName dummy-host.localhost ##ServerAlias www.dummy-host.localhost ##ErrorLog

Multiple apache root processes

旧时模样 提交于 2020-01-15 06:04:50
问题 I noticed today that when making requests from our web server, things were rather slow. I started looking into it and I've found a load of root owned apache processes. I don't know for sure that this is actually what's causing things to be slow, but none the less, it doesn't look good. problem is, I don't know what to do from here? How do I find out why there are so many root processes? Could some recommend a set of tests? I've tried stracing a few of them, and they appear to be doing