Using FQDN on local intranet with CakePHP application

Hello,

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 192.168.0.10 address and this ip is always used to access the app. Now I have registered a domain name e.g myserverapp.com 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.
moh_oracleAsked:
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 192.168.0.10 (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 192.168.0.0 can too, but I guess that's OK with you).
0
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.
0
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.
0
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>
	ServerName local.somedomain.com
	DocumentRoot "C:/yourWebServer/someDomainFolder/public_html/"
	<Directory "/">
		AllowOverride All
		Order allow,deny
		Allow from all
	</Directory>
</virtualhost>

Open in new window

You can serve the files in that folder by pointing your browser to http://local.somedomain.com

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:

192.168.0.10   local.somedomain.com

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

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.
0
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.