# Custom Apache Config for PHP and Web2Py

## Problem

As you probably know, the web2py admin must be hosted on a secured domain. We set a client up with a basic CRM system under the domain http://crm.maindomain.com, which worked perfectly until a GeoTrust SSL Certificate was installed.

Since the purchased GeoTrust certificate was just for a single domain, there was no way to access the web2py admin unless another dedicated IP address was purchased - which the site owner did not want to pay for.

Fortunately, there is a work around.

## Solution

After hours of research/tests, the identified solution was to configure the web2py application, as well as the admin, under the main domain:

Essentially, any URL pattern that fell under /crm/ would be served by web2py, while all other URLS would be served by an existing Joomla application.

## Steps

1. Transfer the apache SSL configuration from the current crm domain (crm.mainpage.com) to the main domain (mainpage.com):
1. Update the apache config /usr/local/apache/conf/userdata/ssl/2/main/maindomain.com/wsgi.conf:

Note: Make sure to also comment out ‘UserDir disabled’ and all apache Rewrite lines

1. Update web2py routing configuration, /home/main/python/maindomain.com/app/web2py/routes.py:
1. Rebuild apache config:
1. Restart apache: