I'm trying my hand at HTML and PHP. My goal is to create a password protected site that gets gif-images from the server and displays them in a table. Nothing to fancy. For this to work I tried PHP. To test this locally (I don't have a server anyway) I set up my localhost as described here: https://ole.michelsen.dk/blog/setup-local-web-server-apache-php-osx-yosemite.html.
Everything worked well, no problems whatsoever. Then I tried to setup a password protection for my local site. I created a .htaccess file and saved it in my site-directory with this content:
AuthType Basic
AuthName "Restricted Area"
AuthUserFile htpasswd
require valid-user
Then I created a .htpasswd in the same directory and manually inserted a user/password that I generated here: http://www.web2generators.com/apache-tools/htpasswd-generator.
I saved both files and refreshed my page. I was prompted to enter a username and password which I entered. Since then I get a message in my browser that localhost refused the connection "ERR_CONNECTION_REFUSED".
Now I can't access localhost anymore. The same error occurs. I tried to restart apache. Then I tried simply restarting my computer. Afterwards I tried to go through the guide again from the beginning. What could be the problem? Is there a way to simply reset my apache to defaults?