Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to access vhosts/domains created on server but not directly via domain which is created.

I would like to have access in the form http://www.maindomain.com/~otherdomain.com or similar.

IMPORTANT: I don't want to push users towards editing /etc/hosts file and adding the domain there locally to point to server and so on..

share|improve this question
I was working on an answer, but it had more questions than it did answers. This is possible, can you update the question with your folder layout for the main site and other sites as well. Different answers depending on the folder hierarchy –  David Houde Apr 21 '13 at 10:45
ah, it is bit tricky. –  mariotanenbaum Apr 21 '13 at 11:24

1 Answer 1

up vote 1 down vote accepted

For security reasons, I can not recommend to do this.

However, you can manipulate the default host templates located in:


Just run the httpdmng utility. This will recreate all vhost configuration files based on the template. /usr/local/psa/admin/bin/httpdmng --reconfigure-all

Instead of your prefered solution, I recommend you to put the whole damn thang behind a sub domain. Just add it as an alias to every vhost in the template, like site1.maindomain.com.

Remember to renew your template manipulations after updates. Don't lock them with chattr +i !

share|improve this answer
You sure about that? What about symbolic links? –  David Houde Apr 21 '13 at 11:51
I've edited my answer. –  cept0 Apr 21 '13 at 11:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.