ubunto 12.04, nginx, virtualmin configuration and set up errors.

6 posts / 0 new
Last post
#1 Wed, 03/12/2014 - 16:12
grimmwerks

ubunto 12.04, nginx, virtualmin configuration and set up errors.

I've described the problem -- probably too vaguely -- at http://stackoverflow.com/questions/21963824/virtualmin-nginx-and-virtual...

Right now it seems that the nginx virtual servers are all resolving to the 'main' / original directory rather than each resolving to their own directory. I'm sure it's got something to do with how the internal dns is configured (wrongly on my part).

When I run the 'recheck configuration' I get:

Virtualmin could not work out the default IPv6 address for virtual servers on your system. You will need to update either the Network interface for virtual addresses or Default virtual server IP address fields on the module configuration page.

Quotas are not enabled on the filesystem / which contains home directories under /home and email files under /home. Quota editing has been disabled.

Personally what would be great is this: if I could get virtual servers running properly under nginx for wordpress (toyed with attempting setup with apache if need be); also curious: dream host (which I'm trying to get off of hence this setup) has all my domains running under one user rather than creating a new user for every domain setup. Is that possible or is that not preferable?

First things first; how do I get domains such as gadbooks.com, blastii.com to resolve to their own directories and NOT the root which is where blastii.net?

Wed, 03/12/2014 - 16:34
grimmwerks

Also - I've read differing information as well for the webmin -> Networking Settings-> Network interface for virtual address; in some places I've read set it to detect automatically, in other that it should be venet0 and in others about an OpenVZ setup it should be set to venet0:0 -- not sure which it should be.

Wed, 03/12/2014 - 20:44
Joe
Joe's picture

We'd need to see your full nginx configuration and your network interfaces (ifconfig output).

--

Check out the forum guidelines!

Wed, 03/12/2014 - 22:04
grimmwerks

ifconfig:

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:7084 errors:0 dropped:0 overruns:0 frame:0 TX packets:7084 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:424426 (424.4 KB) TX bytes:424426 (424.4 KB)

venet0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:127.0.0.2 P-t-P:127.0.0.2 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1 RX packets:187639 errors:0 dropped:0 overruns:0 frame:0 TX packets:109248 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:214781850 (214.7 MB) TX bytes:9913450 (9.9 MB)

venet0:0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:107.150.7.19 P-t-P:107.150.7.19 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

venet0:1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:107.150.7.190 P-t-P:107.150.7.190 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST POINTOPOINT RUNNING NOARP MTU:1500 Metric:1

/etc/nginx/nginx.conf:

user www-data; worker_processes 4; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid;

events { worker_connections 1024; # 768 # multi_accept on; }

http {

##
# Basic Settings
##

sendfile on;
# tcp_nopush on;  # me
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

 gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;

##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##

#include /etc/nginx/naxsi_core.rules;

##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##

#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
server_names_hash_bucket_size 128;

}

Wed, 03/12/2014 - 22:52
andreychek

Howdy,

So first off, I believe "Network interface for virtual address" would be set to "venet0:0" in your case, as that's your public IP address.

Now, Nginx isn't so much my area of expertise, but when this issue occurs on Apache, it's usually because domain's were configured to use the wrong IP address.

There's additional information on that problem when dealing with Apache in the docs here in the section "The Wrong Site Shows Up":

https://www.virtualmin.com/documentation/web/troubleshooting

You may need to review the config files within "/etc/nginx/sites-enabled/" to see if any of them have those same issues.

If you're still stuck, feel free to share the files from that directory.

-Eric

Wed, 03/12/2014 - 23:23
grimmwerks

Eric

Do you know how many times I changed from venet0 to venet0:0 , updated the IPs and nothing was happening - probably because something else was awry. But apparently all I needed was your blessing :P

Lo and behold:

blastii.com gadbooks.com

Both are seeing their own test html (just printing an h1 out). Beyond ecstatic. Thanks VERY much!

Topic locked