Vhosts not found via web, ok locally
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>
server apache2
 |Â
show 7 more comments
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>
server apache2
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
 |Â
show 7 more comments
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>
server apache2
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
server apache2
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
 |Â
show 7 more comments
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
 |Â
show 7 more comments
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.
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
add a comment |Â
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!
add a comment |Â
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.
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
add a comment |Â
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.
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
add a comment |Â
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.
- 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.
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
add a comment |Â
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
add a comment |Â
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!
add a comment |Â
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!
add a comment |Â
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!
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!
answered Mar 25 at 13:56
Steve124
164
164
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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