apache2

How to config Apache2 to redirect URL

可紊 提交于 2019-12-21 17:11:12
问题 I am trying to config url redirect in Apache. I have tried some approaches and nothing works. Can someone tell me the solution of this as it doesn't seem too difficult. I am going to redirect request from: https://myhost/configuration/jmx-console to: http://myanohterhost/jmx-console This is a https to http re-direct. Can someone point me to the right direction? Many thanks! 回答1: You could use the RedirectMatch directive to force Apache to send the user someplace else: RedirectMatch 301 ^(.*)$

Redirect domain IIS to Apache

谁说胖子不能爱 提交于 2019-12-21 15:02:13
问题 IIS Server is listening Port 80 and Apache is listening 8080 I deployed website on apache. Domain name is registered on IIS server. How can I redirect to a call from IIS to Apache server . Like if I type www.abc.com (on IIS), it will redirect call to website on Apache server (on port 8080 ) How can I do that? 回答1: You need to setup a reverse proxy on IIS and point it to the apache server. Here is a blog post about how to set it up: http://blogs.iis.net/carlosag/archive/2010/04/01/setting-up-a

symfony: setHttpHeader() doesn't work, header() does

旧巷老猫 提交于 2019-12-21 13:08:07
问题 I built a simple action in symfony which generates a PDF-file via wkhtmltopdf and outputs it to the browser. Here's the code: $response = $this->getResponse(); $response->setContentType('application/pdf'); $response->setHttpHeader('Content-Disposition', "attachment; filename=filename.pdf"); $response->setHttpHeader('Content-Length', filesize($file)); $response->sendHttpHeaders(); $response->setContent(file_get_contents($file)); return sfView::NONE; That works fine in my local development

Redirect tomcat to maintenance page when down

爷,独闯天下 提交于 2019-12-21 12:14:35
问题 I'm using tomcat6 with mod_jk setup(both running at port 80) on ubuntu9.10 and 8.10 servers. I deploy war files under /usr/share/tomcat/webapps. During deployment, as I restart the tomcat, I will get the following page when the tomcat application is accessed on the browser: Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Apache/2.2.11 (Ubuntu) mod_jk/1.2.15 Server at 192.168.2.54

How to set the PHP include path via .htaccess?

妖精的绣舞 提交于 2019-12-21 09:14:48
问题 I want to set the PHP include path to another directory. I tried putting this in an .htaccess file, but that didn't work. The only thing I see is the include path's I set in httpd.conf, but not the one I tried to add. <IfModule mod_php5.c> php_value include_path ".:/var/www/mywebsite/" </IfModule> What am I doing wrong? I did a2enmod mod_php5 , but it was already running, so I suppose PHP5 is already running as Apache module. [EDIT] In my vhost config I have this: <Directory ~ "^/var/www/.*">

How to disable 301 redirect that adds trailing slash to directory name in Apache

雨燕双飞 提交于 2019-12-21 07:59:11
问题 The Apache 2.2.20 automaticaly redirects all requests which are points to directories and has no trailing slash to the same URL with trailing slash, like shown below: GET /some/path/to/dir HTTP/1.1 Host: www.some.org ... 301 Moved permanently Location: http://www.some.org/some/path/to/dir/ In all cases it is a fine behavior, but I need to turn off this feature for one special folder (not for all), and can't find were I can do it. Searching for 'Rewrite' rules tells founds nothing - only

Apache fails to start on Vagrant

不打扰是莪最后的温柔 提交于 2019-12-21 07:14:46
问题 In my Vagrant environment I have a guest Ubuntu Virtualbox with a LAMP with default settings. I have my source code on the host machine in the same folder as my Vagrantfile. So on the guest Ubuntu I can access the files in the mounted /vagrant dir like this /vagrant /mysite /index.php /Vagrantfile Now in my Apache config I add a line Alias /mysite /vagrant/mysite After reloading config and restarting apache I can go to localhost:8558/mysite/index.php and it works. The problem is that when I

Python urllib.request and utf8 decoding question

╄→гoц情女王★ 提交于 2019-12-21 06:18:05
问题 I'm writing a simple Python CGI script that grabs a webpage and displays the HTML file in the web browser (acting like a proxy). Here is the script: #!/usr/bin/env python3.0 import urllib.request site = "http://reddit.com/" site = urllib.request.urlopen(site) site = site.read() site = site.decode('utf8') print("Content-type: text/html\n\n") print(site) This script works fine when run from the command line, but when it gets to viewing it with a web browser, it shows a blank page. Here is the

How to configure multiple Virtual Hosts on AWS EC2 Running Ubuntu? [closed]

百般思念 提交于 2019-12-21 05:18:05
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . I'm trying to configure a virtual host to my EC2 instance. I'm using ubuntu on my EC2 instance and apache2 as web server. I have 3 applications (web-based) in 3 different folders in /var/www: - /var/www/app_A - /var/www/app_B - /var/www/mywebsite I want people to only be able to access app_A and app_B using IP

htaccess block access to directory but allow access to files

与世无争的帅哥 提交于 2019-12-21 05:07:32
问题 I have such situation. I'm developing application in Zend Framework and htaccess pointing every request to index.php. If some file or directory exists on the request path then htaccess allow access to this files like css, js, images etc... Now I have for example such link: example.com/profile/martin-slicker-i231 With Zend Router it points to controller account and action viewprofile. I want to add some avatart for my users and I created directory in public folder (so the images would be