dongxianrang9269 2016-08-08 13:55
浏览 126

MacOS X Yosemite Apache localhost ERR_CONNECTION_REFUSED

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?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?
    • ¥20 java项目连接sqlserver时报ssl相关错误
    • ¥15 一道python难题3
    • ¥15 牛顿斯科特系数表表示
    • ¥15 arduino 步进电机
    • ¥20 程序进入HardFault_Handler
    • ¥15 关于#python#的问题:自动化测试