$ service apache2 restart [fail]

I have installed Apache on my Ubuntu Server. For a special reason I have to enable mod_rewrite on it. So I have done this.

And in every Tutorial on the internet the last command is to restart apache. But when I do this the console prints [fail].

Can anyone help me here?

$ service apache2 restart 
 * Restarting web server apache2      [fail] 

phpMyAdmin EXTREMELY slow when loading innoDB database main page

Preamble:

Hi, my name is Unfaiir, not because I'm an Unfaiir person, but because that's my name. This is my first question ever on a Stack Exchange site and I wonder if its even worthy, but I'm asking anyway! Haters beware, I will hate back! Lovers, I love you too :)

Oh and don't give annoying replies like, "you spelled (such and such) wrong, or... why don't you just not use "MySQL" or "phpMyAdmin"... that's just lame and it just makes you look like you have no idea what the answer is but still want to seem smart so you reply with useless information completely ignoring the actual question... but guess what... you achieve the opposite results.. you look dumb.. anyway... I'm going to post this question despite all the hate I've seen and hope for the best! Give me love fellow nerds!

My Problem I am Having:

I load the database page for one of my innoDB databases from within phpMyAdmin and it loads EXTREMELY slow. We're talking like up to 5 minutes of load time. This only happens on the MAIN page, meaning, when you view the database and the left sidebar that shows all the tables shows up.

After that initial load time, each individual table can be clicked on and load almost immediately. But those tables are loaded in an iframe without reloading the left sidebar of database tables which is why they load so quickly.

After that initial load time, each individual table can be opened in a new tab/window immediately, but doing it that way does not include the left sidebar of database tables, which I am sure is the reason they load so quickly.

What I Expect To Be Happening:

I expect to be able to load the main page of my innoDB database from within phpMyAdmin without it taking 5 minutes to load.

What I've tried:

I've had this issue for months and it drives me crazy every day. I've come to live with it actually. I simply load that initial page immediately every day, and go do something else so i don't have to watch it, because it just makes me angry.

I have my timeout set to about 15 minutes, so if I think its been longer than 10 minutes, I will open where it says "localhost" in a different tab, which brings me to the login screen, log back in, and then it brings me to the list of databases, which loads quickly. This is because if I simply load that main page, then log in, it will bring me back to that index page and i'll wait another 5 minutes for it to load. Grr..

OK so, I Googled and Googled and found tons of suggestions about making innoDB not do row counts and stuff like that. I've tried all of them. Nothing is working! :(

I found something called "$cfg['Server']['IgnoreSomeISrows'] = true;" which did not help whatsoever. I don't even know what it did, but it didn't work, so I removed it, but I forgot to remove that part and so I just left it there. No, commenting it out does not help either thank you.

Conclusion:

So now you have some idea of the bane of my existence. Will you help me or will you mock my suffering? I hope you will help! :)

Some Version Info:

OS

CentOS release 6.5 (Final)

Database:

Server: Localhost via UNIX socket
Software: MySQL
Software version: 5.1.71-log - Source distribution
Protocol version: 10

Web Server

Apache/2.2.15 (CentOS)
Database client version: libmysql - 5.1.71
PHP extension: mysqli Documentation

phpMyAdmin

Version information: 3.5.8.2, latest stable version: 4.1.5

Apache: "AuthType not set!" 500 Error

It's been a while since I used the Apache httpd web server. I'm firing up a local server for a project and when I try to request localhost/index.html, I get a 500 error and I see this in the error log:

[Tue Jan 21 09:23:58 2014] [crit] [client ::1] configuration error:  couldn't perform authentication. AuthType not set!: /index.html
[Tue Jan 21 09:23:58 2014] [error] an unknown filter was not added: DEFLATE
[Tue Jan 21 09:23:58 2014] [crit] [client ::1] configuration error:  couldn't perform authentication. AuthType not set!: /favicon.ico

It looks like there are possibly 2 errors here in the apache config, one related to "AuthType not set!" and possibly another related to "filter was not added: DEFLATE". I dont know what these means or where to start digging in.

A basic Google search revealed this link which indicates that the culprit may be "Require all granted". This line in my httpd.conf may be involved.

<Directory "/var/www">
    AllowOverride None
    # Allow open access:
    Require all granted
</Directory>

This apache config is mostly what is used in production for this project, so I know this works, just not currently on my workstation. What does this mean and what should I try next? I did try commenting out "Require all granted" and restarting apache but to no avail.

Following this SO question I also loaded mod_authz_host

LoadModule authz_host_module modules/mod_authz_host.so

and added "Allow from all", restarted the server,. but the issue persists. The deflate issue appears to be unrelated, and was easily solved by adding

LoadModule deflate_module modules/mod_deflate.so

The question remains, how do I solve this 500 error?

