Vhosts not found via web, ok locally

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
1
down vote

favorite












Using examples from DigitalOcean, Rackspace and others, I have (repeatedly) setup a server to provide name-based Vhosts. I have several domains registered and forwarded to my current public IP address, but any attempt to access any of them via the web results in only the default host of last resort responding.



I added the server's public IP address and the domain names to another local computer OS's hosts file, and all websites appear to be functioning fine via local access.



Since this is my first stab at web hosting, I am limited in knowing what to try next. It seems that since LAN access functions OK (with the server info added to the hosts file) and from www the server is found and requests are processed, the settings are at least close to correct. I'm thinking there's a .conf file or some such that just isn't quite right. Or perhaps router port forwarding?



Any suggestions? Any code snippets I should add here to help clarify?




Update. Here is my Virtual Host .conf file:



# domain: example.com 
# public: /var/www/example.com/html
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/html
LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log
CustomLog /var/log/apache2/access-mydomainname.com.log combined
</VirtualHost>









share|improve this question























  • Could you show us your Virtual Host .conf file? It must be in /etc/apache2/sites-enabled/. And yes you need to do port forwarding from your router (that has a public IP) to the server in your LAN (that has only local IP). The ports for HTTP/HTTPS are 80 and 443. Please read this answer and especially the last section (Nr.6).
    – pa4080
    Mar 24 at 12:17










  • @pa4080 Thanks for offering ideas... content of my .conf in site-enabled:
    – Steve124
    Mar 25 at 12:50










  • # domain: example.com # public: /var/www/example.com/html <VirtualHost *:80> ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/html LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log CustomLog /var/log/apache2/access-mydomainname.com.log combined </VirtualHost>
    – Steve124
    Mar 25 at 12:51










  • The router port forwarding seems to be OK, as accesses resolve at least to the default... BTW, apologies for format of these notes. I'll endeavor to learn hoe to copy/paste here.
    – Steve124
    Mar 25 at 12:56










  • You can use the edit button under the question/answer to make changes/updates inside.
    – pa4080
    Mar 25 at 12:59














up vote
1
down vote

favorite












Using examples from DigitalOcean, Rackspace and others, I have (repeatedly) setup a server to provide name-based Vhosts. I have several domains registered and forwarded to my current public IP address, but any attempt to access any of them via the web results in only the default host of last resort responding.



I added the server's public IP address and the domain names to another local computer OS's hosts file, and all websites appear to be functioning fine via local access.



Since this is my first stab at web hosting, I am limited in knowing what to try next. It seems that since LAN access functions OK (with the server info added to the hosts file) and from www the server is found and requests are processed, the settings are at least close to correct. I'm thinking there's a .conf file or some such that just isn't quite right. Or perhaps router port forwarding?



Any suggestions? Any code snippets I should add here to help clarify?




Update. Here is my Virtual Host .conf file:



# domain: example.com 
# public: /var/www/example.com/html
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/html
LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log
CustomLog /var/log/apache2/access-mydomainname.com.log combined
</VirtualHost>









share|improve this question























  • Could you show us your Virtual Host .conf file? It must be in /etc/apache2/sites-enabled/. And yes you need to do port forwarding from your router (that has a public IP) to the server in your LAN (that has only local IP). The ports for HTTP/HTTPS are 80 and 443. Please read this answer and especially the last section (Nr.6).
    – pa4080
    Mar 24 at 12:17










  • @pa4080 Thanks for offering ideas... content of my .conf in site-enabled:
    – Steve124
    Mar 25 at 12:50










  • # domain: example.com # public: /var/www/example.com/html <VirtualHost *:80> ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/html LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log CustomLog /var/log/apache2/access-mydomainname.com.log combined </VirtualHost>
    – Steve124
    Mar 25 at 12:51










  • The router port forwarding seems to be OK, as accesses resolve at least to the default... BTW, apologies for format of these notes. I'll endeavor to learn hoe to copy/paste here.
    – Steve124
    Mar 25 at 12:56










  • You can use the edit button under the question/answer to make changes/updates inside.
    – pa4080
    Mar 25 at 12:59












up vote
1
down vote

favorite









up vote
1
down vote

favorite











