apache

problem when migrating from development into live server

I'm facing problem when migrate my web app project from development server to live server. the reason is because i just realize that the live server has different PHP version and available memory lower then mine. i found this after client give me their ftp and cpanel access of their server, which is a shared host. so, how do we han...

PHP : How to understand bitmask value of access from ini_get_all function

i'm start to use ini_get_all function to retrieve all configuration option on a shared host server. in the end i got this chunk of array : [allow_call_time_pass_reference] => Array ( [global_value] => 1 [local_value] => 1 [access] => 6 ) [allow_url_fopen] => Array ( [global_value] => 1 ...

Tomcat cookies not working via my ProxyPass VirtualHost

Hi there. I'm having some issues with getting cookies to work when using a ProxyPass to redirect traffic on port 80 to a web-application hosted via Tomcat. My motivation for enabling cookies is to get rid of the "jsessionid=" parameter that is appended to the URLs. I've enabled cookies in my context.xml in META-INF/ for my web applica...

Apache mod_rewrite - prefer files over directories with pretty URLs

I want to have pretty urls so http://www.domain.com/foo will return http://www.domain.com/foo.php The issue is that there is a directory that has the same name. I have another page at http://www.domain.com/foo/bar/baz and right now my server just returns the directory listing of foo when I request http://www.domain.com/foo Pseudocode: ...

Protect Apache server

My server is attacked like this 188.165.198.65 ./../../../../../../../../../etc/passwd%00 HTTP/1.1" 200 28114 "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1" How can I defend it with .htaccess file? ...

Apache: get client socket descriptor from request_rec?

I would like to call sendfile() to send some data to the client with as little overhead as possible. Given an Apache struct request_rec, how can I get the fd associated with the client socket? ...

Handling multiple HTTP requests from one source (e.g. a hacker)

I have a script to handle http requests. I'm trying to think of some of the security issues I might have with it. My biggest concern at the moment is how I can manage multiple requests from the same source over and over. For instance someone trying to shut down my system. Do I need to be concerned or will Apache handle this issue. If no...

mod_rewrite to change my urls

Hi, I've been fighting with mod-rewrite for a while. Basically, I have a website that I'm moving to a difference namespace/directory. What I'd like to do is change urls that look like this: http://mydomain.com/index.php?a=xxxxxxxxxx These urls will always have "index.php?a=". I have a different/new site that also has an index.php fi...

PHP's apache_setenv function causes 500 Internal Server Error

apache_setenv ( 'no-gzip', 1 ) I'm trying to disable gzip for a certain page's output, but only that page. This works fine on testing servers, but not the production server, which is running the same thing (CentOS and Apache), works on Ubuntu though. Anyway, do you know why? Or is there some other alternative? I was thinking of using...

htaccess mod rewrite NOT

Hi, I have a small problem with url rewriting on apache. I would like it that it ignores the admin/ folder from rewriting. Options +FollowSymLinks RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?cat=$1&name=$2 [L] RewriteRule ^([^/]*)/$ /index.php?cat=$1 [L] I have triend doing it myself but I can't figure it out. Thanks. ...

How to GZIP my JS und CSS Files

Hello everyone, I habe a Problem, I have to gzip a prototype Lib, but i totaly have no idea how to do this, where to start und how does it works :) I find some tutorials but that wasn't helpfull... So I have a folder with my JS Files /compressed/js/ 1.js 2.js 3.js I caling this files for a test in this file /compresses/index.php <...

Mixing .htacess wildcard and cpanel pointed subdomains gives 500 internal server error for any subdir of the pointed subdomain

On my site, I've got Wordpress in www.mydomain.co.uk, I've got a search engine on find.mydomain.co.uk, and I've got subusers on a wildcard with a script in a subdirectory to work out what to serve, based on the subdomain. In cpanel, I have, for the subdomain redirect: *.mydomain.co.uk /mydomain find.mydomain.co.uk /mydomain/find in...

XAMPP: Couldn't start MySQL!

Hi, i'm getting this error when i start LAMPP: XAMPP: Couldn't start MySQL! I tried with sudo /etc/init.d/mysql stop but nothing.. Any idea? Regards Javi ...

List directives in Apache DirectoryIndex

Does anyone know of a way to parse the contents of the apache DirectoryIndex directive (in httpd.conf) using PHP? ...

PHP/Apache Deny folder access to user but not to script

Hey all, So I have this php web app, and one of my folder contains some files that can be downloaded. I have a download script that modifies the headers, in order to always offer a download link. (instead of showing a picture for example, when you click on a link, a download box pops out) Right now, if you enter a url like: http://www...

Prevent .htaccess syntax error

Hi, As part of one our system's we enable a user in the backoffice to add a block of 301 redirects should they need to. This is just a textarea which then populates a specific area of a .htaccess file. As much as this may seem insecure it has only previously used internally by people who know what they are doing but for various reasons ...

URL Rewriting from a subdomain to main domain!

Hello. I am developing a pretty large website for a client, and its about 90% complete. It is currently hosted on a subdomain like so: now: v2.websitehere.com when complete: www.websitehere.com My problem is that SO much of this site is linked to the temporary subdomain. The newsletter service, multiple google apis, etc. I als...

Setting subdomains using htaccess

Hi all I want to set a subdomain for all site users, like www.companyname.mydomain.com I would like to use htaccess for this. when somebody requests www.companyname.mydomain.com it should redirect to myfile.php?name=companyname How can I achieve this using an htaccess file ? Thanks for the consideration. ...

Server port 16080 problem: webserver adds the port number 16080 in the URL

Hello everybody. On my wordpress website one little thing doesn't work. Sometimes the Webserver adds the port number 16080 in the URL, which leads to an error (network timeout). Wrong: http://www.example.com:16080/about-us/weekly-program/?month=may&amp;yr=2010 Correct: http://www.example.com/about-us/weekly-program/?month=may&amp;yr=20...

How can a hacker put a file on my server root (apache, php, 1and1)

Hi there, I have a site hosted on 1and1 and a couple of weeks ago I noticed a hacker had put a .php file on the server that when viewed in a browser exposed my DB schema, DB connection strings, FTP account (for file uploads using a form), etc, etc. Naturally I panicked and I wiped the server and reuploaded my files. Fortunatley I encrypt...