[Tue Jan 21 09:44:20 2014] [crit] [client ::1] 
configuration error:  couldn't perform authentication. 
AuthType not set!: /index.html

php-sha3 not working since upgrade to 5.4

I upgraded my PHP installation to:

 PHP Version 5.4.23-1+sury.org~precise+1

It broke my install of https://github.com/strawbrary/php-sha3. I tried to recompile it, but had no luck. I have the file linked in my php.ini file. My phpinfo() is not showing any sign that sha3 is installed.

When I run phpize on the server when compiling sha3 I get:

Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

However when I look at my phpinfo file I get:

PHP API         20100412
PHP Extension   20100525
Zend Extension  220100525

Here is how I recompiled the plugin:

    [email protected]:/# git clone https://github.com/strawbrary/php-sha3
Cloning into 'php-sha3'...
remote: Reusing existing pack: 42, done.
remote: Total 42 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (42/42), done.
[email protected]:/# cd php-sha3/
[email protected]:/php-sha3# phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
[email protected]:/php-sha3# ./configure --enable-sha3
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20090626+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking Whether to enable SHA3 support... yes, shared
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
[email protected]:/php-sha3# make
/bin/bash /php-sha3/libtool --mode=compile cc  -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/php_sha3.c -o php_sha3.lo 
libtool: compile:  cc -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/php_sha3.c  -fPIC -DPIC -o .libs/php_sha3.o
In file included from /usr/include/php5/main/php.h:33:0,
                 from /php-sha3/php_sha3.c:5:
/usr/include/php5/main/php_config.h:2126:0: warning: "PACKAGE_NAME" redefined [enabled by default]
/php-sha3/config.h:48:0: note: this is the location of the previous definition
/usr/include/php5/main/php_config.h:2138:0: warning: "PACKAGE_VERSION" redefined [enabled by default]
/php-sha3/config.h:60:0: note: this is the location of the previous definition
In file included from /usr/include/php5/ext/hash/php_hash_types.h:25:0,
                 from /usr/include/php5/ext/hash/php_hash.h:25,
                 from /php-sha3/php_sha3.c:7:
./config.h:48:0: warning: "PACKAGE_NAME" redefined [enabled by default]
/usr/include/php5/main/../main/php_config.h:2126:0: note: this is the location of the previous definition
./config.h:60:0: warning: "PACKAGE_VERSION" redefined [enabled by default]
/usr/include/php5/main/../main/php_config.h:2138:0: note: this is the location of the previous definition
/bin/bash /php-sha3/libtool --mode=compile cc  -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/KeccakNISTInterface.c -o KeccakNISTInterface.lo 
libtool: compile:  cc -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/KeccakNISTInterface.c  -fPIC -DPIC -o .libs/KeccakNISTInterface.o
/bin/bash /php-sha3/libtool --mode=compile cc  -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/KeccakSponge.c -o KeccakSponge.lo 
libtool: compile:  cc -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/KeccakSponge.c  -fPIC -DPIC -o .libs/KeccakSponge.o
/bin/bash /php-sha3/libtool --mode=compile cc  -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/KeccakF-1600-opt64.c -o KeccakF-1600-opt64.lo 
ILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/KeccakF-1600-opt64.c -o KeccakF-1600-opt64.lo 
libtool: compile:  cc -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/KeccakF-1600-opt64.c  -fPIC -DPIC -o .libs/KeccakF-1600-opt64.o
r/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/KeccakF-1600-opt64.c  -fPIC -DPIC -o .libs/KeccakF-1600-opt64.o
/bin/bash /php-sha3/libtool --mode=link cc -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -o sha3.la -export-dynamic -avoid-version -prefer-pic -module -rpath /php-sha3/modules  php_sha3.lo KeccakNISTInterface.lo KeccakSponge.lo KeccakF-1600-opt64.lo 
libtool: link: cc -shared  -fPIC -DPIC  .libs/php_sha3.o .libs/KeccakNISTInterface.o .libs/KeccakSponge.o .libs/KeccakF-1600-opt64.o    -O2   -Wl,-soname -Wl,sha3.so -o .libs/sha3.so
libtool: link: ( cd ".libs" && rm -f "sha3.la" && ln -s "../sha3.la" "sha3.la" )
/bin/bash /php-sha3/libtool --mode=install cp ./sha3.la /php-sha3/modules
libtool: install: cp ./.libs/sha3.so /php-sha3/modules/sha3.so
libtool: install: cp ./.libs/sha3.lai /php-sha3/modules/sha3.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /php-sha3/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /php-sha3/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

[email protected]:/php-sha3# make install
Installing shared extensions:     /usr/lib/php5/20090626+lfs/
[email protected]:/php-sha3# sudo apachectl restart

Redmine 2.4.2 served via Apache mod_fcgid returns Error 500

