apache2

socket.io https proxy config for apache2

Deadly 提交于 2020-03-25 12:30:26
问题 I have a working socket.io setup with a JavaScript-client and a python-server. The client is basically just one line: Error during WebSocket handshake: Unexpected response code: 404 socket = io.connect(''); The server script can be found at https://github.com/miguelgrinberg/python-socketio/blob/master/examples/server/wsgi/app.py - I'm running the server on port 5000. All you probably have to know about client and server is that they work great on my localhost apache installation and that

debian7.8安装LAMP+Redis

自古美人都是妖i 提交于 2020-03-23 16:35:01
3 月,跳不动了?>>> 1、安装apache2+mysql5.5+php5 sudo apt-get install mysql-server-5.5 sudo apt-get install apache2 sudo apt-get install php5 php5-mysql sudo apt-get install libapache2-mod-php5 vi /var/www/index.html <!DOCTYPE html> <html> <body> <?php echo "My first PHP script!"; ?> </body> </html> 浏览器打开 http://localhost/index.php 看到内容: My first PHP script! ,说明apahe2和php已安装成功。 测试php脚本中是否能连接mysql shen@debian:/var/www/shm_fast$ cat connect-mysql.php <?php $servername = "localhost"; $username = "root"; $password = "123456"; // 创建连接 $conn = mysqli_connect($servername, $username, $password); // 检测连接 if (!

How to block an ip address in httpd.conf [duplicate]

假如想象 提交于 2020-03-05 03:06:07
问题 This question already has answers here : Apache block an ip address from accessing the website (2 answers) Blocking multiple ip ranges using mod access in htaccess (1 answer) Closed 4 months ago . My website was hit by a few ip's continuously sending bad requests with some garbled parameters causing a large amount of error output in log file. At a peak the attack could reach 6000-7000 hits an hour. I am trying to block these ip's in httpd.conf file. There were two questions answered, but both

kali linux 启动Apache的相关配置-log file位置

≡放荡痞女 提交于 2020-03-01 14:57:14
You need to change the DocumentRoot setting in your httpd.conf file. Chances are it will be under something like /etc/apache2/conf/httpd.conf In my Ubuntu 14.04 LTS and kali2 linux , the document root was set to /var/www/html . It was configured in the following file: /etc/apache2/sites-available/000-default.conf So just do a sudo nano /etc/apache2/sites-available/000-default.conf http://stackoverflow.com/questions/5891802/how-do-i-change-the-root-directory-of-an-apache-server Apache log file 位置 By default, /var/log/apache2/error.log . This can be configured in /etc/php5/apache2/php.ini . http

URL Rewriting doesn't seem to work. Apache2

自古美人都是妖i 提交于 2020-02-27 22:54:12
问题 I would like it so that when the user goes to http://mysite.com/home that it redirects him to http://mysite.com/page.php?id=home . This is what I put in my .htaccess, but it doesn't seem to work. RewriteEngine On RewriteRule ^/(.+)$ page.php?id=$1 [NC,L] It just sends me to the /home directory, with a nice 404. Help is appreciated. Thanks. Edit: I've tried some rewrite I know work, so now I'm certain it's not that my problem. I checked with phpinfo() and yes, mod rewrite is running, I set up

URL Rewriting doesn't seem to work. Apache2

雨燕双飞 提交于 2020-02-27 22:54:08
问题 I would like it so that when the user goes to http://mysite.com/home that it redirects him to http://mysite.com/page.php?id=home . This is what I put in my .htaccess, but it doesn't seem to work. RewriteEngine On RewriteRule ^/(.+)$ page.php?id=$1 [NC,L] It just sends me to the /home directory, with a nice 404. Help is appreciated. Thanks. Edit: I've tried some rewrite I know work, so now I'm certain it's not that my problem. I checked with phpinfo() and yes, mod rewrite is running, I set up

Standard 401 response when using HTTP auth in flask

大城市里の小女人 提交于 2020-02-17 22:31:09
问题 In flask, I'm using the following snippet to enable HTTP auth: def authenticate(): return Response('<Why access is denied string goes here...>', 401, {'WWW-Authenticate':'Basic realm="Login Required"'}) Now, in my past experience with Flask, if someone's credentials are incorrect and I want to let them know I can just call: abort(401) This gives you the basic apache 401 response. Does anyone know how I can implement that with the snippet above? Thanks 回答1: Custom error responses are really

Standard 401 response when using HTTP auth in flask

扶醉桌前 提交于 2020-02-17 22:29:47
问题 In flask, I'm using the following snippet to enable HTTP auth: def authenticate(): return Response('<Why access is denied string goes here...>', 401, {'WWW-Authenticate':'Basic realm="Login Required"'}) Now, in my past experience with Flask, if someone's credentials are incorrect and I want to let them know I can just call: abort(401) This gives you the basic apache 401 response. Does anyone know how I can implement that with the snippet above? Thanks 回答1: Custom error responses are really

Apache & Tomcat: ProxyPass and ProxyPassReverse

醉酒当歌 提交于 2020-01-30 14:36:29
问题 I'am having troubles configuring Apache and Tomcat, this is the scenario: I have an Apache Web Server, running and working normally, I can access to this one just typing: http://localhost Also, in this host, I have a Tomcat running and working fine; I've created a mini web-app which files are inside "prueba" directory, I can access typing: http://localhost:8080/prueba (I know that Apache is running in 80 port and Tomcat in 8080) What I want to do is that througt Apache an user can access to

Action '-D FOREGROUND' failed. while building apache2 image with docker

廉价感情. 提交于 2020-01-25 11:21:06
问题 I'm trying to build apache image , with apache config which will set up a Virtual host and eventually will Redirect all non-static requests to Unicorn. But while building the image it's failing with the error. Action '-D FOREGROUND' failed i followed a tutorial for this purpose and added the virtual host below in my apache2.conf file <VirtualHost *:80> ServerName test.example.com DocumentRoot /var/www/app/public RewriteEngine On # Redirect all non-static requests to unicorn RewriteCond %