Is it possible to use variables in httpd.conf

Yes, kind of. You can get environment variables substituted in to the config file at start up with the ${ENVVAR} syntax. It’s up to you to figure out how to set those variables before starting up the server. http://httpd.apache.org/docs/2.2/configuring.html#syntax Note that these variables will persist so any scripts in languages like php will be able … Read more

How can I prevent tons of apache processes spawning when I start apache and proceeding to kill my machine?

You have probably made the error of configuring Apache to use far more than all of your ram. This is an easy mistake to make. I am assuming you are using a Prefork Apache, and an in-process application server (such as PHP or mod_perl). In this model, you will end up with a maximum of … Read more

Best way to log POST data in Apache?

Use Apache’s mod_dumpio. Be careful for obvious reasons. Note that mod_dumpio stops logging binary payloads at the first null character. For example a multipart/form-data upload of a gzip’d file will probably only show the first few bytes with mod_dumpio. Also note that Apache might not mention this module in httpd.conf even when it’s present in … Read more

Need to allow encoded slashes on Apache

I kept coming across this post for another issue. Let me just explain real quick. I had the same style URL and was also trying to proxy it. Example: Proxy requests from /example/ to another server. /example/http:%2F%2Fwww.someurl.com/ Issue 1: Apache believes that’s an invalid url Solution: AllowEncodedSlashes On in httpd.conf Issue 2: Apache decodes the … Read more

index.php not loading by default

Apache needs to be configured to recognize index.php as an index file. The simplest way to accomplish this.. Create a .htaccess file in your web root. Add the line… DirectoryIndex index.php Here is a resource regarding the matter… http://www.twsc.biz/twsc_hosting_htaccess.php Edit: I’m assuming apache is configured to allow .htaccess files. If it isn’t, you’ll have to … Read more

how to use “AND”, “OR” for RewriteCond on Apache?

This is an interesting question and since it isn’t explained very explicitly in the documentation I’ll answer this by going through the sourcecode of mod_rewrite; demonstrating a big benefit of open-source. In the top section you’ll quickly spot the defines used to name these flags: #define CONDFLAG_NONE 1<<0 #define CONDFLAG_NOCASE 1<<1 #define CONDFLAG_NOTMATCH 1<<2 #define … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)