在apache EADDRNOTAVAIL中的Nodejs

时间:2016-06-14 13:23:16

标签: php node.js apache

    root@argenit:/var/www/test.argenit.com.tr/NodeServer# node app.js

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: listen EADDRNOTAVAIL
    at errnoException (net.js:905:11)
    at Server._listen2 (net.js:1024:19)
    at listen (net.js:1065:10)
    at net.js:1147:9
    at asyncCallback (dns.js:68:16)
    at Object.onanswer [as oncomplete] (dns.js:121:9)

/var/www/test.argenit.com.tr/NodeServer/app.js:

"use strict";

var http = require("http");

http.createServer(processRequest).listen(8000, "test.argenit.com.tr");

function processRequest (request, response) {

    response.writeHead(200, {"Content-Type": "text/html"});

    response.write("<b>Node.JS'den</b> sevgilerle...");

    response.end();

}

/ etc / apache2 / sites-available / default:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/Argenit
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
<VirtualHost *:80>
     ServerAdmin webmaster@localhost
      DocumentRoot /var/www/test.argenit.com.tr

       ProxyRequests off

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

    <Location />
        ProxyPass http://localhost:8000/
        ProxyPassReverse http://localhost:8000/
    </Location>
</VirtualHost>
<VirtualHost *:80>
    ServerName easypath.argenit.com.tr
    DocumentRoot /var/www/easypath.argenit.com.tr
</VirtualHost>
<VirtualHost *:80>
    ServerName test.argenit.com.tr
    DocumentRoot /var/www/test.argenit.com.tr
</VirtualHost>

我想在test.argenit.com.tr子域下运行nodejs。我写了一个用Nodejs写的实时聊天模块,我想导入我的php项目。

但我无法成功。

我尝试了代理传递: Running Node.js in apache? Apache and Node.js on the Same Server

0 个答案:

没有答案