You can also use a single web project to have multiple websites. You can group all of the assets related to a website into a folder in a web project. Hence, a web project could have many such folders and each one could be interpreted and managed as a website.
This approach is better when compared to having a separate web project for each website if you have the following requirements:
Basically, this is good for small to medium websites where majority of the content is static.
One scenario could be deploying all of the folders to a specific target server. On that target server you could use web server proxy to have a specific URL pointing to a specific folder, as shown in the following diagram:
Another scenario could be deploying selected folders to a specific live server as shown in the following diagram. This can be done by using the Source Path and Excludes fields of deployment, while configuring the FSR on a stage server. Refer to Chapter 7, Content Delivery and Deployment for more details on deployment:
Another way of creating multiple websites within a web project is to use multiple webapp
folders.
The webapp
folder is the web application folder used in application servers such as Tomcat or JBoss. A web application exists as a structured hierarchy of directories. The root of this hierarchy serves as a root for serving files that are part of this context. For example, for a web application located at site2 in a web server, the index.html
file located at the base of the web application hierarchy can be served to satisfy a request to http://some_url/site2/index.html.
In Alfresco WCM, each web project has only one web application (webapp)
folder and it is named as ROOT. To create another webapp
folder for a specific web project, navigate to the Actions drop-down menu and click on Create Webapp Folder:
You can also change the default web application. Click on Edit Web Project Settings from the Actions drop-down menu and change the setting in the Default Webapp field as shown in the following screenshot: