apache2.2

Restrict access to directories through ip address

青春壹個敷衍的年華 提交于 2020-03-26 07:07:30
问题 I have a webserver with apache, say ip is 12.345.678.90 . In my www directory there are a few sites, say, site1 and site2 . Both belong to the same ip address - I created virtual hosts. Websites are on cakephp framework and there are a lots of directories, for example, app , app/tmp , lib , lib/Cake etc. When accessing the website like http://site1.com or http://site2.com everything is all right, and no way these directories can be viewed or accessed, but through ip I can see everything. http

Restrict access to directories through ip address

狂风中的少年 提交于 2020-03-26 07:06:57
问题 I have a webserver with apache, say ip is 12.345.678.90 . In my www directory there are a few sites, say, site1 and site2 . Both belong to the same ip address - I created virtual hosts. Websites are on cakephp framework and there are a lots of directories, for example, app , app/tmp , lib , lib/Cake etc. When accessing the website like http://site1.com or http://site2.com everything is all right, and no way these directories can be viewed or accessed, but through ip I can see everything. http

PHP Error: “Call to undefined function mysqli_connect()”

你离开我真会死。 提交于 2020-01-02 04:56:18
问题 In PHP I'm getting this error: Call to undefined function mysqli_connect() I checked my php.ini file and there is no ; in front of extension=php_mysql.dll or extension=php_mysqli.dll . I think the I am getting this error because my figuration File (php.ini) Path is C:\Windows . How would I change it to C:\Apache2.2\php\php.ini ? 回答1: On Ubuntu machines you can try: sudo apt-get install php5-mysql since the basic PHP5 install does not include the mysqli_connect function. 回答2: You can set the

Apache ErrorDocument with absolute path

こ雲淡風輕ζ 提交于 2020-01-02 04:07:08
问题 I have a server with several virtual hosts. Now I want to set up the error documents for the whole server. I have located my error sites in /var/www/error/*, but with the ErrorDocument Directive I am only able to set the error document relative to document root, but I want to use the absolute path (e.g /var/www/error/404.html). Has anyone an idea how I can get this? 回答1: I don't think this can be done directly inside the statement: The ErrorDocument will always have to be relative to the

oci_connect() works only from command line

我怕爱的太早我们不能终老 提交于 2019-12-30 18:51:07
问题 OK, so I have this terrible problem with oci, apache, php and suse. First off, versions: PHP 5.3.15 (cli) Apache/2.2.22 (Linux/SUSE) OCI8 1.4.9 SUSE 12.2 32 bit Oracle client 10.2.0.4 Problem I have really simple php file: <?php error_reporting(E_ALL); ini_set('display_errors', '1'); oci_connect('user', 'passwd', 'host/sid'); ?> When I run it from command line it executes fine: machine:~ # php oci.php machine:~ # But when i run it in browser, it gives me: Warning: oci_connect() [function.oci

.htaccess: how to restrict access to a single file by IP?

帅比萌擦擦* 提交于 2019-12-28 03:46:06
问题 I've look all over, but keeps running into same info that talks about directory level IP restriction, which usually looks something like this: Order Deny,Allow Deny from all Allow from 123.123.123.123 Is it possible to have same type of access restriction tied to a page/document? 回答1: This will allow either someone from IP 127.0.0.1 or logged as a valid user. Stick it either in your config or .htaccess file. <Files learn.php> Satisfy any Order deny,allow Deny from all Allow from 127.0.0.1

Apache OpenMeetings 4.0.4 CSRF attack when using apache2 as proxypass

狂风中的少年 提交于 2019-12-24 00:33:08
问题 I've got Apache OpenMeetings 4.0.4 witch Apache/2.2.22 as proxy. In OM's conf/red5.properties I've got http.port=8080 I want to do two things: Redirect HTTP (80) -> HTTPS (443) Redirect HTTP (8080) to HTTPS (443) My /etc/apache2/sites-avilable/default conf is: <VirtualHost *:80> ServerName domain.test-test.eu ServerAlias domain.test-test.eu RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} </VirtualHost> <VirtualHost *:8080> ServerName domain.test

Apache 2.2 redirect to SSL *then* do auth (with solution < but is it crap?)

这一生的挚爱 提交于 2019-12-23 08:47:50
问题 Seems to be the place for apache so here goes :) Age old problem: how so I redirect HTTP->HTTPS, then and only if HTTPS, do an auth? Oh - and I'd like most of it in a single snippet that can be Include-ed in multiple <directory> or <location> blocks, so no virtual host level random path based rewrites... Well, here's what I have that does seem to work: In the top of a VirtualHost block # Set ssl_off environment variable RewriteEngine on RewriteCond %{HTTPS} =on RewriteRule ^ - [E=ssl] In the

$_POST, $_GET and $_REQUEST Empty

时间秒杀一切 提交于 2019-12-20 07:42:46
问题 SOLVED : I omitted the name attribute on the input fields. I have a simple html/php -form. And I submit it. The $_POST is always empty. If I try a get then the GET is always empty. Same for $_REQUEST and php://input. I get nothing in return. There a lot of posts with this subject, yet I have not found the solution for my problem. I do not have a rewrite or redirect. The method_request is POST. There is no clash with id's in the form, php://input is empty as well, REQUEST is empty as well. I

Should I disconnect() if I'm using Apache::DBI's connect_cached()?

大憨熊 提交于 2019-12-19 12:06:00
问题 My mod_perl2-based intranet app uses DBI->connect_cached() which is supposedly overridden by Apache::DBI 's version of the same. It has normally worked quite well, but just recently we started having an issue on our testing server--which had only two users connected--whereby our app would sometimes, but not always, die when trying to reload a page with 'FATAL: sorry, too many clients already' connecting to our postgres 9.0 backend, despite all of them being <IDLE> if I look at the stats in