Submitted by LeGiangAnh on Fri, 08/14/2015 - 09:54 Pro Licensee
Hi,
I follow to use nginx for virtualmin. However when creating the virtual host, there are errors:
Creating Nginx virtual host ..
.. Nginx website failed! : virtualmin-nginx::feature_setup failed : Failed to open /etc/nginx/sites-available for writing : No such file or directory at /usr/share/webmin/web-lib-funcs.pl line 1397.
Setting up scheduled Webalizer reporting ..
.. no logging directive found in webserver configuration!
Setting up log file rotation ..
.. no logging directive found in webserver configuration!
Creating MySQL login ..
.. done
Creating MySQL database jplayvn ..
.. done
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/web-lib-funcs.pl line 1397.
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/web-lib-funcs.pl line 1397.
Creating SSL certificate and private key ..
.. done
Adding SSL to Nginx virtual host ..
.. Nginx SSL website failed! : virtualmin-nginx-ssl::feature_setup failed : Failed to open /etc/nginx/sites-available for writing : No such file or directory at /usr/share/webmin/web-lib-funcs.pl line 1397.
Please help me to solve this.
Is there any way to solve this without re-create the host? I already copy some data to the host directory.
Thanks, Giang Anh
Status:
Active
Comments
Submitted by JamieCameron on Fri, 08/14/2015 - 16:54 Comment #1
Does the directory /etc/nginx/sites-available exist on your system?
Submitted by LeGiangAnh on Fri, 08/14/2015 - 20:13 Pro Licensee Comment #2
No I don't have it. Do I need to create new one?
Submitted by JamieCameron on Sat, 08/15/2015 - 01:51 Comment #3
Yes, you should.
Submitted by LeGiangAnh on Sat, 08/15/2015 - 03:20 Pro Licensee Comment #4
I created it. Then there is another issue when creating the host: https://goo.gl/Kdk1tk
Applying Nginx configuration ..
.. restart failed :
Submitted by JamieCameron on Sat, 08/15/2015 - 13:45 Comment #5
That's not a very useful message, is it :-(
How did you install Nginx exactly? And which operating system and version are you running there?
Submitted by LeGiangAnh on Sun, 08/16/2015 - 05:30 Pro Licensee Comment #6
I'm using Ubuntu Linux 14.04.3 I downloaded nginx and re-build it to use for RTMP server: https://obsproject.com/forum/resources/how-to-set-up-your-own-private-rt... nginx run correctly: http://111.221.97.167/
Thanks, Giang Anh
Submitted by JamieCameron on Sun, 08/16/2015 - 15:46 Comment #7
Ok, that explains it - the default Virtualmin configs for Nginx assume you are installing from a standard Debian package. You may need to go to Webmin -> Servers -> Nginx Webserver -> Module Config and adjust some of the paths and the command to stop/start the server.
Submitted by LeGiangAnh on Sun, 08/16/2015 - 20:48 Pro Licensee Comment #8
I already config it before: https://goo.gl/sxe8SG
Full path to Nginx config file: /usr/local/nginx/conf/nginx.conf
File or directory for new virtual hosts: /etc/nginx/sites-available
Directory for links to new virtual host files: /etc/nginx/sites-enabled
Full path to Nginx command: /usr/local/nginx/sbin/nginx
Command to start Nginx: /usr/local/nginx/sbin/nginx
Command to stop Nginx: /usr/local/nginx/sbin/nginx -s stop
Is it correct?
Thanks, Giang Anh
Submitted by LeGiangAnh on Sun, 08/16/2015 - 20:57 Pro Licensee Comment #9
I also make a test in one host but it didn't work: https://goo.gl/qjQMxw https://goo.gl/PLTykf
Submitted by andreychek on Sun, 08/16/2015 - 21:03 Comment #10
When installing Nginx using a typical Ubuntu/Debian .deb package, Webmin is able to use an init script to start and stop the service.
In that case, it uses "service nginx start" and "service nginx stop".
We're not familiar with the process of manually installing it though.
The exact commands would depend on your exact setup.
What you would need to do is come up with a command line for starting and stopping Nginx for your particular installation, and add that into the Webmin module config.
You would want to test it on the command line first... just make sure when you run the command to start and stop Nginx, that you can see the process launching, and exiting, at the appropriate times.