apache2 localhost refused to connect
up vote
1
down vote
favorite
I'm installing apache2.4 on Ubuntu 16.04 with a custom cookbook in Chef. I cannot connect to localhost after a fresh converge, and I'm not having Chef modify any configuration files until I figure out why I cannot connect. I expect to see the default index.html landing page, but nothing works. I can ssh into my vagrant machine, but my browser will not load anything from the server. By the end of this I would like to have my own HTML file that I had Chef build in /var/www/html/
act as the landing page for my Apache server.
Below are a few methods I have already attempted:
I have ran wget localhost
and 127.0.0.1 always outputs:
--2017-06-21 08:40:05-- http://localhost/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... failed: Connection refused.
Running sudo systemctl status apache2
in my VM outputs:
Active: active (running) since Wed 2017-06-21 12:17:31 UTC; 31min ago
Running ps -ef | grep apache
in my VM outputs:
root 12881 1 0 12:17 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 12884 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
www-data 12885 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
vagrant 13125 13109 0 13:08 pts/0 00:00:00 grep --color=auto apache
Running netstat -a | grep less
in my VM returns:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 10.0.2.15:ssh 10.0.2.2:40222 ESTABLISHED
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 *:bootpc *:*
I have previously attempted to modify the config files in
/etc/apache2/apache2.conf
/etc/apache2/sites-enabled/000-default.conf
Lastly, I have checked permissions on /var/www
and /var/www/html
, and they're all 0755
All the above have lacked any form of success. Please help. Before you ask, yes I did restart the apache process after every modification to the server.
server apache2 chef
add a comment |
up vote
1
down vote
favorite
I'm installing apache2.4 on Ubuntu 16.04 with a custom cookbook in Chef. I cannot connect to localhost after a fresh converge, and I'm not having Chef modify any configuration files until I figure out why I cannot connect. I expect to see the default index.html landing page, but nothing works. I can ssh into my vagrant machine, but my browser will not load anything from the server. By the end of this I would like to have my own HTML file that I had Chef build in /var/www/html/
act as the landing page for my Apache server.
Below are a few methods I have already attempted:
I have ran wget localhost
and 127.0.0.1 always outputs:
--2017-06-21 08:40:05-- http://localhost/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... failed: Connection refused.
Running sudo systemctl status apache2
in my VM outputs:
Active: active (running) since Wed 2017-06-21 12:17:31 UTC; 31min ago
Running ps -ef | grep apache
in my VM outputs:
root 12881 1 0 12:17 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 12884 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
www-data 12885 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
vagrant 13125 13109 0 13:08 pts/0 00:00:00 grep --color=auto apache
Running netstat -a | grep less
in my VM returns:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 10.0.2.15:ssh 10.0.2.2:40222 ESTABLISHED
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 *:bootpc *:*
I have previously attempted to modify the config files in
/etc/apache2/apache2.conf
/etc/apache2/sites-enabled/000-default.conf
Lastly, I have checked permissions on /var/www
and /var/www/html
, and they're all 0755
All the above have lacked any form of success. Please help. Before you ask, yes I did restart the apache process after every modification to the server.
server apache2 chef
There's aListen
directive in your Apache configuration files. What does it say? My guess is, that Apache is listening to IPv6 only. What's your output ofsysctl net.ipv6.bindv6only
?
– byteborg
Jun 21 '17 at 14:08
sysctl net.ipv6.bindv6only
returnsnet.ipv6.bindv6only = 0
– Pat D
Jun 21 '17 at 14:23
My/etc/apache2/ports.conf
containsListen 80
Also, I apologize in advance. I absolutely hate the markdown in this site.
– Pat D
Jun 21 '17 at 14:34
Clarification question: from which machine do you try the wget?
– byteborg
Jun 21 '17 at 17:10
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I'm installing apache2.4 on Ubuntu 16.04 with a custom cookbook in Chef. I cannot connect to localhost after a fresh converge, and I'm not having Chef modify any configuration files until I figure out why I cannot connect. I expect to see the default index.html landing page, but nothing works. I can ssh into my vagrant machine, but my browser will not load anything from the server. By the end of this I would like to have my own HTML file that I had Chef build in /var/www/html/
act as the landing page for my Apache server.
Below are a few methods I have already attempted:
I have ran wget localhost
and 127.0.0.1 always outputs:
--2017-06-21 08:40:05-- http://localhost/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... failed: Connection refused.
Running sudo systemctl status apache2
in my VM outputs:
Active: active (running) since Wed 2017-06-21 12:17:31 UTC; 31min ago
Running ps -ef | grep apache
in my VM outputs:
root 12881 1 0 12:17 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 12884 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
www-data 12885 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
vagrant 13125 13109 0 13:08 pts/0 00:00:00 grep --color=auto apache
Running netstat -a | grep less
in my VM returns:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 10.0.2.15:ssh 10.0.2.2:40222 ESTABLISHED
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 *:bootpc *:*
I have previously attempted to modify the config files in
/etc/apache2/apache2.conf
/etc/apache2/sites-enabled/000-default.conf
Lastly, I have checked permissions on /var/www
and /var/www/html
, and they're all 0755
All the above have lacked any form of success. Please help. Before you ask, yes I did restart the apache process after every modification to the server.
server apache2 chef
I'm installing apache2.4 on Ubuntu 16.04 with a custom cookbook in Chef. I cannot connect to localhost after a fresh converge, and I'm not having Chef modify any configuration files until I figure out why I cannot connect. I expect to see the default index.html landing page, but nothing works. I can ssh into my vagrant machine, but my browser will not load anything from the server. By the end of this I would like to have my own HTML file that I had Chef build in /var/www/html/
act as the landing page for my Apache server.
Below are a few methods I have already attempted:
I have ran wget localhost
and 127.0.0.1 always outputs:
--2017-06-21 08:40:05-- http://localhost/
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:80... failed: Connection refused.
Running sudo systemctl status apache2
in my VM outputs:
Active: active (running) since Wed 2017-06-21 12:17:31 UTC; 31min ago
Running ps -ef | grep apache
in my VM outputs:
root 12881 1 0 12:17 ? 00:00:00 /usr/sbin/apache2 -k start
www-data 12884 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
www-data 12885 12881 0 12:17 ? 00:00:01 /usr/sbin/apache2 -k start
vagrant 13125 13109 0 13:08 pts/0 00:00:00 grep --color=auto apache
Running netstat -a | grep less
in my VM returns:
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 10.0.2.15:ssh 10.0.2.2:40222 ESTABLISHED
tcp6 0 0 [::]:http [::]:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
udp 0 0 *:bootpc *:*
I have previously attempted to modify the config files in
/etc/apache2/apache2.conf
/etc/apache2/sites-enabled/000-default.conf
Lastly, I have checked permissions on /var/www
and /var/www/html
, and they're all 0755
All the above have lacked any form of success. Please help. Before you ask, yes I did restart the apache process after every modification to the server.
server apache2 chef
server apache2 chef
edited Jun 21 '17 at 14:28
pa4080
12.9k52460
12.9k52460
asked Jun 21 '17 at 13:50
Pat D
612
612
There's aListen
directive in your Apache configuration files. What does it say? My guess is, that Apache is listening to IPv6 only. What's your output ofsysctl net.ipv6.bindv6only
?
– byteborg
Jun 21 '17 at 14:08
sysctl net.ipv6.bindv6only
returnsnet.ipv6.bindv6only = 0
– Pat D
Jun 21 '17 at 14:23
My/etc/apache2/ports.conf
containsListen 80
Also, I apologize in advance. I absolutely hate the markdown in this site.
– Pat D
Jun 21 '17 at 14:34
Clarification question: from which machine do you try the wget?
– byteborg
Jun 21 '17 at 17:10
add a comment |
There's aListen
directive in your Apache configuration files. What does it say? My guess is, that Apache is listening to IPv6 only. What's your output ofsysctl net.ipv6.bindv6only
?
– byteborg
Jun 21 '17 at 14:08
sysctl net.ipv6.bindv6only
returnsnet.ipv6.bindv6only = 0
– Pat D
Jun 21 '17 at 14:23
My/etc/apache2/ports.conf
containsListen 80
Also, I apologize in advance. I absolutely hate the markdown in this site.
– Pat D
Jun 21 '17 at 14:34
Clarification question: from which machine do you try the wget?
– byteborg
Jun 21 '17 at 17:10
There's a
Listen
directive in your Apache configuration files. What does it say? My guess is, that Apache is listening to IPv6 only. What's your output of sysctl net.ipv6.bindv6only
?– byteborg
Jun 21 '17 at 14:08
There's a
Listen
directive in your Apache configuration files. What does it say? My guess is, that Apache is listening to IPv6 only. What's your output of sysctl net.ipv6.bindv6only
?– byteborg
Jun 21 '17 at 14:08
sysctl net.ipv6.bindv6only
returns net.ipv6.bindv6only = 0
– Pat D
Jun 21 '17 at 14:23
sysctl net.ipv6.bindv6only
returns net.ipv6.bindv6only = 0
– Pat D
Jun 21 '17 at 14:23
My
/etc/apache2/ports.conf
contains Listen 80
Also, I apologize in advance. I absolutely hate the markdown in this site.– Pat D
Jun 21 '17 at 14:34
My
/etc/apache2/ports.conf
contains Listen 80
Also, I apologize in advance. I absolutely hate the markdown in this site.– Pat D
Jun 21 '17 at 14:34
Clarification question: from which machine do you try the wget?
– byteborg
Jun 21 '17 at 17:10
Clarification question: from which machine do you try the wget?
– byteborg
Jun 21 '17 at 17:10
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Change the Listen 80
in your /etc/apache2/ports.conf
file to Listen 0.0.0.0:80
and it should bind to an IPv4 socket. Nevertheless, Apache will no longer be reachable via IPv6 in this case.
Sadly that didn't work either. Still receiving the same connection error.
– Pat D
Jun 21 '17 at 16:53
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Change the Listen 80
in your /etc/apache2/ports.conf
file to Listen 0.0.0.0:80
and it should bind to an IPv4 socket. Nevertheless, Apache will no longer be reachable via IPv6 in this case.
Sadly that didn't work either. Still receiving the same connection error.
– Pat D
Jun 21 '17 at 16:53
add a comment |
up vote
0
down vote
Change the Listen 80
in your /etc/apache2/ports.conf
file to Listen 0.0.0.0:80
and it should bind to an IPv4 socket. Nevertheless, Apache will no longer be reachable via IPv6 in this case.
Sadly that didn't work either. Still receiving the same connection error.
– Pat D
Jun 21 '17 at 16:53
add a comment |
up vote
0
down vote
up vote
0
down vote
Change the Listen 80
in your /etc/apache2/ports.conf
file to Listen 0.0.0.0:80
and it should bind to an IPv4 socket. Nevertheless, Apache will no longer be reachable via IPv6 in this case.
Change the Listen 80
in your /etc/apache2/ports.conf
file to Listen 0.0.0.0:80
and it should bind to an IPv4 socket. Nevertheless, Apache will no longer be reachable via IPv6 in this case.
edited Aug 20 at 9:45
terdon♦
63.4k12133210
63.4k12133210
answered Jun 21 '17 at 14:56
byteborg
67165
67165
Sadly that didn't work either. Still receiving the same connection error.
– Pat D
Jun 21 '17 at 16:53
add a comment |
Sadly that didn't work either. Still receiving the same connection error.
– Pat D
Jun 21 '17 at 16:53
Sadly that didn't work either. Still receiving the same connection error.
– Pat D
Jun 21 '17 at 16:53
Sadly that didn't work either. Still receiving the same connection error.
– Pat D
Jun 21 '17 at 16:53
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f927754%2fapache2-localhost-refused-to-connect%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
There's a
Listen
directive in your Apache configuration files. What does it say? My guess is, that Apache is listening to IPv6 only. What's your output ofsysctl net.ipv6.bindv6only
?– byteborg
Jun 21 '17 at 14:08
sysctl net.ipv6.bindv6only
returnsnet.ipv6.bindv6only = 0
– Pat D
Jun 21 '17 at 14:23
My
/etc/apache2/ports.conf
containsListen 80
Also, I apologize in advance. I absolutely hate the markdown in this site.– Pat D
Jun 21 '17 at 14:34
Clarification question: from which machine do you try the wget?
– byteborg
Jun 21 '17 at 17:10