Using examples from DigitalOcean, Rackspace and others, I have (repeatedly) setup a server to provide name-based Vhosts. I have several domains registered and forwarded to my current public IP address, but any attempt to access any of them via the web results in only the default host of last resort responding.



I added the server's public IP address and the domain names to another local computer OS's hosts file, and all websites appear to be functioning fine via local access.



Since this is my first stab at web hosting, I am limited in knowing what to try next. It seems that since LAN access functions OK (with the server info added to the hosts file) and from www the server is found and requests are processed, the settings are at least close to correct. I'm thinking there's a .conf file or some such that just isn't quite right. Or perhaps router port forwarding?



Any suggestions? Any code snippets I should add here to help clarify?




Update. Here is my Virtual Host .conf file:



# domain: example.com 
# public: /var/www/example.com/html
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/html
LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log
CustomLog /var/log/apache2/access-mydomainname.com.log combined
</VirtualHost>









share|improve this question















Using examples from DigitalOcean, Rackspace and others, I have (repeatedly) setup a server to provide name-based Vhosts. I have several domains registered and forwarded to my current public IP address, but any attempt to access any of them via the web results in only the default host of last resort responding.



I added the server's public IP address and the domain names to another local computer OS's hosts file, and all websites appear to be functioning fine via local access.



Since this is my first stab at web hosting, I am limited in knowing what to try next. It seems that since LAN access functions OK (with the server info added to the hosts file) and from www the server is found and requests are processed, the settings are at least close to correct. I'm thinking there's a .conf file or some such that just isn't quite right. Or perhaps router port forwarding?



Any suggestions? Any code snippets I should add here to help clarify?




Update. Here is my Virtual Host .conf file:



# domain: example.com 
# public: /var/www/example.com/html
<VirtualHost *:80>
ServerAdmin admin@example.com
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example.com/html
LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log
CustomLog /var/log/apache2/access-mydomainname.com.log combined
</VirtualHost>






server apache2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 25 at 12:57









pa4080

12.3k52256




12.3k52256










asked Mar 22 at 23:53









Steve124

164




164











  • Could you show us your Virtual Host .conf file? It must be in /etc/apache2/sites-enabled/. And yes you need to do port forwarding from your router (that has a public IP) to the server in your LAN (that has only local IP). The ports for HTTP/HTTPS are 80 and 443. Please read this answer and especially the last section (Nr.6).
    – pa4080
    Mar 24 at 12:17










  • @pa4080 Thanks for offering ideas... content of my .conf in site-enabled:
    – Steve124
    Mar 25 at 12:50










  • # domain: example.com # public: /var/www/example.com/html <VirtualHost *:80> ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/html LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log CustomLog /var/log/apache2/access-mydomainname.com.log combined </VirtualHost>
    – Steve124
    Mar 25 at 12:51










  • The router port forwarding seems to be OK, as accesses resolve at least to the default... BTW, apologies for format of these notes. I'll endeavor to learn hoe to copy/paste here.
    – Steve124
    Mar 25 at 12:56










  • You can use the edit button under the question/answer to make changes/updates inside.
    – pa4080
    Mar 25 at 12:59
















  • Could you show us your Virtual Host .conf file? It must be in /etc/apache2/sites-enabled/. And yes you need to do port forwarding from your router (that has a public IP) to the server in your LAN (that has only local IP). The ports for HTTP/HTTPS are 80 and 443. Please read this answer and especially the last section (Nr.6).
    – pa4080
    Mar 24 at 12:17










  • @pa4080 Thanks for offering ideas... content of my .conf in site-enabled:
    – Steve124
    Mar 25 at 12:50










  • # domain: example.com # public: /var/www/example.com/html <VirtualHost *:80> ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/html LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log CustomLog /var/log/apache2/access-mydomainname.com.log combined </VirtualHost>
    – Steve124
    Mar 25 at 12:51










  • The router port forwarding seems to be OK, as accesses resolve at least to the default... BTW, apologies for format of these notes. I'll endeavor to learn hoe to copy/paste here.
    – Steve124
    Mar 25 at 12:56










  • You can use the edit button under the question/answer to make changes/updates inside.
    – pa4080
    Mar 25 at 12:59















