apache2 localhost refused to connectHow to open ports for outside traffic?Virtual Hosts Not Working...

How do I draw the dashed lines as shown in this figure

Crontab: Ubuntu running script (noob)

How much mayhem could I cause as a sentient fish?

Why are the books in the Game of Thrones citadel library shelved spine inwards?

A Missing Symbol for This Logo

Square Root Distance from Integers

Strange "DuckDuckGo dork" takes me to random website

Can I announce prefix 161.117.25.0/24 even though I don't have all of /24 IPs?

Non-Cancer terminal illness that can affect young (age 10-13) girls?

Do "fields" always combine by addition?

Early credit roll before the end of the film

New package vs new version?

What is a good reason for every spaceship to carry a weapon on board?

Would tunnel walls be stronger if built using cut granite block walls reinforced with carbon based cords?

Why does magnet wire need to be insulated?

Is this ordinary workplace experiences for a job in Software Engineering?

Is there any risk in sharing info about technologies and products we use with a supplier?

Why is it that Bernie Sanders is always called a "socialist"?

Why does photorec keep finding files after I have filled the disk free space as root?

Play Zip, Zap, Zop

Line of Bones to Travel and Conform to Curve (Like Train on a Track...)

Identify KNO3 and KH2PO4 at home

Is a new boolean field better than null reference when a value can be meaningfully absent?

In Linux what happens if 1000 files in a directory are moved to another location while another 300 files were added to the source directory?



apache2 localhost refused to connect


How to open ports for outside traffic?Virtual Hosts Not Working (12.10)apache2 not starting after purge and re-installI can't get wordpress on working on a apache! Please help!Unable to access remotely (LAMP issue)Apache, problem Failed to start LSB: Apache2 web serverCannot ssh remotely into Ubuntu 14.04 Desktop (connection refused)Get Apache2 running with nginx as reverse proxyApache2 HTTP Ubuntu Won't RestartCan't access my website after server release-upgrade to 18.04 from 16.04 (droplet)













1















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.










share|improve this question
















bumped to the homepage by Community 14 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • 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











  • 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
















1















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.










share|improve this question
















bumped to the homepage by Community 14 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • 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











  • 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














1












1








1








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.










share|improve this question
















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 21 '17 at 14:28









pa4080

14.3k52669




14.3k52669










asked Jun 21 '17 at 13:50









Pat DPat D

612




612





bumped to the homepage by Community 14 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 14 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • 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











  • 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



















  • 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











  • 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

















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










1 Answer
1






active

oldest

votes


















0














Change the Listen 80in 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.






share|improve this answer


























  • Sadly that didn't work either. Still receiving the same connection error.

    – Pat D
    Jun 21 '17 at 16:53











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',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
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%2f927754%2fapache2-localhost-refused-to-connect%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Change the Listen 80in 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.






share|improve this answer


























  • Sadly that didn't work either. Still receiving the same connection error.

    – Pat D
    Jun 21 '17 at 16:53
















0














Change the Listen 80in 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.






share|improve this answer


























  • Sadly that didn't work either. Still receiving the same connection error.

    – Pat D
    Jun 21 '17 at 16:53














0












0








0







Change the Listen 80in 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.






share|improve this answer















Change the Listen 80in 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.







share|improve this answer














share|improve this answer



share|improve this answer








edited Aug 20 '18 at 9:45









terdon

66.4k12138221




66.4k12138221










answered Jun 21 '17 at 14:56









byteborgbyteborg

70066




70066













  • 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





Sadly that didn't work either. Still receiving the same connection error.

– Pat D
Jun 21 '17 at 16:53


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

Simple Scan not detecting my scanner (Brother DCP-7055W)Brother MFC-L2700DW printer can print, can't...