Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot serve any host files #137

Closed
Ulaxidor opened this issue May 17, 2016 · 5 comments
Closed

Cannot serve any host files #137

Ulaxidor opened this issue May 17, 2016 · 5 comments

Comments

@Ulaxidor
Copy link

Ulaxidor commented May 17, 2016

After installing nginx version 1.10.0, I moved my default nginx directory and replaced it with the one from the h5bp/server-configs-nginx git hub repository. After doing this I can not serve ANY host files at all because no matter how simple the host file, the ports are all closed. The host files should instruct nginx to listen to port 80 for example, but I get nothing. I have tried many fresh installs and I do not have any firewalls up at all. I’ve tried installing a firewall and directing it to open ports 80 and 443 explicitly but even that doesn’t work. No matter what, when I use the h5bp/server-configs-nginx git hub repository nginx, I can not serve any host files. However if I move that nginx directory and replace it with my original nginx directory I can serve host files and ports 80 and 443 are open once again. What am I doing wrong? Any help would be greatly appreciated!

I am on a 4 core vps with 2gigs of ram running ubuntu 14.04.

@pentago
Copy link
Contributor

pentago commented May 17, 2016

Explain exactly what did you do because you didn't supposed to "move" anything anywhere, just merge config sections you actually need.

@quantumpacket
Copy link
Contributor

When you run netstat -tap from a shell, do you see listening ports for 80/443? If not then it's nothing to do with a firewall, but the fact the hosts are not listening at all.

@Ulaxidor
Copy link
Author

@pentago
Thanks for the reply! I cloned the h5bp server config repository via " git clone git@github.com:h5bp/server-configs-nginx.git /etc/nginx "
So rather than use the nginx directory that was already present during my initial installation of nginx, I moved it and replaced it with the contents of the h5bp server config repository. Are you suggesting I merge the two directories, and replace any default files with the ones that come with the h5bp repository?

@Ulaxidor
Copy link
Author

@quantumpacket
Thanks for the reply! The server does not listen to either ports 80 or 443. An "nmap localhost" confirmed the netstat -tap results, which is that despite there being a proper host file, the server did not listen on either port. I've tried many host files, and no matter how simple, none have worked using the method of installation I outlined above. I will try merging both nginx directories.

@AD7six
Copy link
Member

AD7six commented Jun 8, 2016

What am I doing wrong?

Well, it seems obvious that nginx isn't starting. Step 0 when debugging anything is to look at the log output e.g.:

root@vagrant:/etc/nginx/sites-enabled# /etc/init.d/nginx reload
 * Reloading nginx configuration nginx                                                                                                       [fail] 
root@vagrant:/etc/nginx/sites-enabled# nginx -t
nginx: [emerg] unknown directive "del" in /etc/nginx/sites-enabled/no-default:2 
nginx: configuration file /etc/nginx/nginx.conf test failed
root@vagrant:/etc/nginx/sites-enabled# 

Closing as this repo isn't intended to be a replacement for nginx docs or a general nginx support mechanism.

Thanks!

@AD7six AD7six closed this as completed Jun 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants