apache

Tunnel over HTTPS

At my workplace, the traffic blocker/firewall has been getting progressively worse. I can't connect to my home machine on port 22, and lack of ssh access makes me sad. I was previously able to use SSH by moving it to port 5050, but I think some recent filters now treat this traffic as IM and redirect it through another proxy, maybe. T...

apache + lighttpd front-proxy concept

In order to lighten Apache's load people often suggest using lighttpd to serve up static content. e.g. http://www.linux.com/feature/51673 In this setup Apache passes requests for static content back to lighttpd via mod_proxy, while serving dynamic requests itself. My question is: how does this reduce the load on the server? Since you ...

SSL Certificate no WWW Apache (ModRewrite) EV

ModRewrite can easily handle stripping the www off the front of my domain. In .htaccess: RewriteEngine On RewriteCond %{HTTPS} on RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ https://%1/$1 [R=301,L] RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L] But with SSL...

How to disable all apache virtual hosts?

I'm writing a shell script to do some web server configuration. I need to disable all currently active virtual hosts. a2dissite doesn't accept multiple arguments, so I can't do a2dissite `ls /etc/apache2/sites-enabled` Should I use find? Is it safe to manually delete the symlinks in /etc/apache2/sites-enabled? ...

C wrapper to remove users on command "ps"

I have one question maybe someone here can help me. If i do "ps aux --sort user" on linux console I have one list of users and their processes runing on the machine. My question is how do I remove the users name and print that list like this in a C program: for example: (…) --------------------------------------------------------------...

How do I stop visitors directly accessing the directories in my website?

I have a (Wordpress powered) website, and Google is indexing some of the sub-directories. How can I stop Apache from showing users the directory listing? I know I can edit .htaccess to password-protect a directory, but I would prefer a 403 / custom redirect if possible. ...

Uninitialized string offset error from PHP import script

I have an import-from-excel script as part of a CMS that previously ran without issue. My shared-hosting provider has recently upgraded their infrastructure, including PHP from 5.1 to 5.2.6, and the script now returns "Uninitialized string offset: -XXX in /path/scriptname.php on line 27" (XXX being a decreasing number from 512 and /path...

Prevent direct access to a PHP page.

How do I prevent my users from accessing directly pages meant for ajax calls only? Passing a key during ajax call seems like a solution, whereas access without the key will not be processed. But it is also easy to fabricate the key, no? Curse of View Source... p/s: Using Apache as webserver. EDIT: To answer why, I have jQuery ui-tabs ...

Apache: Caching a DEFLATE'd file.

It seems redundant to have zlib compress a web page during every request. It is also the bottleneck of my files' response times. Is there a way to cache the zlib'd file so that it is compressed only once at each modification? Or should I just keep wishing? ...

Mongrel cluster and multi-applications problem

Hi, we're running in this issue. We're using a web service (using soap4r) to run some kind of searches and the problem appears when the webservice server is down and our aplication is trying to connect to it. At that point the application is unreachable, and all the customers are blocked. What can we do to avoid that? Is possibile to ...

PHP's file_get_contents not returning until remote servers' keep-alive limit is exceeded

From one apache server file_get_contents returns the contents of a url straight away. On another apache server file_get contents won't return the contents of the same url until the keep-alive limit of the server hosting that url has been expired. The 2 php servers are retrieving the same url but through different network routes. What ...

Is there a difference between installing mod_python via httpd.conf and conf.d in apache?

I am working with a hosting provider who has installed mod_python for me. I followed the install instructions locally and included it in httpd.conf but they have opted to put it in conf.d/python.conf. Is there any difference/benefit to doing it either way? ...

Can I run LAMP and Rails from the same Apache instance?

We have a RedHat box with Apache2, PHP5 and MySQL 5 for much of our development. Now, we have a Rails client, and we need to set up a Rails app on the same server. Can we install Ruby and the Rails framework with the same Apache, or should we avoid this? Why or Why not? Is it possible to direct subdomains to either PHP or Ruby in the ind...

Apache - mod_rewrite RewriteRule question

I have a few problems with my mod_rewrite rules. There a three different url pattern I want to handle. http://example.com/%module%/%view%-%args%.html http://example.com/%module%/%view%.html http://example.com/%module% The following mod_rewrite rules don't really work. Also I've the problem that the query (example: user.html?foo=bar) ...

Apache - Reverse Proxy and HTTP 302 status messsage

My team is trying to setup an Apache reverse proxy from a customer's site into one of our web applications. http://www.example.com/app1/some-path maps to http://internal1.example.com/some-path Inside our application we use struts and have redirect = true set on certain actions in order to provide certain functionality. The 302 status...

Why is Apache executing .php.html files as PHP?

I have an odd problem...I'm using a documentation generator which generates a lot of output like docs/foo.php.html. It's XHTML, and thus contains <?xml...> tags at the beginning of file. The problem is, Apache has somehow decided to run it through the PHP interpreter, even though ".php" appears in the middle of the filename, and not at t...

Easiest way to front Weblogic 9.2 with apache 2.x

I want to put Apache 2.2.9 in front of a Weblogic 9.2 server on Windows XP. What does it take to do that ? I probably need mod_proxy on the apache side ? As far as Weblogic and apache are concerned, is there something similar to mod_jk ? I would like this setup so that I can introduce some filtering later on. But for now, the goal is...

How do I fix "ssl handshake failed" with ApacheBench?

When I use ApacheBench to test https, the error is returned, "ssl handshake failed". How can I use ApacheBench to test https? ...

Apache + mod_lisp + clisp

How to to configure apache + mod_lisp + clisp and set up a "Hello World!"? I couldn't find any complete howto on the subject. Thanks. Edit: Vebjorn's solution works, but then I don't how to code the "hello world!". Can anyone tell me how to proceed? There's something like SWANKing the clisp, then connect to it with SLIME, but then when ...

Apache htaccess on Win2k is not being processed

I am trying to rewrite URLs using mod_rewrite. It is enabled in httpd.conf and url rewriting works if the lines are in the httpd.conf file. However, I would like the rules to be in the .htaccess file. It doesn't appear that .htaccess is being processed at all by Apache on Win2k. I have ReWriteLogging turned all the way up, but the log...