Error: should only be one vhost in

When I tried to install the SSL key that’s i got it from certboot - "Error: should only be one vhost in"
Any ideas how to solve it?

split your vhosts file up into multiple single files, each with only one vhost in it.

2 Likes

I have only one virtualhost in file

can you provide a little more information about your system and config ?

I assume it’s apache ? what’s your OS ? Can you provide your apache config, if it’s just one simple file with one virtualhost ?

1 Like

Ofc
Yes, apache. OS - Ubuntu 14, Central panel for server - VestaCP
Config:

VirtualHost XX.XXX.XX.XXX:8080(Tags)
ServerName site.ru
ServerAlias www.site.ru
ServerAdmin info@site.ru
DocumentRoot /home/site/web/site.ru/public_html
ScriptAlias /cgi-bin/ /home/site/web/site.ru/cgi-bin/
Alias /vstats/ /home/site/web/site.ru/stats/
Alias /error/ /home/site/web/site.ru/document_errors/
#SuexecUserGroup site site
CustomLog /var/log/apache2/domains/site.ru.bytes bytes
CustomLog /var/log/apache2/domains/site.ru.log combined
ErrorLog /var/log/apache2/domains/site.ru.error.log
<Directory /home/site/web/site.ru/public_html>
AllowOverride All
Options +Includes -Indexes +ExecCGI

<Directory /home/site/web/site.ru/stats>
AllowOverride All


RMode config
RUidGid site site
RGroups www-data


AssignUserID site site

IncludeOptional /home/site/conf/web/apache2.site.ru.conf*
/VirtualHost(Tags)

That looks to be just the vhost file for your control panel ( on port 8080 )

Do you have a vhost file that’s set up for your domain on port 443 ( for standard https ) ?

1 Like

Do you have a vhost file that's set up for your domain on port 443 ( for standard https ) ?
I think that nope, where i can find this file or it shoud be generate by certbot?

Have you got one listening on port 80 ?

on ubuntu, by default, it’s in /etc/apache/sites-available (I’m not sure if VestaCP modifies that though )

1 Like

Have you got one listening on port 80 ?

on ubuntu, by default, it's in /etc/apache/sites-available (I'm not sure if VestaCP modifies that though )

No, VestaCP read conf file, which located in folder with your site. For example, /home/SITE/conf/web/apache2.conf

OK, since VestaCP modifies your apache config, you'll probably need to use the webroot method on certbot

certbot certonly --webroot -w /var/www/example/ -d www.example.com

where /var/www/example/ is the web root for your site and www.example.com is your domain name.

1 Like

Okay, i got this message:
“Certificate not yet due for renewal; no action taken”.

Have you already got a certificate for your domain name ? what is the domain name you are trying to obtain the cert for ?

1 Like

Certbot said to me, that " Congratulations! Your certificate and..." - all okay.
But i tried ti re-install certificate in manual mode: certbot-auto certonly --renew-by-default -a manual
And get message: "Self-verify of challenge failed"
Find way to solve this problem, write this block in configuration apahce file:

Location "/.well-known/acme-challenge"(Tag)
ForceType 'text/plain'
AddDefaultCharset Off
/Location(Tag)

Made it and nothing happend

I don’t follow completely what you did.

Have you already successfully got a certificate ? (it would appear that way from your comment that certbot said " Congratulations! Your certificate and…"

If so, you need to copy that certificate into your VestaCP.

You then say you tried “certbot-auto certonly --renew-by-default -a manual” Why ? I must be missing something as running this doesn’t make sense to me from your earlier comments.

What is your domain ?

1 Like

I don't follow completely what you did.

Have you already successfully got a certificate ? (it would appear
that way from your comment that certbot said " Congratulations! Your
certificate and..."

If so, you need to copy that certificate into your VestaCP.

You then say you tried "certbot-auto certonly --renew-by-default -a
manual" Why ? I must be missing something as running this doesn't make
sense to me from your earlier comments.

What is your domain ?

Thanks.

You have certs for labdoors.ru (in fact you will shortly run into the rate limits for too many certs )

When it said, " Congratulations! Your certificate and…" it will have given you a location. Generally in /etc/letsencrypt/labdoors.ru/live where the certificate is stored.

Copy the certificate from there, log into your VestaCP, and paste the certificates it asks for in the SSL section there, and you should be OK.

1 Like

"Carelessness kills"
All works fine, around billion times i have changed SSL certification and keys, but nothing happend because i did it with other domain,.Hm, now all works perfectly
Thank you for support, but another small question: how you checked “certs”:?

There are a number of places you can check - I checked at https://crt.sh/?q=labdoors.ru

Thank you again man.
Problem solved.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.