Hello everyone!
I have been working on a solution for shared SSL for my dedicated server for a while. John from DirectAdmin has been EXTREMELY helpful by suggesting an option to replace server.hostdomain.com/~username with server.hostdomain.com/~userdomain.com. I have seen several posts where others have expressed the desire for this option so I thought I would share what I have thus far (not completely functional yet, but close).
John suggested that I create a user/domain symbolic link table to utilize with the AliasMatch statement in the httpd.conf file (/etc/httpd/conf/httpd.conf).
John suggested the following:
1. Make an aliases directory e.g /etc/httpd/"aliases" (without ""). This directory would contain all the symbolic links that will allow for server.hostdomain.com/~userdomain.com.
2. To create the symbolic links when creating a new domain, add to, or create a script in the /usr/local/directadmin/scripts/ directory called "domain_create_post.sh" - You may have one there already. The script would look like:
#!/bin/sh
ln -s /home/${username}/domains/${domain}/public_html /etc/httpd/aliases/${domain}
exit 0;
When you create a new domain, the symbolic link will automatically appear in your new aliases directory from step 1.
3. Edit the AliasMatch section in your httpd.conf file (/etc/httpd/conf/httpd.conf). You will see two "VirtualHost" sections towards the end (http & https) that have the following line:
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
Change the path to point to your new aliases directory in /etc/httpd/aliases:
*** This is where my issue arises ***
I have the following:
AliasMatch ^/~([^/]+)(/.*)* /etc/httpd/aliases/$1
After restarting Apache, I enter the URL http://server.hostdomain.com/~userdomain.com in my browser and am taken to a 403 error page (You are not authorized to view this page).
I noticed that the symbolic link in the new aliases directory was user/group = root/wheel (FreeBSD 4.11).
My Apache error log file shows:
Directory index forbidden by rule: /etc/httpd/aliases/~userdomain.com/
Does anyone think that the file permissions need to be changed to make this happen, or is my syntax in the new AliasMatch statement off. This is SO CLOSE to working, I hope someone hops with any suggestions that might work.
P.S.
In case anyone doesn't know by now...the support with DA is FANTASTIC. Over the past few days John has answered my email support requests with extremely detailed suggestions that I know take some time to deal with. DA and the support given are definitely A+ .
I have been working on a solution for shared SSL for my dedicated server for a while. John from DirectAdmin has been EXTREMELY helpful by suggesting an option to replace server.hostdomain.com/~username with server.hostdomain.com/~userdomain.com. I have seen several posts where others have expressed the desire for this option so I thought I would share what I have thus far (not completely functional yet, but close).
John suggested that I create a user/domain symbolic link table to utilize with the AliasMatch statement in the httpd.conf file (/etc/httpd/conf/httpd.conf).
John suggested the following:
1. Make an aliases directory e.g /etc/httpd/"aliases" (without ""). This directory would contain all the symbolic links that will allow for server.hostdomain.com/~userdomain.com.
2. To create the symbolic links when creating a new domain, add to, or create a script in the /usr/local/directadmin/scripts/ directory called "domain_create_post.sh" - You may have one there already. The script would look like:
#!/bin/sh
ln -s /home/${username}/domains/${domain}/public_html /etc/httpd/aliases/${domain}
exit 0;
When you create a new domain, the symbolic link will automatically appear in your new aliases directory from step 1.
3. Edit the AliasMatch section in your httpd.conf file (/etc/httpd/conf/httpd.conf). You will see two "VirtualHost" sections towards the end (http & https) that have the following line:
AliasMatch ^/~([^/]+)(/.*)* /home/$1/public_html$2
Change the path to point to your new aliases directory in /etc/httpd/aliases:
*** This is where my issue arises ***
I have the following:
AliasMatch ^/~([^/]+)(/.*)* /etc/httpd/aliases/$1
After restarting Apache, I enter the URL http://server.hostdomain.com/~userdomain.com in my browser and am taken to a 403 error page (You are not authorized to view this page).
I noticed that the symbolic link in the new aliases directory was user/group = root/wheel (FreeBSD 4.11).
My Apache error log file shows:
Directory index forbidden by rule: /etc/httpd/aliases/~userdomain.com/
Does anyone think that the file permissions need to be changed to make this happen, or is my syntax in the new AliasMatch statement off. This is SO CLOSE to working, I hope someone hops with any suggestions that might work.
P.S.
In case anyone doesn't know by now...the support with DA is FANTASTIC. Over the past few days John has answered my email support requests with extremely detailed suggestions that I know take some time to deal with. DA and the support given are definitely A+ .