login community faq

Maybe is a silly question, but... WebFaction uses xginx to serve static content and apache to serve dynamic content with PHP and in the routing system, they are set to parse different directories content. My question is: can PHP write anywhere in the filesystem and so also static content to be served by xginx, i.e images uploaded by visitors? Thanks

asked Feb 27 '12 at 03:16

robertotra's gravatar image

robertotra
437


Yes, that's possible. You can set your PHP application to upload images to a directory and then create a symbolic link application there, which will treat the contents of that directory as if it were a Static-only application and have the files served by nginx.

answered Feb 27 '12 at 04:18

iliasr's gravatar image

iliasr ♦♦
7763

Thanks, good to know that I can differentiate how content is served inside a single app. But this reply only partly to my question: can PHP inside and app read and write everywhere inside the plan (by use of the filesystem path) or is it confined inside its app space?

(Feb 27 '12 at 04:53) robertotra robertotra's gravatar image

I'm sorry I've missed that. PHP processes are running as your user so it has read and write permissions everywhere you have.

(Feb 27 '12 at 05:04) iliasr ♦♦ iliasr's gravatar image

Perfect. Thanks!

(Feb 27 '12 at 05:12) robertotra robertotra's gravatar image

Sorry, I need to specify a new case about this question:

I have created a new application and created a symbolic link to set the document root in a subfolder:

|--myapp
. |--private folder (code and configuration files)
. |--public folder (document root for my domain)

This public folder will contain the public PHP files and any static content and will be therefore managed by Apache. If I made a subfolder of it for all the static content, may I let it be managed by Nginx? It should be:

|--myapp
. |--private folder (code and configuration files)
. |--public folder (document root for my domain - managed by Apache)
... |--php folder (other PHP pages, still managed by Apache)
... |--static folder (images, js, css to be managed by Nginx)

Is it possible to set a symbolic link to be managed by Nginx to a subfolder of another symbolik link managed by Apache?

Thanks and regards
Roberto

(Mar 07 '12 at 05:34) robertotra robertotra's gravatar image

It should work. If you run into trouble submit a support ticket indicating which website configuration is failing and we will take a look at it with live data.

(Mar 07 '12 at 22:49) johns ♦♦ johns's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×151
×149
×93
×1

Asked: Feb 27 '12 at 03:16

Seen: 763 times

Last updated: Mar 07 '12 at 22:49

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited