apache

Run a shell command from Django

Hello, I'm developing a web page in Django (using apache server) that needs to call a shell command to enable/dissable some daemons. I'm try to do it with os.system(service httpd restart 1>$HOME/out 2>$HOME/error) and this command doesn't return anything. Any idea how can i fix this? ...

PHP header Location works in the middle of HTML

Hello. I'm having problems understanding how a header("Location: http://www.google.com/"); can work in the middle of a HTML page's <body>. Shouldn't there be an error since the header has already been sent due to the HTML output, way before the <?php ... ?> part started. I'm referring to the warning Cannot modify header information - h...

Redirect for .htaccess Wildcard Subdomains

Hello, I've been trying to figure out a way to redirect requests for wildcard subdomains to a specific folder ( called 'core' ) and calling the requested page/file from that specific folder. For example, making all calls to -http://johnny5.mysite.net redirect to -http://mysite.net/core/, or -http://docholliday.mysite.net/login.php redir...

How does one suppress a 404 status code in a WordPress page?

I've got a WordPress site that includes pages pulled from a different database. The problem is that these other pages return a 404 status code. (The WordPress posts/pages are fine.) The 404'ed pages display fine, and I removed the "Page not Found" text from the title tag in WordPress. But Googlebot and W3C see the 404 header. So: wow d...

Using PHP with the default Mac Apache + PHP installation

Hi, I'm starting to unravel the mysteries of PHP and I configured the pre-installed Snow Leopard PHP and activated the Apache server in the system preferences. So far so good: it works if you put a PHP file in your ~/Sites directory. Since I've my projects in a code/projects directory I created a symbolic link from the ~/Sites dir to t...

"Greater than" and "Lesser than" symbols in URL not working

i, I have the following URL which is successfully handled by an Apache Tomcat application: http://localhost:8080/ApplicationX/FileY/UpdateDocument(`&lt;add location="somewhere">ContentZ</add>`).xml?VIEW=RAW For some reason, when I try to handle the same request in IIS with an ASP.NET Http request handler (Class implementing IHttpHandl...

How do I interpolate values in the TestString portion of an .htaccess RewriteCond?

How do I interpolate values like %{REQUEST_FILENAME} in the TestString part of a RewriteCond directive? Here's what I'm trying to do: # non-existent requests to /webroot files get 404'd RewriteCond site/%{REQUEST_FILENAME} !-f RewriteRule ^/?webroot site/webroot/404 [L] # otherwise, let them in! RewriteRule ^/?webroot/(.*)$ site/webroot...

Snow Leopard mounted directory changes permissions sporadically

I have a smb mounted directory: /Volumes/myshare This was mounted via Finder "Connect to Server..." with smb://myservername/myshare Everything good so far. However, when I try to access the directory via PHP (running under Apache), it fails with permission denied about 10% of the time. By this I mean that repeated accesses to my page...

Apache not handling files correctly (Handler Help)

I'm trying to set up my .htaccess file correctly and I'm having an issue. The only thing my .htaccess file at the moment is: AddType application/x-httpd-php .php .html .htm This is included because my server is not parsing php in my html files. However when this is included in my .htaccess file, when I open a page in my browser, ...

SSL Certificate Mismatch in IE 7+, OK in Firefox 3.6+

Hello, We have a site www.name1.domain.com for which we successfully created and implemented an SSL cert. We then added another site, www.name2.domain.com, and are seeing some strange behaviour in IE7 and IE8 (surprise!). Basically, IE7,8 reports a mismatch of host name when we go to https://www.name2.domain.com/ . When I add and view ...

How can I access password protected Excel workbook in Java using POI api

I want to read from and write to password protected Excel files. How can I do so using Apache POI API. Thank You, ...

Is there any tutorial for beginners on creating basic apache http server extension?

Is there any tutorial for beginners on creating basic apache http server extension? ...

Apache mod rewrite .htaccess problem

My site is a php based site, but I've added wordpress in a /blog/ folder. The .htaccess file below should allow the /blog/ folder to be accessed, but I get a 404 error saying that blog.php doesn't exist. <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !\.(gif|jpg|png)$ RewriteCond %{REQUEST_FILENA...

503 server response for Googlebot

I put an .htaccess file in my webroot with the following contents RewriteBase / RewriteCond %{HTTP_USER_AGENT} ^.*(Googlebot|Googlebot|Mediapartners|Adsbot|Feedfetcher)-?(Google|Image)? [NC] RewriteRule .* /var/www/503.html This website is in maintenance mode, and I don't want anything indexed yet. I tested the code with a firefox Use...

What could be adding "Pragma:no-cache" to my response Headers? (Apache, PHP)

I have a website whose maintenance I've inherited, which is a big hairy mess. One of the things i'm doing is improving performance. Among other things, I'm adding Expires headers to images. Now, there are some images that are served through a PHP file, and I notice that they do have the Expires header, but they also get loaded every tim...

Is there some sort of mechanism in Phusion Passenger to keep whole applications from going down?

Hi there, The following is beginning to become a huge problem for us. We have about 15 Rails applications for our enterprise, running on a massive server. The problem occurs when two or three applications are wildly popular and they start taking up all the instances in the PassengerMaxPoolSize. As soon as that happens, other applicatio...

Shared hosting - domain name changing when running scripts.

Hi, I just pointed newdomain.com to a folder(olddomain.com/folder) on my deluxe hosting account with Godaddy. The olddomain.com/folder has a Wordpress installed in it. When using newdomain.com none of the images show up but work when i access the site from olddomain.com/folder. I notice that when I enter the admin section for the Word...

CakePHP Routing Problem

I suffered a CakePHP Route Problem. I can only access the root "/" and it shows the CakePHP default welcome home page. Later I try to write my controller (icons_controller.php) and views (views/icons/index.ctp), it has problem. I typed in http://localhost:8080/myapp/icons/ It always says "Not Found The requested URL /myapp/icons/ was not...

Problem switching back from forced SSL on certain pages using mod_rewrite

Client wants login pages to load via https. This is easily accomplished, but since the site uses pretty url's, we now stay in https mode when clicking around after login is finished. This breaks secure files which are uploaded in the CMS, stored above webroot, and downloaded by streaming through a php script if user has the appropriate...

How can I prevent a mod_wsgi django application from repeated reloads?

My mod_wsgi django application seems to keep getting reloaded for the first several requests that the client makes. This is killing my performance After enough requests it seems to settle down, and the application no longer seems to be getting reloaded. Any thoughts on why this is happening and how I can prevent it? (I have the followi...