-1

I was successful in setting up Apache, php, mysql and homebrew on my Mac Yosemite. For those interested, I followed this tutorial. - In fact, the directory structure was already showing.

I was trying to install Craft CMS, however, it was requiring a PHP Module extension - "mcrypt". I installed it following this tutorial.

That's when the 403 messages popped up.

Any ideas how to resolve this?

Jose
  • 63
  • 11
  • Where does the 403 message appear? Have you changed the default sites path? – Bankzilla May 19 '15 at 23:14
  • @Bankzilla Basically, I followed the above tutorials and a few other "fixes" which I stumbled upon on Stackoverflow. The 403 message appears both on localhost and on /Username/Web/sitename.dev – Jose May 19 '15 at 23:18
  • Since 403 is forbidden, either the project doesn't have correct file permissions to be read by apache/ webuser. Pretty sure by default it's meant to be `localhost/~user/` – Bankzilla May 19 '15 at 23:21
  • @Bankzilla I have a feeling something was rewritten when I was installing the "mycrypt" extension as I didn't have any issue beforehand. Nonetheless, how can I give the project permissions? I have already set the folders chmod to 777. – Jose May 19 '15 at 23:26
  • Looking through the tutorial they don't actually create the virtual host domain name in the hosts file, not sure if this is unique to Yosemite but in `/private/etc/` you would need to add an entry like `127.0.0.1 localhost` and `127.0.0.1 sitename.dev` – Bankzilla May 19 '15 at 23:26
  • The Following was added in the /private/etc/apache2/extra/httpd-vhosts.conf: – Jose May 19 '15 at 23:29
  • @Bankzilla How do I go about adding those entries? Which file should I add them to? – Jose May 19 '15 at 23:31
  • That's creating a vhost you still need to actually create the hosts entry, otherwise when you go to `sitename.dev` it will actually try find the website named that. – Bankzilla May 19 '15 at 23:31
  • Before the mishaps began, `sitename.dev` was working so also as `localhost`. I was getting a directory structure. Am I missing something? – Jose May 19 '15 at 23:33
  • If you comment out the `extension=mcrypt.so` in the php.ini does it work? – Bankzilla May 19 '15 at 23:34
  • @Bankzilla just commented it out and restarted the apache. Still got the same problem. – Jose May 19 '15 at 23:38
  • Not sure what the problem is then, since it seems the issues not with mcrypt. Only other thing i can think of is that '~Web' can't be read by apache – Bankzilla May 19 '15 at 23:41
  • Exact error: `You don't have permission to access / on this server.` – Jose May 19 '15 at 23:41
  • @Bankzilla how can I make `~Web` read by apache? – Jose May 19 '15 at 23:42
  • That's a more helpful error than `403 forbidden` which I assumed you were getting. Check this question [10873295](http://stackoverflow.com/questions/10873295/error-message-forbidden-you-dont-have-permission-to-access-on-this-server) – Bankzilla May 19 '15 at 23:43
  • The reason your question has a downvote (not by me) is because you don't provide much info on what's the cause of the problem. You don't state at what point it was working and then wasn't, the full error message and what you've tried to fix the issue. – Bankzilla May 19 '15 at 23:45
  • @Bankzilla, I assumed 403 was universally known as the forbidden error. Anyways, I have managed to resolve it, I think. I got the directory to list. I had to add the following: – Jose May 20 '15 at 00:00

1 Answers1

1

This works folks! Found it on the link that @bankzilla shared:

<Directory />
    #Options FollowSymLinks
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>
Jose
  • 63
  • 11
  • Note, the `Require all granted` was added as I am on Yosemite. – Jose May 20 '15 at 00:12
  • Specifically, this is required because Yosemite ships with Apache 2.4, whereas previous versions of OSX have used 2.2. See http://stackoverflow.com/a/13923435/1470907 – Stecman May 20 '15 at 01:28