Hello ,
I would like to make some changes in my Apache configuration file.
I want users should be able to view their domain using the sub-domain added to the server Host-name.
Users can also access their website using the url "http://cpuser_name.server-hostname.com" . But for this a ServerAlias entry should be added in the VirtualHost entry for the users domain name.
Since I want to do this for all the domain hosted on the server and in the future if I add other domain then it should be added by default I do not have to make this changes manually.
I have also followed the instruction given on the URL "http://www.cpanel.net/documentation/easyapache/ea3_changes.html" and rebuild apache conf but dint worked.
I have added the entry "[% vhost.user %].server-hostname.com" in the file "/var/cpanel/templates/apache1/vhost.default" and in the other file as well, as suggested in the above url and also run the script "/scripts/rebuildhttpdconf" .
I'm pasting the editted portion of the file:"vhost.default" below for your reference:
--------------------------------------------------------------
<VirtualHost[% FOREACH ipblock IN vhost.ips %] [% ipblock.ip %]:[% ipblock.port %][% END %]>
ServerName [% vhost.servername %]
[% IF vhost.serveralias_array.size -%]
[% FOREACH alias IN vhost.serveralias_array -%]
ServerAlias [% alias %]
[% END -%]
[% ELSE -%]
ServerAlias [% vhost.serveralias %] [% vhost.user %].server-hostname.com
[% END -%]
DocumentRoot [% vhost.documentroot %]
[% IF vhost.serveradmin -%]
---------------------------------------------------------
However I could not find any changes in Apache virtual host after rebuilding the apache conf. Let me know if I am missing any thing.



LinkBack URL
About LinkBacks
Reply With Quote