I'm trying to upgrade Redmine from v 2.3.1 to v 2.4.2 maintaining the same configuration for serving it: Apache with mod_fcgi.

My configuration is the following:

Environment:

  • Redmine version 2.4.2.stable
  • Ruby version 1.8.7-p358 (2012-02-08) [x86_64-linux]
  • Rails version 3.2.16
  • Environment production
  • Database adapter Mysql2

Debian 7.3 with Apache 2.2.22-13. I've tested redmine via webrick without any problem, but I can't make it works via fastcgi.

dispatch.fcgi:

#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../config/boot'
require File.dirname(__FILE__) + '/../config/environment'

class Rack::PathInfoRewriter
  def initialize(app)
    @app = app
  end

  def call(env)
    env.delete('SCRIPT_NAME')
    parts = env['REQUEST_URI'].split('?')
    env['PATH_INFO'] = parts[0]
    env['QUERY_STRING'] = parts[1].to_s
    @app.call(env)
  end
end

Rack::Handler::FastCGI.run Rack::PathInfoRewriter.new(RedmineApp::Application)

Any help will be really appreciated.

Is it possible to deny access to domains that link using specific anchor text (using .htaccess / or something else)?

Using .htaccess -- is it possible to deny access to a website that uses a specific anchor text to link to your website?

Assume a bad website: SomeBadWebsite.org/hate.php posted a link to my website using the anchor text: 'I Hate You'. So the code used on SomeBadWebsite.org/hate.php to link to my site is:

<a href="http://MyWebsite.com">I Hate You</a>

NOTES:

  • Please note that I only need to block this specific anchor text (I Hate You) and if the same SomeBadWebsite.org links to my website using any other anchor text, the link should not be denied.

  • It would be best when the anchor text ignores capitalization (ie. I Hate You = i HATE you etc.).

I think .htaccess could/should use RewriteCond and HTTP_REFERER + something to check for the specific anchor text -- but I don't know the exact code.

ADDED:

If it's not possible using .htaccess - is there any other good and easy way to achieve the goal?

How do I use Spring Boot to serve static content located in Dropbox folder?

I have a Spring Boot web application, and I would like to serve static content located in a shared Dropbox directory on my Linode VPS (~/Dropbox/images). I've read that Spring Boot will automatically serve static content from

"classpath:/META-INF/resources/",
"classpath:/resources/",
"classpath:/static/",
"classpath:/public/",

but of course my Dropbox directory is not on the classpath.

Although I could configure Apache to serve the images in my Dropbox folder, I would like to take advantage of Spring Security to restrict access of the static content to authenticated users.

Apache says Error opening file for reading: Permission Denied

I am trying to run a django (1.6) project with apache (2.2.22) and mod_wsgi (3.4). My python is 2.7.3, the ubuntu 12.04 default. I have set everything as chmod 777 from /var/www to downwards. Unfortunately it gives me

Error opening file for reading: Permission Denied and then Premature end of script headers: wsgi.py

can anybody tell me what I am doing wrong? I am posting my error.log here

[email protected]:/var/www/Imse_dev2/Imse/Imse# tail -f /var/log/apache2/error.log 
[Tue Jan 14 14:16:04 2014] [notice] caught SIGTERM, shutting down
[Tue Jan 14 14:16:08 2014] [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.4 Python/2.7.3      configured -- resuming normal operations
[Tue Jan 14 14:16:28 2014] [error] /var/www/Imse_dev2/Imse
Error opening file for reading: Permission denied
[Tue Jan 14 14:21:32 2014] [error] [client 127.0.0.1] Premature end of script headers:   wsgi.py
[Tue Jan 14 14:29:13 2014] [notice] caught SIGTERM, shutting down
[Tue Jan 14 14:29:13 2014] [notice] Apache/2.2.22 (Ubuntu) mod_wsgi/3.4 Python/2.7.3  configured -- resuming normal operations
[Tue Jan 14 14:29:17 2014] [error] /var/www/Imse_dev2/Imse
Error opening file for reading: Permission denied
[Tue Jan 14 14:34:21 2014] [error] [client 127.0.0.1] Premature end of script headers:  wsgi.py

And also my httpd.conf file

#LimitRequestLine 200475
#LimitRequestFieldSize 200475

WSGIDaemonProcess imse_dev2_wsgi python-path=/var/www/Imse_dev2/Imse/Imse


#LoadModule deflate_module modules/mod_deflate.so
#LoadModule headers_module modules/mod_headers.so

<VirtualHost *:80>
    ServerName whq-4
    DocumentRoot /var/www/
    #Header set Access-Control-Allow-Origin "*"
    Alias /static /var/www/Imse_dev2/Imse/static
    Alias /favicon.ico /var/www/favicon.ico
#       Header set Access-Control-Allow-Origin "*"


    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>


    WSGIScriptAlias /imse_dev2 /var/www/Imse_dev2/Imse/Imse/wsgi.py
    <Directory /var/www/Imse_dev2/Imse/Imse>
            WSGIProcessGroup imse_dev2_wsgi
            <Files wsgi.py>
                    Order deny,allow
                    Allow from all
            </Files>
    </Directory>

    <IfModule mod_headers.c>
             Header set Access-Control-Allow-Origin "*"
    </IfModule>

</VirtualHost>

apache and nodejs proxy

I want nodejs to work together with apache.

I try to edit the httpd of apache, like so

 <VirtualHost *:80>
   ServerAdmin [email protected]
    ServerName www.myserver.net

    ProxyRequests off

   <Proxy *>
        Order deny,allow
        Allow from all
  </Proxy>

  <Location />
        ProxyPass http://localhost:8000/
        ProxyPassReverse http://localhost:8000/
   </Location>
</VirtualHost>

I see the above method in many blogs and also here in SO. I saved, I restarted apache and I get

502 Proxy Error
Proxy Error

The proxy server received an invalid response from an upstream server.
 The proxy server could not handle the request GET /mysite/index.php.

Reason: Error reading from remote server

What is wrong with this method?

Excuse my ignorance, I dont know how to solve this.

Here is the part of node server, where I set a server...

"use strict";
var WebSocketServer = require('websocket').server;
var http = require('http');
var pg = require('pg');


var server = http.createServer(function(request, response) {
    console.log((new Date()) + ' Received request for ' + request.url);
    response.writeHead(200, {'Content-Type': 'text/html'});
    response.end(clientHtml);
});
server.listen(8000, function() {
    console.log((new Date()) + ' Server is listening on port 8000');
});

var wsServer = new WebSocketServer({
    httpServer: server,
    autoAcceptConnections: false
});

function originIsAllowed(origin) {
  return true;
}
//FALLBACKING FOR WEBSOCKETS
var pf = require('policyfile').createServer();
pf.listen( server, function(){
  console.log(':3 yay')
});
//STOPS HERE

wsServer.on('request', function(request) {
    if (!originIsAllowed(request.origin)) {
      request.reject(); 
      console.log((new Date()) + ' Connection from origin ' + request.origin + ' rejected.');
      return;
    }

//////////////


//prepare things to distinguish connections
var connections = {};
var connectionIDCounter = 0;
var connection = request.accept(null, request.origin);

// Store a reference to the connection using an incrementing ID
connection.id = connectionIDCounter ++;
connections[connection.id] = connection;

console.log((new Date()) + ' Connection accepted.');

apache and nodejs proxy

I want nodejs to work together with apache.

I try to edit the httpd of apache, like so

 <VirtualHost *:80>
   ServerAdmin [email protected]
    ServerName www.myserver.net

    ProxyRequests off

   <Proxy *>
        Order deny,allow
        Allow from all
  </Proxy>

  <Location />
        ProxyPass http://localhost:8000/
        ProxyPassReverse http://localhost:8000/
   </Location>
</VirtualHost>

I see the above method in many blogs and also here in SO. I saved, I restarted apache and I get

502 Proxy Error
Proxy Error

The proxy server received an invalid response from an upstream server.
 The proxy server could not handle the request GET /mysite/index.php.

Reason: Error reading from remote server

What is wrong with this method?

Excuse my ignorance, I dont know how to solve this.

Here is the part of node server, where I set a server...

"use strict";
var WebSocketServer = require('websocket').server;
var http = require('http');
var pg = require('pg');


var server = http.createServer(function(request, response) {
    console.log((new Date()) + ' Received request for ' + request.url);
    response.writeHead(200, {'Content-Type': 'text/html'});
    response.end(clientHtml);
});
server.listen(8000, function() {
    console.log((new Date()) + ' Server is listening on port 8000');
});

var wsServer = new WebSocketServer({
    httpServer: server,
    autoAcceptConnections: false
});

function originIsAllowed(origin) {
  return true;
}
//FALLBACKING FOR WEBSOCKETS
var pf = require('policyfile').createServer();
pf.listen( server, function(){
  console.log(':3 yay')
});
//STOPS HERE

wsServer.on('request', function(request) {
    if (!originIsAllowed(request.origin)) {
      request.reject(); 
      console.log((new Date()) + ' Connection from origin ' + request.origin + ' rejected.');
      return;
    }

//////////////


//prepare things to distinguish connections
var connections = {};
var connectionIDCounter = 0;
var connection = request.accept(null, request.origin);

// Store a reference to the connection using an incrementing ID
connection.id = connectionIDCounter ++;
connections[connection.id] = connection;

console.log((new Date()) + ' Connection accepted.');