Could you show us your Virtual Host .conf file? It must be in /etc/apache2/sites-enabled/. And yes you need to do port forwarding from your router (that has a public IP) to the server in your LAN (that has only local IP). The ports for HTTP/HTTPS are 80 and 443. Please read this answer and especially the last section (Nr.6).
– pa4080
Mar 24 at 12:17




Could you show us your Virtual Host .conf file? It must be in /etc/apache2/sites-enabled/. And yes you need to do port forwarding from your router (that has a public IP) to the server in your LAN (that has only local IP). The ports for HTTP/HTTPS are 80 and 443. Please read this answer and especially the last section (Nr.6).
– pa4080
Mar 24 at 12:17












@pa4080 Thanks for offering ideas... content of my .conf in site-enabled:
– Steve124
Mar 25 at 12:50




@pa4080 Thanks for offering ideas... content of my .conf in site-enabled:
– Steve124
Mar 25 at 12:50












# domain: example.com # public: /var/www/example.com/html <VirtualHost *:80> ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/html LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log CustomLog /var/log/apache2/access-mydomainname.com.log combined </VirtualHost>
– Steve124
Mar 25 at 12:51




# domain: example.com # public: /var/www/example.com/html <VirtualHost *:80> ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/example.com/html LogLevel debug ErrorLog /var/log/apache2/error-mydomainname.com.log CustomLog /var/log/apache2/access-mydomainname.com.log combined </VirtualHost>
– Steve124
Mar 25 at 12:51












The router port forwarding seems to be OK, as accesses resolve at least to the default... BTW, apologies for format of these notes. I'll endeavor to learn hoe to copy/paste here.
– Steve124
Mar 25 at 12:56




The router port forwarding seems to be OK, as accesses resolve at least to the default... BTW, apologies for format of these notes. I'll endeavor to learn hoe to copy/paste here.
– Steve124
Mar 25 at 12:56












You can use the edit button under the question/answer to make changes/updates inside.
– pa4080
Mar 25 at 12:59




You can use the edit button under the question/answer to make changes/updates inside.
– pa4080
Mar 25 at 12:59










2 Answers
2






active

oldest

votes

















up vote
1
down vote













  • Be sure you have the ports open to public. I use ufw and can see the status of my ports with the command ufw status. Reference: UFW Essentials: Common Firewall Rules and Commands | DigitalOcean

  • check that your sites-available are also in your sites-enabled
    How To Configure the Apache Web Server on an Ubuntu or Debian VPS | DigitalOcean

After changes be sure to restart your apache2 server. Your router also needs to allow access to the ports on your computer. You can pretty much follow the guides on the VPS type servers. They are the same for a local hosting computer.






share|improve this answer






















  • Thanks Jack. Ufw status reports inactive... I take that as a bad thing, am checking into the links you provided.
    – Steve124
    Mar 23 at 0:53










  • All files are present in sites-enabled - local access couldn't work without them being there. Router is letting www accesses in - they just are not resulting in successful access, hence the default site responses.
    – Steve124
    Mar 23 at 0:56










  • It is activated by ufw enable. Activate it and check status. If your ports are not open you will probably want to use the command ufw allow 80/tcp Then restart your apache2 server.
    – JackNorthrup
    Mar 23 at 0:57










  • Enabled ufw, allowed http/https/80/tcp. No improvement
    – Steve124
    Mar 23 at 1:08










  • You can use this URL to see if your port is open canyouseeme.org
    – JackNorthrup
    Mar 23 at 1:14

















up vote
1
down vote













Problem is resolved. Solution was to properly configure the DNS records for the sites with my registrar. I had not set the IP address for the A record in the proper field - the manager's menu allowed for two different ways to do this, and I had not picked the correct method.



