doutao1171 2016-06-14 13:23
浏览 26

在apache EADDRNOTAVAIL中的Nodejs

    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>

I want to run nodejs under test.argenit.com.tr subdomain. I wrote a realtime chat module writing with Nodejs and i want to import my php project.

But i couldnt succeed.

I tried proxy pass : Running Node.js in apache? Apache and Node.js on the Same Server

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图