Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Replace/Update default website on OS X Server (Yosemite)

I am certain this comes down to a fundamental lack of understanding on my part, but I cannot for the life of me work out how to replace the default website on OS X Server.

I have read that it is not designed to be replaced, so I have created a new entry in the website list... but with no luck. I followed the instructions here: Setting up a local web server on a Mac but still continue to get 403 errors.


Can anyone point me in the direction of a set of instructions for setting this up? I really (at this stage) only want it to serve locally, not over the internet - which I thought would make it simpler...


Thanks!

Posted on Mar 5, 2015 5:21 AM

Reply
3 replies

Apr 1, 2015 5:39 AM in response to andym2009

Hi - Thanks for the response, I went back to the article and double checked what I'd done. I did find a mistake, but resolving it didn't fix the problem entirely.


Something I noticed was that the article always uses /etc/apache2/users/<your short user name> as the route, but once OS X Server is installed, the new default route is Library/Server/Web/Config right..?


So I tried to complete the same steps listed in the article on the relevant .conf files in that folder, but I'm still missing something. I can now serve a new index.html page (which is definitely progress), but not the one I'm trying to. This makes me think the index page I'm trying to use is calling something that is not permitted under localhost... I just don't know what that would be. The page is based on http://themeroller.jquerymobile.com/ any ideas what the issue might be there? I have saved a local copy of the .js files so it's not accessing the internet for them, but I'm not sure what else I can do to either make the page accessible, or make the server allow it.


Thanks again,

Philip

Apr 1, 2015 6:38 AM in response to Start_point

There's a bit of guesswork on my part here because I have not used OS X Server.


Obviously you've found httpd.conf.


The root directory of the standard web server is defined in there - on OS X it is:


DocumentRoot "/Library/WebServer/Documents"

<Directory "/Library/WebServer/Documents">

...

Require all granted <-------------- means anyone can access it from any domain ----------------->

</Directory>


The instructions to which you are referring I guess are the ones about allowing users to set up their own sites, needing the relevant modules to be activated in that file:


#LoadModule userdir_module libexec/apache2/mod_userdir.so

to

LoadModule userdir_module libexec/apache2/mod_userdir.so


#Include /private/etc/apache2/extra/httpd-userdir.conf

to

Include /private/etc/apache2/extra/httpd-userdir.conf

...then in http-userdir.conf....

#Include /private/etc/apache2/users/*.conf

to

Include /private/etc/apache2/users/*.conf

At this point I am assuming that Apache doesn't really care that this is a user-related issue and so any file ending in .conf in that directory will be included in the Apache Server config (once stopped and started). However, the fact the the site name is then ~shortname suggests the user model is important and access permissions may mean you need to be logged in as that user for all I know.

....in the shortname.conf file in that /private/etc/apache2/users/ directory would be something like this:

<Directory "/Users/shortname/Sites/">

AddLanguage en .en

LanguagePriority en fr de

ForceLanguagePriority Fallback

Options Indexes MultiViews

AllowOverride None

Order allow,deny

Allow from localhost

Require all granted

</Directory>

The relevant directory is /Users/shortname/Sites/ ---- I suggest putting a simple index.html page there to test first.

....then http://localhost/~shortname

.....should work.

Remove the line Allow from localhost and access from elsewhere should also be possible.

I wish I could be more help - but without a server to use and check what I am saying I think that is about all I can offer, and I suspect none of this is new to you.

Andy

Replace/Update default website on OS X Server (Yosemite)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.