Using FQDN on local intranet with CakePHP application


This is my first question in this community so please forgive any mistakes and break in protocol.

I have a CakePHP application running from my www directory on my LAMP server. I need help on how to move and serve the application from a directory outside the server www directory in the most secure way. Also the the CakePHP application is running on address and this ip is always used to access the app. Now I have registered a domain name e.g and I want this to be used to access the app. Most importantly I want to disable all access to server application via ip address.

My server runs on Ubuntu 12.04 server.

Thank you.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Duncan RoeSoftware DeveloperCommented:
People from outside can't directly access (if that's one of the questions you were asking). So your application can stay there and only your server can talk to it (and others on your local LAN can too, but I guess that's OK with you).
moh_oracleAuthor Commented:
Thank you for your response. I am trying to protect it from my local LAN too, the server is available over multiple VPN sites. Hence the added security to keep the application outside the www directory.

Thank you.
Duncan RoeSoftware DeveloperCommented:
Sorry but that is outside of my experience. I've asked a Moderator to expose this Question to some other Experts - it came to me as a Neglected Question Alert.
Chris StanyonWebDevCommented:
I don't use Ubuntu or CakePHP but this general principle may still apply.

In Apache, you will have the ability to enable Virtual Hosts. Not sure of the specifics for your installation, but on Windows, you un-comment the following line:

Include conf/extra/httpd-vhosts.conf

Open in new window

Now you can create virtual hosts by editing this file and adding an entry along these lines:

<virtualhost *:80>
	DocumentRoot "C:/yourWebServer/someDomainFolder/public_html/"
	<Directory "/">
		AllowOverride All
		Order allow,deny
		Allow from all

Open in new window

You can serve the files in that folder by pointing your browser to

You will also need to add an entry to your local DNS server which maps the IP address to your server to the domain name. Again, not sure on the details for Ubuntu, but in Windows you simply add an entry into a HOSTS file:

I know it's not specific to your installation, but as I say - the general principle will be the same

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
moh_oracleAuthor Commented:
Thank you,

Your solution works after configuring to fit my situation.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Frameworks

From novice to tech pro — start learning today.