Compiled Nginx, Debian - Where to modify directory for new virtual hosts?

I compiled Nginx with the RTMP module on a Debian system and installed webmin-virtualmin-nginx and webmin-virtualmin-nginx-ssl.

Removed Apache from System Settings > Features and Plugins, and selected Nginx.

The compiled Nginx gets created in /usr/local/nginx/conf/nginx.conf and /usr/local/nginx/sbin/nginx so I changed the default /etc/nginx directories. Had to created a nginx.service in /lib/systemd/system/nginx.service with the appropriate directories.

But I didn’t know what to do about the nginx/sites-available and nginx/sites-enabled. Are they under /home/virtual-server/? or?

In any case, does anyone know how and where do I modify the directories that I missed?

File or directory for new virtual hosts             |None (add to main config file)  *  /etc/nginx/sites-available|
Directory for links to new virtual host files     |None                                         *  /etc/nginx/sites-enabled|

Setting up spam filtering …
… Spam filtering failed! : Failed to open /etc/nginx/sites-available for writing : No such file or directory at /usr/share/webmin/ line 1496.

Setting up virus filtering …
… Virus filtering failed! : Failed to open /etc/nginx/sites-available for writing : No such file or directory at /usr/share/webmin/ line 1496.

Creating SSL certificate and private key …
… done

Adding SSL to Nginx virtual host …
… Nginx SSL website failed! : virtualmin-nginx-ssl::feature_setup failed : flush_file_lines called on non-loaded file /usr/local/nginx/conf/nginx.conf at /usr/share/webmin/ line 1496.


No. They’re in the usual place. Configuration files go in /etc. (Though you could configure it however you like. I recommend you stick to OS and Virtualmin defaults unless you really have a lot of experience that guides you in another direction.)

Thanks for that guidance. Perhaps with the compiled rtmp nginx, I need to make sure the ownership/permissions is suitable so that Virtualmin can create those directories.

Okay, I had to do a couple things because Nginx wasn’t starting up and when it did, Virtualmin couldn’t successfully create a Virtual Server :

  1. Explicitly specify/add “pid /run/;” in the /usr/local/nginx/conf/nginx.conf
    file (so that it was the same as the pid directory in nginx.service)

—> allowed me to start Nginx (it died for some reason and it wouldn’t start with systemctl start nginx)

  1. Manually create directories /etc/nginx/sites-available and /etc/nginx/sites-enabled
    mkdir -p /etc/nginx/sites-available
    mkdir -p /etc/nginx/sites-enabled

—> allowed for the creation of a virtual server