(Dec 29) New version 0.9.8-18 has been released

domain and subdomain with same root folder but different certificates

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Forum rules
Before creating a new topic or reply on the forum you should fill out additional fields "Os" and "Web" in your profile section.
In case of violation, the topic can be closed or response from the support will not be received.
lacsyst
Posts: 2
Joined: Mon Dec 11, 2017 1:54 pm

Os: CentOS 7x
Web: apache + nginx

domain and subdomain with same root folder but different certificates

Postby lacsyst » Tue Jan 02, 2018 3:01 pm

Hi
I have one domain, domain.ml, with let's encrypt enable on it. I want to have a subdomain of domain.com (admin.domain.ml) with its own certificate.

For this I added a CNAME record admin to domain.mland create a new web (site) admin.domain.ml and enable let's encrypt on it.
I also modified the apache and nginx conf like this

Code: Select all

<VirtualHost 1.1.1.1:8080>

    ServerName admin.domain.ml
    ServerAlias www.admin.domain.ml
    ServerAdmin info@admin.domain.ml
    DocumentRoot /home/admin/web/domain.ml/public_html
    ScriptAlias /cgi-bin/ /home/admin/web/admin.domain.ml/cgi-bin/
    Alias /vstats/ /home/admin/web/admin.domain.ml/stats/
    Alias /error/ /home/admin/web/admin.domain.ml/document_errors/
    #SuexecUserGroup admin admin
    CustomLog /var/log/httpd/domains/admin.domain.ml.bytes bytes
    CustomLog /var/log/httpd/domains/admin.domain.ml.log combined
    ErrorLog /var/log/httpd/domains/admin.domain.ml.error.log
    <Directory /home/admin/web/domain.ml/public_html>
        AllowOverride All
        Options +Includes -Indexes +ExecCGI
        php_admin_value open_basedir /home/admin/web/admin.domain.ml/public_html:/home/admin/tmp
        php_admin_value upload_tmp_dir /home/admin/tmp
        php_admin_value session.save_path /home/admin/tmp
    </Directory>
    <Directory /home/admin/web/admin.domain.ml/stats>
        AllowOverride All
    </Directory>

    <IfModule mod_ruid2.c>
        RMode config
        RUidGid admin admin
        RGroups apache
    </IfModule>
    <IfModule itk.c>
        AssignUserID admin admin
    </IfModule>

    IncludeOptional /home/admin/conf/web/httpd.admin.domain.ml.conf*

</VirtualHost>



Code: Select all

server {
    listen      1.1.1.1:80;
    server_name admin.domain.ml www.admin.domain.ml;
    error_log  /var/log/httpd/domains/admin.domain.ml.error.log error;

    location / {
        proxy_pass      http://1.1.1.1:8080;
        location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|htm|html|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|od$
            root           /home/admin/web/domain.ml/public_html;
            access_log     /var/log/httpd/domains/admin.domain.ml.log combined;
            access_log     /var/log/httpd/domains/admin.domain.ml.bytes bytes;
            expires        max;
            try_files      $uri @fallback;
        }
    }

    location /error/ {
        alias   /home/admin/web/admin.domain.ml/document_errors/;
    }

    location @fallback {
        proxy_pass      http://1.1.1.1:8080;
    }

    location ~ /\.ht    {return 404;}
    location ~ /\.svn/  {return 404;}
    location ~ /\.git/  {return 404;}
    location ~ /\.hg/   {return 404;}
    location ~ /\.bzr/  {return 404;}

    include /home/admin/conf/web/nginx.admin.domain.ml.conf*;
}



The result is:
  • http://admin.domain.ml display the same that domain.ml
  • https://admin.domain.ml display the default page of admin.domain.ml

How I can modifiy https pointing of admin.domain.ml to domain.ml?

lacsyst
Posts: 2
Joined: Mon Dec 11, 2017 1:54 pm

Os: CentOS 7x
Web: apache + nginx

Re: domain and subdomain with same root folder but different certificates

Postby lacsyst » Tue Jan 02, 2018 3:03 pm

Hi
Anyone have a solution or the same problem?


Return to “Web Server”



Who is online

Users browsing this forum: No registered users and 2 guests

cron