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