apache2

Switching from prefork MPM to worker MPM + php-fpm on ubuntu

守給你的承諾、 提交于 2019-12-31 10:46:10
问题 All tutorials I found were how to fresh install worker MPM + PHP-FPM, since my wordpress blog's already up and running with prefork MPM, correct me if I'm wrong in the simulated installation process: I'm on ubuntu and according to some tutorials, the following lines would do all the tricks: apt-get install apache2-mpm-worker libapache2-mod-fastcgi php5-fpm php5-gd a2enmod actions fastcgi alias Then you setup configuration in /etc/apache2/conf.d/php5-fpm.conf : <IfModule mod_fastcgi.c>

Mercurial push, abort: authorization failed

给你一囗甜甜゛ 提交于 2019-12-31 08:43:43
问题 I'm having problems with pushing to mercurial repository: $ hg push pushing to https://user:***@hg.domain.com/X_repo searching for changes abort: authorization failed The same URL (with the same credentials) is accessible through the web browser. Also, I tried it without embedding usr+pass into the URL. HTTPS is correctly configured, I tried both Basic and Digest auth -- without a luck. Pulling (through HTTP) works fine. I'm using hgwebdir to serve my repo. What else should I check? I found

.htaccess RewriteRule adds drive path to URL

烂漫一生 提交于 2019-12-31 05:12:34
问题 I am using Zend Server CE (v.5.1.0) installed on C: on a Win7 machine. I have added one project to httpd.conf by adding: Alias /project "D:\Homepages\project" <Directory "D:\Homepages\project"> Options Indexes FollowSymLinks AllowOverride all Order allow,deny Allow from all </Directory> My .htaccess file in the project directory contains the following: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f RewriteCond %{REQUEST_URI} ^/\w*\.(css|js) [NC] RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$

Socket.io code 200 Error during WebSocket handshake

萝らか妹 提交于 2019-12-31 04:45:13
问题 I am using socket.io with nodejs and an apache server over it. I am getting a code 200 as response, I know I must get 101 . WebSocket connection to 'wss://SITEABC.com/socket.io/?siteId=site1234567&EIO=3&transport=websocket' failed: Error during WebSocket handshake: Invalid status line The configuration on apache is the folowing: RewriteCond %{HTTP:Upgrade} ^Websocket [NC] RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC] RewriteRule .* ws://localhost:1337/{REQUEST_URI} [P] RewriteCond %{REQUEST

Conditions in Apache

吃可爱长大的小学妹 提交于 2019-12-31 04:20:09
问题 I have KOHANA_ENV environment var set to DEVELOPMENT for example. Now there is a set of rules I'd like to apply only if that var is set to PRODUCTION (turn on mod_deflate, set expires headers defaults, turn off ETags, etc.), like: if (KOHANA_ENV == PRODUCTION) { // .. do stuff } Is there a way to do this on Apache level at all or it's better to have two conf files? 回答1: I do it with the help of the great module mod_macro. Let's say you have in /etc/apache2/envvars (for a Debian-like

How to view stderr of PHP's ldap_* functions (with LDAP_OPT_DEBUG_LEVEL=7) from mod_php

ⅰ亾dé卋堺 提交于 2019-12-31 02:52:12
问题 I can run the following from the PHP 5.4.16 CLI: ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); $conn = ldap_connect($hostname); ldap_bind($conn, $ldaprdn); And I will get a lot of debug output to stderr that starts like this: ldap_create ldap_url_parse_ext(ldaps://ldap.example.com) ldap_bind_s ldap_simple_bind_s ldap_sasl_bind_s ldap_sasl_bind ldap_send_initial_request ... That is great for debugging on the CLI. However, I need to debug from within Apache 2.2.15 mod_php because I am seeing

Getting the referrer URL in php ( including parameters )

眉间皱痕 提交于 2019-12-31 00:56:23
问题 Are there any HTTP Headers I could use to grab the entire referrer URL using a webserver/server-side scripting? Including query string, et cetera? 回答1: You should be able to grab it from the $_SERVER['HTTP_REFERER'] variable. 回答2: To add to Chacha's point, I don't know if you want to capture the client side hash part of the referrer URL (sometimes, you do). I.e. if the client came from "http://www.domain.com?x=3#y=5", the $_SERVER['HTTP_REFERER'] will only contain "http://www.domain.com?x=3",

How to debug “internal server error”?

你说的曾经没有我的故事 提交于 2019-12-31 00:28:20
问题 When you do changes to .htaccess files and something is wrong with it you get "Internal server error". That doesn't help me. How can I find out what's the actual error? 回答1: Error cause should be saved in server logs. Where it's exactly depends on your server and settings. Eg. in apache2 log file is defined in ErrorLog in your config or in virtual host. 回答2: In the case it is a syntax error, enabling debug may not help you. If you can, run built-in php syntax checker to ensure your file is

Why do some PHP installations have $_SERVER['SCRIPT_URI'] and others not?

回眸只為那壹抹淺笑 提交于 2019-12-30 22:54:55
问题 I run two Apache 2 servers. One has PHP5.2 and the other has PHP5.3. Is there a reason why on the 5.3 machine has $_SERVER['SCRIPT_URI'] ? Where does this variable come from? It is clearly something that is coming through from the Apache environment and it is not documented in the PHP manual. It is however a handy shortcut over a combination of ['HTTPS'] , ['SERVER_NAME'] and ['REQUEST_URI'] . I have tried looking through configuration files, searching SO and the web. 回答1: According to a post

PHP 5.3.2, Where do I find php5apache2_2.dll?

二次信任 提交于 2019-12-30 17:05:53
问题 I'm upgrading my local version of PHP to 5.3.2, on Windows. I'm running Apache 2.2 right now. I've downloaded the zipped VC6 version of PHP from here: http://windows.php.net/download/ To my dismay, there's no php5apache2_2.dll file anywhere in the ZIP, and unfortunately Google is no help. I don't understand how anybody manages to get PHP working if there is no .dll available in the ZIP contents. Why would they not include this essential file, and why is there nowhere to download it? It has me