Failed to modify server : An Nginx virtual host with the same name already exists

25 posts / 0 new
Last post
#1 Thu, 09/07/2017 - 06:36
alabamaster1337

Failed to modify server : An Nginx virtual host with the same name already exists

After some updates. The modification of nginx stopped working. When creating a website:

Starting PHP FastCGI server .. .. Nginx website failed! : virtualmin-nginx::feature_setup failed : virtualmin-nginx::feature_save_web_php_mode failed : No PHP command found! at ../web-lib-funcs.pl line 1433.

Edit Virtual Server:

Failed to modify server : An Nginx virtual host with the same name already exists

Sorry for my english :(

ty, google translate

Fri, 09/08/2017 - 00:06
alabamaster1337
Fri, 09/08/2017 - 05:52
irieyuusuke

I have a same error in CentOS6 virtualmin6.

and I find that there is no file in below

/etc/rc.d/init.d

it should be there but no file such as "php-fcgi-example-com"

AND there is no script such a below in nginx.conf fastcgi_pass unix:/var/php-nginx/1495xxxxxx5959.sock/socket;

Fri, 09/08/2017 - 07:07 (Reply to #3)
alabamaster1337

Did you get this error after the update?

I using Debian Linux 8

Wed, 09/13/2017 - 09:17 (Reply to #4)
irieyuusuke

YES

Sat, 09/16/2017 - 03:10 (Reply to #5)
Joe
Joe's picture

I'd really recommend you use a new distribution if you are using new features. nginx and the LEMP installation bundle are extremely new and rely on a bunch of new stuff. It should work in old distros, but we have to focus our testing on newer distributions. If you want to use an old distribution, use the old tried and true Apache installation target.

I'll work on making sure the LEMP (nginx) installation works well as best I can, but I have to focus on new distributions first and foremost.

So, use a new distro (CentOS 7, Debian 9, or Ubuntu 16.04), and report bugs. We'll get them fixed as fast as we can.

--

Check out the forum guidelines!

Tue, 09/12/2017 - 09:20
irieyuusuke

Maybe YES

Fri, 09/15/2017 - 14:20
nobody

Hello, I am experiencing a similar issue on a CentOS 7 + nginx:

Failed to modify server : An Nginx virtual host with the same name already exists

This happens when trying to create a new virtual server. The server is created but the "Enabled features > Nginx Website Enabled" stays deselected, and on attempting to enable it I get the error: "Failed to modify server : An Nginx virtual host with the same name already exists"

The "Webalizer reporting enabled?" feature presents the same issue (remains deselected and cannot be enabled).

Fri, 09/15/2017 - 14:55
nobody

Then on deleting the virtual host, its server block does not get removed from /etc/nginx/nginx.conf. And incidentally, this file seems to include all of the virtual hosts as opposite to having a separate nginx conf file for each separate host. I would suggest escalating this issue to critical as far as CentOS 7 + nginx support.

Sat, 09/16/2017 - 03:07 (Reply to #9)
Joe
Joe's picture

"And incidentally, this file seems to include all of the virtual hosts as opposite to having a separate nginx conf file for each separate host."

This is how CentOS virtual hosts are done, for both Apache and nginx. It is done as individual files on Debian/Ubuntu and a single file on CentOS. It's configurable for Apache, I'm not sure about for nginx (but I would assume it is). This behavior is not a bug, it is working as intended. We trust you to choose the OS that works the way you want (CentOS puts vhosts in the main configuration file, by default).

Edit: Yeah, this is configurable. Go to Features and Plugins->Nginx Website and the set a directory where you want your vhost files to go in the option labeled File or directory for new virtual hosts.

"Then on deleting the virtual host, its server block does not get removed from /etc/nginx/nginx.conf. "

Sounds like a bug. Bugs can always be reported in the issue tracker (whether for GPL or Pro), and Jamie will be able to sort it out if it is reproducible. I'm running a test install on CentOS 7 right now to see if I can reproduce the problem.

Edit: I didn't see this behavior on my test system. Did you perform a --minimal installation? If so, if you didn't disable Webalizer and AWStats before creating/deleting any virtual servers, it probably leads to botched configs. That's either fixed in the current virtualmin-config package or will be in the next, I don't remember when I checked in the changes.

--

Check out the forum guidelines!

Fri, 09/15/2017 - 22:02
irieyuusuke

I think the cause of this error is maybe ”wbm-virtualmin-nginx 2.3-1"

Sat, 09/16/2017 - 03:36
Joe
Joe's picture

OK, in my testing on CentOS 7, it looks like the only thing that is failing is that nginx isn't restarting when Webmin tells it to restart. Restarting it manually allows the new virtual host (server block) to show up, and I'm able to browse the newly created domain. But, I didn't get any of the errors y'all have mentioned, so you're seeing something other than merely nginx failing to restart.

I'm gonna figure out why nginx isn't restarting, and we'll get that sorted in Virtualmin.

But...all this other stuff, I can't reproduce so far. So, I need more specifics about what you've changed from the defaults, or whether it was installed with any flags other than --bundle LEMP. Was it a --minimal installation? There were some bugs with Webalizer and AWStats being enabled even though they don't get installed, so you have to make sure you've got the Webalizer feature and AWstats plugin disabled before doing anything with virtual servers (re-check configuration will warn you about this, but it won't stop you from trying to create virtual hosts anyway and getting botched configuration probably).

--

Check out the forum guidelines!

Sat, 09/16/2017 - 08:03
nobody

Hi Joe, thank you so much for taking the time to answer.

The main issue I am experiencing is that after creating a new virtual host, the option "Nginx website enabled?" appears deselected and when trying to enable it the error "Failed to modify server : An Nginx virtual host with the same name already exists" is thrown. I tried manually restarting nginx to no avail.

The CentOS 7 server has a default install of Virtualmin from the install script and there are already 3 other virtual servers that were created successfully earlier, so this issue might be a recently introduced one.

The "Webalizer reporting enabled?" option being deselected is probably a consequence of the disabled "Nginx website enabled?". By the way with nginx I found that the stats folder needs to be manually protected with "auth_basic" directive in the nginx conf file but other than that Webalizer seemed to be working fine with nginx for the previously created virtual servers.

Mon, 09/18/2017 - 09:06
irieyuusuke

AFTER update to wbm-virtualmin-nginx 2.4-1

I cannot create virtualserver correctly, show you my getting logs.

---logs---

Creating administration group iriey .. .. done Creating administration user iriey .. .. done

Creating aliases for administration user .. .. done

Adding administration user to groups .. .. done

Creating home directory .. .. done

Creating mailbox for administration user .. .. done

Adding new DNS zone .. .. done

Adding to email domains list .. .. done

Adding default mail aliases .. .. done

Adding DKIM records to DNS domain iriey.com .. .. added successfully

Creating Nginx virtual host .. .. done

Starting PHP FastCGI server .. .. Nginx website failed! : virtualmin-nginx::feature_setup failed : virtualmin-nginx::feature_save_web_php_mode failed : No PHP command found! at ../web-lib-funcs.pl line 1433.

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 iriey .. .. done

Setting up spam filtering .. .. done

Setting up virus filtering .. .. done

Creating SSL certificate and private key .. .. done

Adding SSL to Nginx virtual host .. .. done

Creating Webmin user .. .. done

Re-starting DNS server .. .. done

Applying Nginx configuration .. .. done

Re-starting Webmin .. .. done

Re-starting Usermin .. .. done

Re-loading Webmin .. .. done

Saving server details .. .. done

---/logs---

I had installed just like below.

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

Mon, 09/18/2017 - 09:11
irieyuusuke

I can restart nginx, not failing to restart nginx.

Mon, 09/18/2017 - 09:18
irieyuusuke

if it is "wbm-virtualmin-nginx 2.2-1" in CentOS6.9.

I have a "no" error to create virtualserver.

---logs---

Starting PHP FastCGI server .. .. done

---/logs---

Tue, 09/19/2017 - 18:17
wyoungca

I'm running Webmin/Virtualmin on Debian 8.9. After updated different packages, I also got error during the creation of virtualserver.

Starting PHP FastCGI server .. .. Nginx website failed! : virtualmin-nginx::feature_setup failed : virtualmin-nginx::feature_save_web_php_mode failed : No PHP command found! at ../web-lib-funcs.pl line 1433.

The creation was incomplete! If I deleted the virtualserver, the Nginx's virtualhost was not deleted. I need to manually delete the virtualhost in Nginx before I can re-create it again!

Thanks to @irieyuusuke, After I downgraded "webmin-virtualmin-nginx" to 2.2 then I had no problem in creating the virtualserver now!

Wed, 09/20/2017 - 05:27
alabamaster1337

@wyoungca, how are you rolled back?

Fri, 09/22/2017 - 19:55 (Reply to #18)
wyoungca

@alabamaster1337

apt-get install webmin-virtualmin-nginx=2.2

Fri, 09/22/2017 - 19:54
wyoungca

@alabamaster1337

apt-get install webmin-virtualmin-nginx=2.2

Sat, 09/23/2017 - 04:13 (Reply to #20)
alabamaster1337

thank you man

Mon, 10/23/2017 - 20:44
maur

Had the same problem. Debian 8.9. 1. When moving domain from subserver to a new parent server (newuser and newpassword options used) - lost php-fcgi script. 2. When deleting domain, /etc/nginx/sites-available file was left intact 3. When creating new - php error "No PHP command found!"

downgrading webmin-virtualmin-nginx to 2.2 helped

Fri, 10/27/2017 - 02:33
tomyamy

I had same trouble, but solved it by downgrading.

yum downgrade wbm-virtualmin-nginx-2.2-1

Sat, 01/13/2018 - 17:33
Kintaro

same problem here (maybe after upgrading to 6)

I opened an issue here: https://github.com/virtualmin/virtualmin-gpl/issues/41

Tue, 02/06/2018 - 15:42
panosz

Same problem Ubuntu 14.04 LTS, Package name webmin-virtualmin-nginx Update system APT Package description Webmin module for 'Nginx Webserver' Current state Running latest 2.3 Installed version 2.3 Available version 2.3

after creating new domain zamanis.gr

Creating administration group myzamanisgrus3r- .. .. done Creating administration user myzamanisgrus3r- .. .. done

Creating aliases for administration user .. .. done

Adding administration user to groups .. .. done

Creating home directory .. .. done

Creating mailbox for administration user .. .. done

Creating Nginx virtual host .. .. done

Starting PHP FastCGI server .. .. Nginx website failed! : virtualmin-nginx::feature_setup failed : virtualmin-nginx::feature_save_web_php_mode failed : No PHP command found! at ../web-lib-funcs.pl line 1445.

Setting up log file rotation .. .. no logging directive found in webserver configuration!

Creating MySQL login .. .. done

Creating MySQL database myzamanisgrus3r_ .. .. done

Creating Webmin user .. .. done

Applying Nginx configuration .. .. done

Re-loading Webmin .. .. done

Saving server details .. .. done

please help, if the solution is to downgrade please give me link with a guideline

Topic locked