VHost Guidance

Hi folks.

Brand new to nginx. I’m trying to run 3 vhosts on my workstation to get
familiar with nginx.

alpha
bravo
charlie

I’m using bravo in the main nginx.conf pointing to /var/www/alpha/

bravo and charlie are in settings/vhosts.conf into /var/www/bravo and
/var/www/charlie

Upon trying to start nginx (installed via homebrew on OSX), I get the
following:

HQ:~ rich$ sudo nginx
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in
use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in
use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in
use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in
use)
nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in
use)
nginx: [emerg] still could not bind()

Not too sure what that means. I’m sure it’s a directive that’s not
entered
for localhost.

Anyway, any leadership appreciated as to how to get this thing going.

Cheers

Posted at Nginx Forum:

You already have an application listening on port 8080. You can find it
using
netstat(1).

On Monday, April 20, 2015 01:34:51 PM daBee wrote:

nginx: [emerg] bind() to 0.0.0.0:8080 failed (48: Address already in use)
Posted at Nginx Forum:
VHost Guidance


nginx mailing list
[email protected]
nginx Info Page

Best regards,
Styopa S…

Hi there. This is my port scan from 8000 to 8080:

Port Scan has started…

Port Scanning host: 127.0.0.1

Port Scan has completed…

I’ve never set anything up to use that port.

Styopa S. Wrote:

Try port scan your network assigned IP and not 127.0.0.1.

If something listens on 192.168.0.10:8080 for example, which is not
127.0.0.1, it will block requests for listening on “all interfaces”
(0.0.0.0) which Nginx is trying to do, because one or more interface is
in use for that port.

netstat -ln
Will tell you all listening ports and interfaces on most OS and is
always preferred over port scans as its direct information that does not
rely on successful connection that a firewall may block.

Hope it helps

Jason

Hi there.

Tried 192.168.1.4 (hard assigned), 127.0.0.1, localhost and 0.0.0.0:
nothing
shows up.

Tried netstat -ln and nothing showing “8080” in any return.

Jason W. Wrote:

not rely on successful connection that a firewall may block.

Hope it helps

Jason

Posted at Nginx Forum:

OK, thanks for the guidance. I will go have a look. I was using two
texts
that somehow convinced me it was done this way. I’ll read up with the
online documentation.

Cheers

shiroweb Wrote:

making a

Some interesting readings when starting with NginX :
Beginner’s Guide
Nginx Configuration Primer

Posted at Nginx Forum:

Hi, I’m not sure what you did, but nginx.conf file, is only used to
configure the http server, not vhosts.

There is 2 ways to setup vhosts (called server blocs in NginX) :

A. Use the default config file (usually located @
/etc/nginx/sites-available/default) and add all your vhosts there. The
default file is self explanatory

B. You can use a different file for every server bloc (vhost) by making
a
copy of the default file :
/etc/nginx/sites-available/vhost1.tld
/etc/nginx/sites-available/vhos2.tld

I think the conflict you are facing is due to default config file,
delete
the symbolic link found in /etc/nginx/sites-enabled/ folder.

Hope this helps

Some interesting readings when starting with NginX :
http://nginx.org/en/docs/beginners_guide.html

2015-04-20 19:34 GMT+02:00 daBee [email protected]: