Have got multiple vhost error, but I have only one vhost!


Hi everyone :slight_smile:
I’m new to letsencrypt. I have installed it on my VPS running Debian 8 and VestaCP as server control panel (This means I have apache and nginx).
Letsencrypt gives me this error every time I try to install ssl for my domain ehsan.space:

Error: should only be one vhost in /home/admin/conf/web/apache2.conf

Buy I already checked my apache2.conf and there is only one vhost there. This is my apache2.conf:


    ServerName ehsan.space
    ServerAlias www.ehsan.space
    ServerAdmin info@ehsan.space
    DocumentRoot /home/admin/web/ehsan.space/public_html
    ScriptAlias /cgi-bin/ /home/admin/web/ehsan.space/cgi-bin/
    Alias /vstats/ /home/admin/web/ehsan.space/stats/
    Alias /error/ /home/admin/web/ehsan.space/document_errors/
    #SuexecUserGroup admin admin
    CustomLog /var/log/apache2/domains/ehsan.space.bytes bytes
    CustomLog /var/log/apache2/domains/ehsan.space.log combined
    ErrorLog /var/log/apache2/domains/ehsan.space.error.log
    <Directory /home/admin/web/ehsan.space/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
    <Directory /home/admin/web/ehsan.space/stats>
        AllowOverride All

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid admin admin
        RGroups www-data
    <IfModule itk.c>
        AssignUserID admin admin

    IncludeOptional /home/admin/conf/web/apache2.ehsan.space.conf*


Could any one help me please? :slight_smile:


Do you have a web host listening on port 80 (http) ? You appear to only have a host on port 8080


Yes, I think. Because website is available with no problem on http right now. How could that be possible if server not listening on http port?
But I don’t know exactly why there is not a host on port 80 in apache conf!
I didn’t edit manually anything. apache2.conf is created and configured by my VestaCP panel automatically.


For the record, there is also an nginx.conf in /home/admin/conf/web/ . Just alongside with apache2.conf .


Yes nginx is running your site on port 80

You will need to specify you are using nginx rather than apache in your command to obtain the certificate by default I think


Right. Which command should I run for this? I checked letsencrypt documentation, but didn’t found commands for nginx.


Since you are using VestaCP you may be better with one of the alternate clients - there is one at https://github.com/interbrite/letsencrypt-vesta which is possibly better for you.


I solved problem by using VestaCP ssl settings and adding certificates manually.
Letsencrypt have certificate files in /etc/letsencrypt/archive/
I used files and added certificate to vesta panel by my self. Vesta takes care about configuring nginx hisself :slight_smile:
Thank you for your time.


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