Localhost says - It works, but these Localhost/phpmyadmin and localhost/~username:
Safari Can't connect with Server
# Virtual Hosts
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
# Please see the documentation at
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
# Host Database
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
my users/bereshka.conf has
Options Indexes MultiViews FollowSymLinks
Require all granted
Looks like I found the solution myself. Want to share it with all who face the same. Steps that I did:
I replaced the code in httpd.confg , httpd-vhosts.confg , hosts, username.confg to the code from the same files, but of other mac, where has never been done any works with apache. Because for last few days I was editing all that so many times and I already lost the hope to fix it)) It let me to start all from zero. This step solved the problem "Safari Can't connect with Server" , but other error appeared when I go by localhost/~username I get 404 Not Found
I uncommented these lines in httpd.confg
LoadModule authz_core_module libexec/apache2/mod_authz_core.so LoadModule authz_host_module libexec/apache2/mod_authz_host.so LoadModule userdir_module libexec/apache2/mod_userdir.so LoadModule include_module libexec/apache2/mod_include.so LoadModule rewrite_module libexec/apache2/mod_rewrite.so LoadModule php5_module libexec/apache2/libphp5.so
check this article for detailed description of all steps
But this action (in my case) returned again this error - "Server cannot connect.." . I found under above mentioned article in comments that it might be solved if to comment back this line - LoadModule php5_module libexec/apache2/libphp5.so and I did that (I'm on mac Sierra 10.12.6)
That helped )) but when I checked localhost/~username I got a new error 403 Forbidden by link localhost/~username. But when I typed only localhost - It works.
It's obviously problems with permissions and user. So I checked my two files username.conf and bereshka.conf in the folder apache2/users and I set this code (for Apache 2.4) instead of all what was there (/Users/bereshka/Sites/ accordingly)
AllowOverride All Options Indexes MultiViews FollowSymLinks Require all granted
this one doesn't work
<Directory "/Users/username/Sites/"> Options Indexes MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
It's for apache 2.2