Thanks to @JackNorthrup and @pa4080 for their kind assistance!






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "89"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1018397%2fvhosts-not-found-via-web-ok-locally%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    1
    down vote













    • Be sure you have the ports open to public. I use ufw and can see the status of my ports with the command ufw status. Reference: UFW Essentials: Common Firewall Rules and Commands | DigitalOcean

    • check that your sites-available are also in your sites-enabled
      How To Configure the Apache Web Server on an Ubuntu or Debian VPS | DigitalOcean

    After changes be sure to restart your apache2 server. Your router also needs to allow access to the ports on your computer. You can pretty much follow the guides on the VPS type servers. They are the same for a local hosting computer.






    share|improve this answer






















    • Thanks Jack. Ufw status reports inactive... I take that as a bad thing, am checking into the links you provided.
      – Steve124
      Mar 23 at 0:53










    • All files are present in sites-enabled - local access couldn't work without them being there. Router is letting www accesses in - they just are not resulting in successful access, hence the default site responses.
      – Steve124
      Mar 23 at 0:56










    • It is activated by ufw enable. Activate it and check status. If your ports are not open you will probably want to use the command ufw allow 80/tcp Then restart your apache2 server.
      – JackNorthrup
      Mar 23 at 0:57










    • Enabled ufw, allowed http/https/80/tcp. No improvement
      – Steve124
      Mar 23 at 1:08










    • You can use this URL to see if your port is open canyouseeme.org
      – JackNorthrup
      Mar 23 at 1:14














    up vote
    1
    down vote













    • Be sure you have the ports open to public. I use ufw and can see the status of my ports with the command ufw status. Reference: UFW Essentials: Common Firewall Rules and Commands | DigitalOcean

    • check that your sites-available are also in your sites-enabled
      How To Configure the Apache Web Server on an Ubuntu or Debian VPS | DigitalOcean

    After changes be sure to restart your apache2 server. Your router also needs to allow access to the ports on your computer. You can pretty much follow the guides on the VPS type servers. They are the same for a local hosting computer.






    share|improve this answer






















    • Thanks Jack. Ufw status reports inactive... I take that as a bad thing, am checking into the links you provided.
      – Steve124
      Mar 23 at 0:53










    • All files are present in sites-enabled - local access couldn't work without them being there. Router is letting www accesses in - they just are not resulting in successful access, hence the default site responses.
      – Steve124
      Mar 23 at 0:56










    • It is activated by ufw enable. Activate it and check status. If your ports are not open you will probably want to use the command ufw allow 80/tcp Then restart your apache2 server.
      – JackNorthrup
      Mar 23 at 0:57










    • Enabled ufw, allowed http/https/80/tcp. No improvement
      – Steve124
      Mar 23 at 1:08










    • You can use this URL to see if your port is open canyouseeme.org
      – JackNorthrup
      Mar 23 at 1:14












    up vote
    1
    down vote










    up vote
    1
    down vote









    • Be sure you have the ports open to public. I use ufw and can see the status of my ports with the command ufw status. Reference: UFW Essentials: Common Firewall Rules and Commands | DigitalOcean

    • check that your sites-available are also in your sites-enabled
      How To Configure the Apache Web Server on an Ubuntu or Debian VPS | DigitalOcean

    After changes be sure to restart your apache2 server. Your router also needs to allow access to the ports on your computer. You can pretty much follow the guides on the VPS type servers. They are the same for a local hosting computer.






    share|improve this answer














    • Be sure you have the ports open to public. I use ufw and can see the status of my ports with the command ufw status. Reference: UFW Essentials: Common Firewall Rules and Commands | DigitalOcean

    • check that your sites-available are also in your sites-enabled
      How To Configure the Apache Web Server on an Ubuntu or Debian VPS | DigitalOcean

    After changes be sure to restart your apache2 server. Your router also needs to allow access to the ports on your computer. You can pretty much follow the guides on the VPS type servers. They are the same for a local hosting computer.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 23 at 7:54









    Drakonoved

    7421515




    7421515










    answered Mar 23 at 0:49









    JackNorthrup

    137




    137











    • Thanks Jack. Ufw status reports inactive... I take that as a bad thing, am checking into the links you provided.
      – Steve124
      Mar 23 at 0:53










    • All files are present in sites-enabled - local access couldn't work without them being there. Router is letting www accesses in - they just are not resulting in successful access, hence the default site responses.
      – Steve124
      Mar 23 at 0:56










    • It is activated by ufw enable. Activate it and check status. If your ports are not open you will probably want to use the command ufw allow 80/tcp Then restart your apache2 server.
      – JackNorthrup
      Mar 23 at 0:57










    • Enabled ufw, allowed http/https/80/tcp. No improvement
      – Steve124
      Mar 23 at 1:08










    • You can use this URL to see if your port is open canyouseeme.org
      – JackNorthrup
      Mar 23 at 1:14
















    • Thanks Jack. Ufw status reports inactive... I take that as a bad thing, am checking into the links you provided.
      – Steve124
      Mar 23 at 0:53










    • All files are present in sites-enabled - local access couldn't work without them being there. Router is letting www accesses in - they just are not resulting in successful access, hence the default site responses.
      – Steve124
      Mar 23 at 0:56










    • It is activated by ufw enable. Activate it and check status. If your ports are not open you will probably want to use the command ufw allow 80/tcp Then restart your apache2 server.
      – JackNorthrup
      Mar 23 at 0:57










    • Enabled ufw, allowed http/https/80/tcp. No improvement
      – Steve124
      Mar 23 at 1:08










    • You can use this URL to see if your port is open canyouseeme.org
      – JackNorthrup
      Mar 23 at 1:14















    Thanks Jack. Ufw status reports inactive... I take that as a bad thing, am checking into the links you provided.
    – Steve124
    Mar 23 at 0:53




    Thanks Jack. Ufw status reports inactive... I take that as a bad thing, am checking into the links you provided.
    – Steve124
    Mar 23 at 0:53












    All files are present in sites-enabled - local access couldn't work without them being there. Router is letting www accesses in - they just are not resulting in successful access, hence the default site responses.
    – Steve124
    Mar 23 at 0:56




    All files are present in sites-enabled - local access couldn't work without them being there. Router is letting www accesses in - they just are not resulting in successful access, hence the default site responses.
    – Steve124
    Mar 23 at 0:56












    It is activated by ufw enable. Activate it and check status. If your ports are not open you will probably want to use the command ufw allow 80/tcp Then restart your apache2 server.
    – JackNorthrup
    Mar 23 at 0:57




    It is activated by ufw enable. Activate it and check status. If your ports are not open you will probably want to use the command ufw allow 80/tcp Then restart your apache2 server.
    – JackNorthrup
    Mar 23 at 0:57












    Enabled ufw, allowed http/https/80/tcp. No improvement
    – Steve124
    Mar 23 at 1:08




    Enabled ufw, allowed http/https/80/tcp. No improvement
    – Steve124
    Mar 23 at 1:08












    You can use this URL to see if your port is open canyouseeme.org
    – JackNorthrup
    Mar 23 at 1:14




    You can use this URL to see if your port is open canyouseeme.org
    – JackNorthrup
    Mar 23 at 1:14












    up vote
    1
    down vote













    Problem is resolved. Solution was to properly configure the DNS records for the sites with my registrar. I had not set the IP address for the A record in the proper field - the manager's menu allowed for two different ways to do this, and I had not picked the correct method.



    Thanks to @JackNorthrup and @pa4080 for their kind assistance!






    share|improve this answer
























      up vote
      1
      down vote













      Problem is resolved. Solution was to properly configure the DNS records for the sites with my registrar. I had not set the IP address for the A record in the proper field - the manager's menu allowed for two different ways to do this, and I had not picked the correct method.



      Thanks to @JackNorthrup and @pa4080 for their kind assistance!






      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        Problem is resolved. Solution was to properly configure the DNS records for the sites with my registrar. I had not set the IP address for the A record in the proper field - the manager's menu allowed for two different ways to do this, and I had not picked the correct method.



        Thanks to @JackNorthrup and @pa4080 for their kind assistance!






        share|improve this answer












        Problem is resolved. Solution was to properly configure the DNS records for the sites with my registrar. I had not set the IP address for the A record in the proper field - the manager's menu allowed for two different ways to do this, and I had not picked the correct method.



        Thanks to @JackNorthrup and @pa4080 for their kind assistance!







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 13:56









        Steve124

        164




        164



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1018397%2fvhosts-not-found-via-web-ok-locally%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            pylint3 and pip3 broken

            Missing snmpget and snmpwalk

            How to enroll fingerprints to Ubuntu 17.10 with VFS491