ISPConfig create main domain and subdomain

Discussion in 'Installation/Configuration' started by JULINT, Feb 16, 2021.

  1. JULINT

    JULINT Member

    Hi,
    I have created website on ispconfig admin.
    Main Domain : http://simura.id
    Subdomain : http://demo.simura.id/company

    But main domain is not working ( got 404 not found), while subdomain is working.
    Please help me what is wrong with my configuration .
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    the dns is ok, so the problem would appear to be the vhost creation.

    did you create the website for simura.id?
    or did you just create the subdomain as a full website?
     
  3. JULINT

    JULINT Member

    Yes , i have created the website for simura.id
    i have chown web11:client1 also for web11/web folder...
     
  4. JULINT

    JULINT Member

    FYI, my website simura.id and demo.simura.id , has same name server ns1.simura.id
    Do i need to create different ns for subdomain ?
     
  5. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    no dns is ok, the domain and subdomain are resolving fine.

    what's the output of
    Code:
    ls -l /var/www/sites-available | grep simura 
    please post the contents of any vhost configs found by the above command
     
  6. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    also, why did you chown the web folder? what owner/group did it have before?
     
  7. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    No, you should create the A record "demo" for the zone simura.id, pointing to your webserver.
     
  8. JULINT

    JULINT Member

    I got 3 vhosts for simura
    1. simura.id.vhost
    Code:
    <Directory /var/www/simura.id>
            AllowOverride None
                    Require all denied
            </Directory>
    
    <VirtualHost *:80>
    
    
                        DocumentRoot /var/www/clients/client1/web11/web
                
            ServerName simura.id
            ServerAlias *.simura.id
            ServerAdmin [email protected]
    
    
            ErrorLog /var/log/ispconfig/httpd/simura.id/error.log
    
            Alias /error/ "/var/www/simura.id/web/error/"
            ErrorDocument 400 /error/400.html
            ErrorDocument 401 /error/401.html
            ErrorDocument 403 /error/403.html
            ErrorDocument 404 /error/404.html
            ErrorDocument 405 /error/405.html
            ErrorDocument 500 /error/500.html
            ErrorDocument 502 /error/502.html
            ErrorDocument 503 /error/503.html
    
    
            <Directory /var/www/simura.id/web>
                    # Clear PHP settings of this website
                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            SetHandler None
                    </FilesMatch>
                    Options +SymlinksIfOwnerMatch
                    AllowOverride All
                                    Require all granted
                            </Directory>
            <Directory /var/www/clients/client1/web11/web>
                    # Clear PHP settings of this website
                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            SetHandler None
                    </FilesMatch>
                    Options +SymlinksIfOwnerMatch
                    AllowOverride All
                                    Require all granted
                            </Directory>
    
    
    
    
            # suexec enabled
            <IfModule mod_suexec.c>
                SuexecUserGroup web11 client1
            </IfModule>
            <IfModule mod_fastcgi.c>
                    <Directory /var/www/clients/client1/web11/cgi-bin>
                                            Require all granted
                                        </Directory>
                    <Directory /var/www/simura.id/web>
                        <FilesMatch "\.php[345]?$">
                            <If "-f '%{REQUEST_FILENAME}'">
                                SetHandler php-fcgi
                            </If>
                        </FilesMatch>
                    </Directory>
                    <Directory /var/www/clients/client1/web11/web>
                        <FilesMatch "\.php[345]?$">
                            <If "-f '%{REQUEST_FILENAME}'">
                                SetHandler php-fcgi
                            </If>
                        </FilesMatch>
                    </Directory>
                    Action php-fcgi /php-fcgi virtual
                    Alias /php-fcgi /var/www/clients/client1/web11/cgi-bin/php-fcgi-*-80-simura.id
                    FastCgiExternalServer /var/www/clients/client1/web11/cgi-bin/php-fcgi-*-80-simura.id -idle-timeout 300 -socket /var/lib/php7.4-fpm/web11.sock -pass-header Authorization  -pass-header Content-Type
            </IfModule>
            <IfModule mod_proxy_fcgi.c>
                #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php7.4-fpm/web11.sock|fcgi://localhost//var/www/clients/client1/web11/web/$1
                <Directory /var/www/clients/client1/web11/web>
                    <FilesMatch "\.php[345]?$">
                        <If "-f '%{REQUEST_FILENAME}'">
                            SetHandler "proxy:unix:/var/lib/php7.4-fpm/web11.sock|fcgi://localhost"
                        </If>
                    </FilesMatch>
                </Directory>
                </IfModule>
    
    
    
            # add support for apache mpm_itk
            <IfModule mpm_itk_module>
                AssignUserId web11 client1
            </IfModule>
    
            <IfModule mod_dav_fs.c>
            # Do not execute PHP files in webdav directory
                <Directory /var/www/clients/client1/web11/webdav>
                    <ifModule mod_security2.c>
                        SecRuleRemoveById 960015
                        SecRuleRemoveById 960032
                    </ifModule>
                    <FilesMatch "\.ph(p3?|tml)$">
                        SetHandler None
                    </FilesMatch>
                </Directory>
                DavLockDB /var/www/clients/client1/web11/tmp/DavLock
                # DO NOT REMOVE THE COMMENTS!
                # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                # WEBDAV END
            </IfModule>
    
                
        
    
    </VirtualHost>
    
    
    
    
    


    2. demo.simura.id.vhost
    Code:
    <Directory /var/www/demo.simura.id>
            AllowOverride None
                    Require all denied
            </Directory>
    
    <VirtualHost *:80>
    
    
                        DocumentRoot /var/www/clients/client1/web12/web
                
            ServerName demo.simura.id
            ServerAlias *.demo.simura.id
            ServerAdmin [email protected]
    
    
            ErrorLog /var/log/ispconfig/httpd/demo.simura.id/error.log
    
            Alias /error/ "/var/www/demo.simura.id/web/error/"
            ErrorDocument 400 /error/400.html
            ErrorDocument 401 /error/401.html
            ErrorDocument 403 /error/403.html
            ErrorDocument 404 /error/404.html
            ErrorDocument 405 /error/405.html
            ErrorDocument 500 /error/500.html
            ErrorDocument 502 /error/502.html
            ErrorDocument 503 /error/503.html
    
    
            <Directory /var/www/demo.simura.id/web>
                    # Clear PHP settings of this website
                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            SetHandler None
                    </FilesMatch>
                    Options +SymlinksIfOwnerMatch
                    AllowOverride All
                                    Require all granted
                            </Directory>
            <Directory /var/www/clients/client1/web12/web>
                    # Clear PHP settings of this website
                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            SetHandler None
                    </FilesMatch>
                    Options +SymlinksIfOwnerMatch
                    AllowOverride All
                                    Require all granted
                            </Directory>
    
    
    
    
            # suexec enabled
            <IfModule mod_suexec.c>
                SuexecUserGroup web12 client1
            </IfModule>
            <IfModule mod_fastcgi.c>
                    <Directory /var/www/clients/client1/web12/cgi-bin>
                                            Require all granted
                                        </Directory>
                    <Directory /var/www/demo.simura.id/web>
                        <FilesMatch "\.php[345]?$">
                            <If "-f '%{REQUEST_FILENAME}'">
                                SetHandler php-fcgi
                            </If>
                        </FilesMatch>
                    </Directory>
                    <Directory /var/www/clients/client1/web12/web>
                        <FilesMatch "\.php[345]?$">
                            <If "-f '%{REQUEST_FILENAME}'">
                                SetHandler php-fcgi
                            </If>
                        </FilesMatch>
                    </Directory>
                    Action php-fcgi /php-fcgi virtual
                    Alias /php-fcgi /var/www/clients/client1/web12/cgi-bin/php-fcgi-*-80-demo.simura.id
                    FastCgiExternalServer /var/www/clients/client1/web12/cgi-bin/php-fcgi-*-80-demo.simura.id -idle-timeout 300 -socket /var/lib/php7.4-fpm/web12.sock -pass-header Authorization  -pass-header Content-Type
            </IfModule>
            <IfModule mod_proxy_fcgi.c>
                #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php7.4-fpm/web12.sock|fcgi://localhost//var/www/clients/client1/web12/web/$1
                <Directory /var/www/clients/client1/web12/web>
                    <FilesMatch "\.php[345]?$">
                        <If "-f '%{REQUEST_FILENAME}'">
                            SetHandler "proxy:unix:/var/lib/php7.4-fpm/web12.sock|fcgi://localhost"
                        </If>
                    </FilesMatch>
                </Directory>
                </IfModule>
    
    
    
            # add support for apache mpm_itk
            <IfModule mpm_itk_module>
                AssignUserId web12 client1
            </IfModule>
    
            <IfModule mod_dav_fs.c>
            # Do not execute PHP files in webdav directory
                <Directory /var/www/clients/client1/web12/webdav>
                    <ifModule mod_security2.c>
                        SecRuleRemoveById 960015
                        SecRuleRemoveById 960032
                    </ifModule>
                    <FilesMatch "\.ph(p3?|tml)$">
                        SetHandler None
                    </FilesMatch>
                </Directory>
                DavLockDB /var/www/clients/client1/web12/tmp/DavLock
                # DO NOT REMOVE THE COMMENTS!
                # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                # WEBDAV END
            </IfModule>
    
                
        
    
    </VirtualHost>
    
    
    
    
    

    3. invoice-indowebcity.simura.id.vhost
    Code:
    <Directory /var/www/invoice-indowebcity.simura.id>
            AllowOverride None
                    Require all denied
            </Directory>
    
    <VirtualHost *:80>
    
    
                        DocumentRoot /var/www/clients/client1/web13/web
                
            ServerName invoice-indowebcity.simura.id
            ServerAlias *.invoice-indowebcity.simura.id
            ServerAdmin [email protected]
    
    
            ErrorLog /var/log/ispconfig/httpd/invoice-indowebcity.simura.id/error.log
    
            Alias /error/ "/var/www/invoice-indowebcity.simura.id/web/error/"
            ErrorDocument 400 /error/400.html
            ErrorDocument 401 /error/401.html
            ErrorDocument 403 /error/403.html
            ErrorDocument 404 /error/404.html
            ErrorDocument 405 /error/405.html
            ErrorDocument 500 /error/500.html
            ErrorDocument 502 /error/502.html
            ErrorDocument 503 /error/503.html
    
    
            <Directory /var/www/invoice-indowebcity.simura.id/web>
                    # Clear PHP settings of this website
                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            SetHandler None
                    </FilesMatch>
                    Options +SymlinksIfOwnerMatch
                    AllowOverride All
                                    Require all granted
                            </Directory>
            <Directory /var/www/clients/client1/web13/web>
                    # Clear PHP settings of this website
                    <FilesMatch ".+\.ph(p[345]?|t|tml)$">
                            SetHandler None
                    </FilesMatch>
                    Options +SymlinksIfOwnerMatch
                    AllowOverride All
                                    Require all granted
                            </Directory>
    
    
    
    
            # suexec enabled
            <IfModule mod_suexec.c>
                SuexecUserGroup web13 client1
            </IfModule>
            <IfModule mod_fastcgi.c>
                    <Directory /var/www/clients/client1/web13/cgi-bin>
                                            Require all granted
                                        </Directory>
                    <Directory /var/www/invoice-indowebcity.simura.id/web>
                        <FilesMatch "\.php[345]?$">
                            <If "-f '%{REQUEST_FILENAME}'">
                                SetHandler php-fcgi
                            </If>
                        </FilesMatch>
                    </Directory>
                    <Directory /var/www/clients/client1/web13/web>
                        <FilesMatch "\.php[345]?$">
                            <If "-f '%{REQUEST_FILENAME}'">
                                SetHandler php-fcgi
                            </If>
                        </FilesMatch>
                    </Directory>
                    Action php-fcgi /php-fcgi virtual
                    Alias /php-fcgi /var/www/clients/client1/web13/cgi-bin/php-fcgi-*-80-invoice-indowebcity.simura.id
                    FastCgiExternalServer /var/www/clients/client1/web13/cgi-bin/php-fcgi-*-80-invoice-indowebcity.simura.id -idle-timeout 300 -socket /var/lib/php7.4-fpm/web13.sock -pass-header Authorization  -pass-header Content-Type
            </IfModule>
            <IfModule mod_proxy_fcgi.c>
                #ProxyPassMatch ^/(.*\.php[345]?(/.*)?)$ unix:///var/lib/php7.4-fpm/web13.sock|fcgi://localhost//var/www/clients/client1/web13/web/$1
                <Directory /var/www/clients/client1/web13/web>
                    <FilesMatch "\.php[345]?$">
                        <If "-f '%{REQUEST_FILENAME}'">
                            SetHandler "proxy:unix:/var/lib/php7.4-fpm/web13.sock|fcgi://localhost"
                        </If>
                    </FilesMatch>
                </Directory>
                </IfModule>
    
    
    
            # add support for apache mpm_itk
            <IfModule mpm_itk_module>
                AssignUserId web13 client1
            </IfModule>
    
            <IfModule mod_dav_fs.c>
            # Do not execute PHP files in webdav directory
                <Directory /var/www/clients/client1/web13/webdav>
                    <ifModule mod_security2.c>
                        SecRuleRemoveById 960015
                        SecRuleRemoveById 960032
                    </ifModule>
                    <FilesMatch "\.ph(p3?|tml)$">
                        SetHandler None
                    </FilesMatch>
                </Directory>
                DavLockDB /var/www/clients/client1/web13/tmp/DavLock
                # DO NOT REMOVE THE COMMENTS!
                # IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
          # WEBDAV BEGIN
                # WEBDAV END
            </IfModule>
    
                DocumentRoot "/var/www/clients/client1/web13/web/public"
        
    
    </VirtualHost>
    
    
    
    
    
     
  9. JULINT

    JULINT Member

    I have created A record "demo".. and i still got 404
     
  10. JULINT

    JULINT Member

    it was the same web11:client1
     
  11. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    As said, DNS is not the issue.

    Add demo.simura.id as alias domain instead of a separate web.
     
  12. JULINT

    JULINT Member

    I got this error:
    There is already a website or sub / aliasdomain with this domain name.

    Do i need to delete subdomain for demo first ?
     
  13. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Yes.
     
  14. JULINT

    JULINT Member

    I have fixed .htaccess and it is working now.
     

Share This Page