How do config wildcard to a folder, not public_htm

dichvuseo

New member
Joined
May 30, 2013
Messages
3
Hi Anyone!

I am building a website auto gen subdomain for every member. After registration complete a account has a website ex http://username.domain.com

I used help in http://help.directadmin.com/item.php?id=127. I add ServerAlias *.|DOMAIN| with wildcard (pucblic_html). But I want to use homepage to introduce the my website. Thẻ subdomain wild card pointing to the folder named userdata.

I'm trying ServerAlias *.|DOMAIN|/userdata but it not success.

It's very easy in Cpanel.

Please help me soon!

Thanks!
 
Add this line after your ServerAlias:

DocumentRoot /home/<USERNAME>/domains/<DOMAIN.COM>/<DIRECTORY>

example:
ServerAlias *.|DOMAIN|
DocumentRoot /home/user123/domains/mydomain.com/userdata
 
It's not run

Hi webaltern.

I have do it as you said but it not run.

example:
ServerAlias *.|DOMAIN|
DocumentRoot /home/user123/domains/mydomain.com/userdata

Demo:
http://demo.gapgo.vn/ is homepage
I need http://demo.gapgo.vn/ pointer http://demo.gapgo.vn/user
You can see the diffirence between those.

The subdomain is still pointer to public_html not userdata.

I think you can check it again.

May be, please show me the way to use htaccess with my problem.
 
And how does your httpd.conf for the domain looks like now? Please post here full content of the file.
 
httpd.conf

Here is full content of its.

Code:
# Auto generated apache config file by DirectAdmin version 1.42.0
# Modifying this file is not recommended as any changes you make will be
# overwritten when the user makes any changes to his/her website

# For global config changes that affect all Users, see this guide:
# http://help.directadmin.com/item.php?id=2
# For local config changes that only affect one User, see this guide:
# http://help.directadmin.com/item.php?id=3

# Frontpage requires these parameters in every httpd.conf file or else
# it won't work.
ServerRoot /etc/httpd



<VirtualHost 123.30.174.15:81>
ServerAlias *.gapgo.vn
DocumentRoot /home/gapgo/domains/gapgo.vn/public_html/user

	ServerName www.gapgo.vn
	ServerAlias www.gapgo.vn gapgo.vn 
	ServerAdmin [email protected]
	DocumentRoot /home/gapgo/domains/gapgo.vn/public_html
	ScriptAlias /cgi-bin/ /home/gapgo/domains/gapgo.vn/public_html/cgi-bin/

	UseCanonicalName OFF

	SuexecUserGroup gapgo gapgo
	CustomLog /var/log/httpd/domains/gapgo.vn.bytes bytes
	CustomLog /var/log/httpd/domains/gapgo.vn.log combined
	ErrorLog /var/log/httpd/domains/gapgo.vn.error.log
	
	<Directory /home/gapgo/domains/gapgo.vn/public_html>
		Options +Includes -Indexes



                suPHP_Engine ON
		suPHP_UserGroup gapgo gapgo
		SetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/gapgo/php/


	</Directory>



</VirtualHost>

<VirtualHost 123.30.174.15:81>
  ServerName mail.gapgo.vn
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/roundcube
  CustomLog /var/log/httpd/domains/gapgo.vn.bytes bytes
  CustomLog /var/log/httpd/domains/gapgo.vn.log combined
  ErrorLog /var/log/httpd/domains/gapgo.vn.error.log
</VirtualHost>



<VirtualHost 123.30.174.15:443>
ServerAlias *.gapgo.vn
DocumentRoot /home/gapgo/domains/gapgo.vn/public_html/user
	SSLEngine on
	SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
	SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
	

	ServerName www.gapgo.vn
	ServerAlias www.gapgo.vn gapgo.vn 
	ServerAdmin [email protected]
	DocumentRoot /home/gapgo/domains/gapgo.vn/private_html
	ScriptAlias /cgi-bin/ /home/gapgo/domains/gapgo.vn/public_html/cgi-bin/

	UseCanonicalName OFF

	SuexecUserGroup gapgo gapgo
	CustomLog /var/log/httpd/domains/gapgo.vn.bytes bytes
	CustomLog /var/log/httpd/domains/gapgo.vn.log combined
	ErrorLog /var/log/httpd/domains/gapgo.vn.error.log

	<Directory /home/gapgo/domains/gapgo.vn/private_html>
		Options +Includes -Indexes



                suPHP_Engine ON
		suPHP_UserGroup gapgo gapgo
		SetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/gapgo/php/

	</Directory>



</VirtualHost>


<VirtualHost 123.30.174.15:81>
ServerAlias *.gapgo.vn
DocumentRoot /home/gapgo/domains/gapgo.vn/public_html/user

	ServerName www.gateway.gapgo.vn
	ServerAlias www.gateway.gapgo.vn gateway.gapgo.vn 
	ServerAdmin [email protected]
	DocumentRoot /home/gapgo/domains/gapgo.vn/public_html/gateway
	ScriptAlias /cgi-bin/ /home/gapgo/domains/gapgo.vn/public_html/gateway/cgi-bin/
	
	UseCanonicalName OFF

	SuexecUserGroup gapgo gapgo
	CustomLog /var/log/httpd/domains/gapgo.vn.gateway.bytes bytes
	CustomLog /var/log/httpd/domains/gapgo.vn.gateway.log combined
	ErrorLog /var/log/httpd/domains/gapgo.vn.gateway.error.log
	<Directory /home/gapgo/domains/gapgo.vn/public_html/gateway>
		Options +Includes -Indexes



                suPHP_Engine ON
		suPHP_UserGroup gapgo gapgo
		SetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/gapgo/php/


	</Directory>


	
</VirtualHost>



<VirtualHost 123.30.174.15:443>
ServerAlias *.gapgo.vn
DocumentRoot /home/gapgo/domains/gapgo.vn/public_html/user
	SSLEngine on
	SSLCertificateFile /etc/httpd/conf/ssl.crt/server.crt
	SSLCertificateKeyFile /etc/httpd/conf/ssl.key/server.key
		

	ServerName www.gateway.gapgo.vn
	ServerAlias www.gateway.gapgo.vn gateway.gapgo.vn 
	ServerAdmin [email protected]
	DocumentRoot /home/gapgo/domains/gapgo.vn/private_html/gateway
	ScriptAlias /cgi-bin/ /home/gapgo/domains/gapgo.vn/public_html/gateway/cgi-bin/

	UseCanonicalName OFF

	SuexecUserGroup gapgo gapgo
	CustomLog /var/log/httpd/domains/gapgo.vn.gateway.bytes bytes
	CustomLog /var/log/httpd/domains/gapgo.vn.gateway.log combined
	ErrorLog /var/log/httpd/domains/gapgo.vn.gateway.error.log

	<Directory /home/gapgo/domains/gapgo.vn/private_html/gateway>
		Options +Includes -Indexes



                suPHP_Engine ON
		suPHP_UserGroup gapgo gapgo
		SetEnv PHP_INI_SCAN_DIR /usr/local/directadmin/data/users/gapgo/php/

	</Directory>



</VirtualHost>
 
Please follow this guide http://help.directadmin.com/item.php?id=199 if you want to change the DocumentRoot of only one of your subdomains.

Remember, to remove

Code:
DocumentRoot /home/gapgo/domains/gapgo.vn/public_html/user

as it's incorrect to have more than one line with DocumentRoot directive.
 
Back
Top