Mobile app version of vmapp.org
Login or Join
Murphy175

: In CakePhP what is the recommended method for having one sub-domain that's outside the CakePhP environment? I have a CentOS VPS with LAMP installed. I set up CakePhP and I have my httpd.conf

@Murphy175

Posted in: #Htaccess #Php

I have a CentOS VPS with LAMP installed. I set up CakePhP and I have my httpd.conf set up with 1 virtual host which points to my CakePhP directory. I have various sub-domains in my CakePhP environment, which reside as sub-directories within my overall CakePhP directory.

But now I'd like to have a sub-domain that runs raw PhP, outside the CakePhP environment.

It's like this:

example.com/sub1 resides in /www/var/cakephp_install/sub1 example.com/sub2 resides in /www/var/cakephp_install/sub2 example.com/sub3 resides in /www/var/html/sub3


So sub3 is not a CakePhP App. It does not reside within the CakePhP environment. What is the best way to route or index or configure this? I've played with the httpd.conf, .htaccess, and index.php files. Nothing I've tried works.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murphy175

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

You'll need to:

1) Create a new A record for the subdomain, the process differs depending on your DNS setup. You may need to do this through your registrar, or if you're hosting your own DNS servers create the record yourself.

2) Setup a second virtual host in Apache. This should look something like

<VirtualHost *:80>
ServerName subdomain.domain.com
DocumentRoot /var/www/html/sub3
# Other directives can go here
</VirtualHost>


3) Restart Apache sudo apachectl restart or service httpd restart

Now if you drop a file called index.php containing <?php phpinfo(); into /var/www/html/sub3 and browse to subdomain.domain.com you should see your PHP settings page.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme