How to add subdomain on cakephp
CakePhp is a great php framework and I often use to my web project, but sometime we need to add a couple of website in one domain. As you know cakephp not support for subdomain in cakephp folder.So you must do a litle modify How to add subdomain on cake php?
# root privilage WHM/cPanel
1. Login to your whm server.
2. Go to "Main >> Server Configuration >> Tweak Settings"
3. Find "Prevent users from creating subdomains outside of their public_html directory." remove check box.
# user privilage cPanel
1. Login to your cPanel.
2. Go to "Domain >> Subdomains".
2. Create a Subdomain input your subdomain in subdomain field.
3. Document Root default if you fill out name in subdomain ex: public_html/example remove public_html just "example"
4. Click "Create" button
Or if you don't have access as root to your serer you can edit httpd.conf
Otherwise all apache setting like this
Example:
NameVirtualHost 172.16.100.4:80
### master domain cake
ServerAdmin webmaster@localserver.net
DocumentRoot /usr/local/www/localserver.net
ServerName localserver.net
ErrorLog logs/localserver.net-error_log
CustomLog logs/localserver.net-access_log common
### subdomain non wordpress for example
ServerAdmin webmaster@wp.localserver.net
DocumentRoot /usr/local/www/wp.localserver.net
ServerName wp.localserver.net
ErrorLog logs/wp.localserver.net-error_log
CustomLog logs/wp.localserver.net-access_log common
Note: Don't put folder wp.localserver.net inside localserver.net you must create your folder/directori ex: wp
Finish
Now you can enjoy create subdomain in cakephp system but if you can't do this step please read in bakery.cakephp.org
