Page 1 of 1

Virtual Host- domain not connecting.

Posted: Fri Sep 14, 2018 12:09 pm
by Leopard_Pagan
Good afternoon all, I have been pointed in this direction by Paul Barret as we both have been going over my web station and for some reason. something somewhere is missing.
I have 2 web sites for a charity event i run, I registered the domains a while ago & did not opt for hosting.
This week i picked up a 2nd Syno NAS, 1 i use for my own personal stuff which has Q/Connect all set up & has been working for years with no issues. So I knew that when i wanted to host a site, that i'd get another Syno NAS.

From the top...
Domain is www.suffolk-motor-show.co.uk & .com
In Fasthost C-Panel i have set up the A record to point both .co.uk & .com to my static IP (I have biz fibre BBand at home)
I am not sure if i need to set anything else up in the C-Panel?

Web station/Apache 2.4/PHP 7 all installed.
Back end set with both selected as per normal.
PHP profile is ticked for enable cashe & display_error. lower down i have ticked all (for now)
VH i have created 2 sub folders in parent folder web. SMSUK & SMSCOM.
Each domain is linked to its relative sub folder
I then get a pop up about http being able to read permission. I allow/enable/OK

In file station
permissions are
web: http/SYSTEM/users Read (all ticked)/Write (all except the 2 delete)
SMSUK: I am now seeing duplicate http so i delete the read only & set http/SYSTEM/users Read (all ticked)/Write (all except the 2 delete)
SMSCOM: I am now seeing duplicate http so i delete the read only & set http/SYSTEM/users Read (all ticked)/Write (all except the 2 delete)

In web parent folder i have left the web_images folder & generic Index.html
In each sub folder i have a test index.html

Now this is where things go weird...
If you type in ANY of the domains i paid for.. i get the generic DSM "web station is enabled" page that i know lives in the web parent folder.
If i type in my static IP/SMSUK or /SMSCOM..... i then get the test index.
From previous testing, both my domains point to the same generic DSM web station page. (as both are set to same static IP in C-Panel)

Why is my domain that i have pointed to my static IP not talking to my VH?
I have deleted the subs, uninstalled web station/apache 3 times in the last 3 days, re set everything back up & still get the same not connected result.
Paul & I did a Team Viewer session this afternoon as even he is stumped to why its not working.

Hoping we can get to the bottom of this as I know you can run multiple domains/web sites, I have seen other peoples web station VH show they have more than 1 running.. but mine isnt.

Re: Virtual Host- domain not connecting.

Posted: Fri Sep 14, 2018 8:47 pm
by steven
I have not encountered this problem and have multiple sites on one IP address. Unfortunately I will be in Italy next week on business with limited internet access and not much time to help. Although I do not have a static IP, and use DDNS, the virtual host function works the same. Since both registered domain names point to your IP address, the traffic should be read and directed, per virtual hosts, to the appropriate folder. Always use lower case for all host and folder names. I am not an expert on virtual hosts and did some trial and error before getting my sites to work.

Web station status should appear as follows:

Image

Although you did not mention it, setup the General Settings as well. I use Apache for my Virtual Hosts but nginx for general settings.

Image

 
The virtual host should look similar to the following with the document root pointing to the folder you want to access.

Image

When I go to the link in your post, I am directed to the web folder and not a sub-folder so there is definitely a disconnect somewhere.

You can check the virtual host file by going to /usr/local/etc/apache24/sites-enabled/httpd-vhost.conf. There should be a configuration for each host similar to the following:

Code: Select all

<VirtualHost *:80 *:443>
    ServerName www.suffolk-motor-show.co.uk
    SetEnv HOST www.suffolk-motor-show.co.uk
    DocumentRoot "/volume1/web/suffolk_folder_name"
    <IfModule dir_module>
        DirectoryIndex  index.html index.htm index.cgi index.php index.php5
    </IfModule>
    <Directory "/volume1/web/suffolk_folder_name">
        Options MultiViews FollowSymLinks ExecCGI
        AllowOverride All
        <IfModule authz_core_module>
            Require all granted
        </IfModule>
    </Directory>

    <FilesMatch "\.(php[345]?|phtml)$">
        SetHandler "proxy:unix:/run/php-fpm/php-d9b8bcec-a35d-46f1-a786-61f1662d00a4.sock|fcgi://localhost"

    </FilesMatch>
</VirtualHost>
I suggest you do not DO NOT change this file manually. You can view entries, check for typos and verify the host exists.

Re: Virtual Host- domain not connecting.

Posted: Sat Sep 15, 2018 9:52 am
by Leopard_Pagan
IT WORKS!!!!!!!!!!
You Sir are a life saver! as Paul & myself have been trying to figure out what the disconnect has been for last 3-4 days.
Fresh eyes etc etc :D
The 2 things i changed were:
on VH host name i ADDED "www" like you have it in your photo ^^ above.
Sub folder name changed from CAPS to low case...

:mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen: :mrgreen:

Re: Virtual Host- domain not connecting.

Posted: Sat Sep 15, 2018 10:16 am
by steven
I'm glad you have it working. Although I'm not a expert, I get lucky once in a while.

Re: Virtual Host- domain not connecting.

Posted: Sat Sep 15, 2018 10:40 am
by Paul Barrett
Brilliant!

My guess is that it was the lowercase that did the trick. I always use lower case too and I'm amazed that I didn't spot that.

However, we'll never know because you did the classic (and I've done it many times myself) - you changed TWO things at once.

But don't be tempted to go back and undo one, just to see. It ain't broke now so let's not try to fix it! :D :D :D :D :D :D

Re: Virtual Host- domain not connecting.

Posted: Tue Sep 25, 2018 6:30 am
by Leopard_Pagan
My adorable ISP did not set my IP as static... so there is me thinking my DS is randomly changing settings..

Re: Virtual Host- domain not connecting.

Posted: Wed Sep 26, 2018 3:47 pm
by steven
Well, that's not good... I do not have a static IP so I use NO-IP. They have great support and I've never had an issue with any of their services.