In the list click httpd and select Block incoming connections.Hit cmd ⌘ + ⇧ shift + G and enter /usr/sbin/httpd and click Add (If httpd doesn't show up there, you can look for it in the terminal by which httpd). #Mac os x apache user.conf passwordClick the lock icon to the lower left and enter your password if needed.Open System Preferences » Security & Privacy » Firewall.Again, in nf: Listen 80Īnd restart Apache again: $ sudo apachectl restartĭisable Apache in the application firewall (note that you may have already disabled it if you clicked Deny if/when it was asked during the first time you run Apache): In fact, you should prevent this regardless of the scripts you run or even if you don't set Apache user to yourself since you probably don't want random outsiders to be able to see the contents of your localhost. ![]() But since this is just a local development environment, that shouldn't be a problem unless you have no rules to block Apache in your firewall and let questionable files like file explorers, shells, scripts that may contain vulnerabilities run under Apache in which case anyone including your public wifi neighbor in a cafe can enter and do whatever those scripts let them to do. Own them: $ sudo chown joao: /var/tmp/sess_*Īfter this, Apache (and PHP et al.) will run as you and will gain read/write permission to all of the files you have read/write permission. If you have active sessions, they are going to give permission errors since they are still owned by _www. In /private/etc/apache2/nf, set User to your username from _User _wwwĪnd then restart Apache: $ sudo apachectl restart ![]() I generally fix this by setting the Apache user to myself in local environments and in machines where the only user who uses Apache is me. I spent a long while chmodding and messing with _Eventually, I just checked the "shared folder" checkbox in the Finder for that folder, and it worked, on the specified domain, with php active, the way I wanted it to. I have an alias specified in OSX server pointing to a user directory.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |