1

I don't really know what to send you here so please ask. The problem is I cannot access my local apache2 webserver neither via localhost or my machine's hostname nor via 127.0.0.1. At first I could actually access it through my hostname (andrey-desktop) but the problem was that it leads to a different IP-address (127.0.0.53) and other hostnames lead to the default one (127.0.0.1). I couldn't set up my .htaccess to work so I changed stuff in apache2.conf from AllowOverride None to All and now it doesn't open at all. The error is ERR_CONNECTION_REFUSED. Also while I was trying to fix this myself there was a PHPMyAdmin tab opened in my browser and all the time it successfully loaded, even now I can access it while I can't open the site itself.

# This file is managed by man:systemd-resolved(8). Do not edit.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs must not access this file directly, but only through the
# symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a different way,
# replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf.

nameserver 127.0.0.53
options edns0 trust-ad
Wolterhon
  • 11
  • 2
  • After changing to `AllowOverride All`, you might need to run `sudo a2enmod rewrite` to enable module rewrite. – Raffa Dec 13 '20 at 10:44
  • @Raffa Still can't reach my site. Also I tried https://askubuntu.com/a/753109/1157382 didn't help too. – Wolterhon Dec 13 '20 at 10:47
  • [AllowOverride](https://httpd.apache.org/docs/2.4/mod/core.html#allowoverride) is to deal with enable/disable `.htaccess` files and it should work for this purpose. But after reading your post again, your issue is different. You do not need to change `AllowOverride` to resolve it. Please add the output of `cat /etc/resolv.conf` to your question. – Raffa Dec 13 '20 at 11:04
  • Does this answer your question? [DNS set to systemd's 127.0.0.53 - how to change permanently?](https://askubuntu.com/questions/1012641/dns-set-to-systemds-127-0-0-53-how-to-change-permanently) – Raffa Dec 13 '20 at 11:22
  • @Raffa I've done what you asked. – Wolterhon Dec 13 '20 at 11:22
  • Not really because I have the problem that it doesn't open at all, even with .53 address. – Wolterhon Dec 13 '20 at 11:22
  • You might need to undo changes you made to `apache2.conf` first then restart apache and apply the solution in the link as this appears to be DNS issue and apache. – Raffa Dec 13 '20 at 11:25
  • I'm terribly sorry I took your time, I was too pissed off and just reinstalled it. Thank you so much for your attention and for trying to help me! – Wolterhon Jan 06 '21 at 19:14

0 Answers0