Jason
Jason

Reputation: 556

Apache Configuration on a Mac?

I just bought my first Mac, and I'm trying to set up an apache server. The problem is that I need to configure it like the live server and my work computer (Linux and WinXP, respectively).

Here's the deal. The website's directory is expected to be:

/home/web/companysite/public_html/

But on a Mac, the /home/ directory is taken. Any advice? Is there a way I can reroute it without changing all of my PHP files and other scripts?

Upvotes: 1

Views: 1405

Answers (1)

prodigitalson
prodigitalson

Reputation: 60413

I would us a virtual host for this:

NameVirtualHost *:80

<Directory "/home/web/companysite/public_html">
  AllowOverride All
  Allow from All
</Directory>

<VirtualHost *:80>
  ServerName companysite.local
  DirectoryIndex index.php
  DocumentRoot "/home/web/companysite/public_html"
</VirtualHost>

and then add the host name your your /etc/hosts file:

127.0.0.1 companysite.local

Now, youll also have to create the folder structure and set the permissions appropriately. the User/Group for apache is www so after you have created the dir structure:

sudo chown -R www:www /home/web
sudo chmod -R +a "www allow delete,write,append,file_inherit,directory_inherit"
sudo chmod -R +a "YOUR_USER_NAME allow delete,write,append,file_inherit,directory_inherit"

Upvotes: 2

Related Questions