Create a website, or have someone do it for you. Copy the website files to your server, then use the Server app to publish your website.
You can secure your website by enabling Secure Sockets Layer (SSL). You can use a self-signed SSL certificate, or use a certificate from a Certificate Authority (CA). For more information, see Use an SSL certificate.
When you turn on Websites service, two default websites are created, and websites that you create and copy to the server are enabled. The first default website responds to all server IP addresses and host names on port 80. The second default SSL website responds to all server IP addresses and host names on port 443. You can use redirects on the first default website to forward web traffic to the second default SSL website. The default websites initially use a placeholder page that you can replace with your own.
If you need a website to use a specific IP address, or if you want to change settings such as the host name, port, or access control, you can create custom websites. For example, you can create multiple custom websites with different host names, serving the same content by sharing the same document root folder.
You can decide who gets to use the service, and from which network. See Server access overview.
The websites you publish with the Server app are also known as virtual hosts.
Select Websites in the Server app sidebar.
Click Add , then use the following settings to customize your website.
Setting | Description |
---|---|
Domain Name | Enter the website’s fully qualified domain name. For example, www.example.com. |
IP Address | If your server has multiple IP addresses, choose the IP address used to access the website. |
SSL Certificate | Select a certificate to secure your website. |
Store Site Files In | A folder can be automatically created to store your website’s files or you can choose a folder. This folder should include an index.html or index.php file to act as your website homepage. To view the folder contents, click the arrow to the left of the Store Site Files In pop-up menu. |
Who Can Access | Choose who has access to folders on the website. By default, everyone can access all folders. Click the pop-up menu, then choose Customize to restrict access to subfolders of your website to groups you create in the Server app. |
Additional Domains | Click Add |
Redirects | Click Add |
Aliases | Click Add |
Index Files | Click Add |
Click Create.
If Websites service isn’t turned on, click the On/Off switch to turn on the service.
To view your server’s website, click View Server Websites.
To change website settings after creating a custom website, select the website in the Web pane of the Server app, then click the Edit button .
To change what’s available on the website, change the files in your website’s document root folder. The document root folder is the folder that contains your website files.
Use the Server app to find your website’s document root. The default document root is /Library/Server/Web/Data/Sites/Default/. Also, when you create a site and let the Server app automatically create a new folder for you, it places the site files in /Library/Server/Web/Data/Sites/domainname/.
Select Websites in the Server app sidebar.
Select the website, then click the Edit button .
Click the arrow to the left of the Store Site Files In pop-up menu.
The Finder opens to the document root location. Change the files in this folder to change what’s available on the website.