Difference between revisions of "Remap Sub-Dir"

From DreamHost
Jump to: navigation, search
(added error log snippet and note)
m
Line 1: Line 1:
 
Use [https://panel.dreamhost.com/?tree=domain.mapsubdir "Domains > Remap Sub-Dir"] to make a sub-directory of your domain use a non-standard location in your file system its source for web content.
 
Use [https://panel.dreamhost.com/?tree=domain.mapsubdir "Domains > Remap Sub-Dir"] to make a sub-directory of your domain use a non-standard location in your file system its source for web content.
  
Normally if you have <blockquote>'''http://www.domain.com/''' set up with the web directory '''/home/user/domain.com''' </blockquote> then <blockquote>'''http://www.domain.com/pictures/''' would get its content from '''/home/user/domain.com/pictures''' automatically. </blockquote> This area allows you to override this default setting and use any folder you'd like to provide content for sub-directories of your domain. It's great for sharing your domain among multiple ftp users.
+
Normally if you have <blockquote>'''http://www.domain.com/''' set up with the web directory '''/home/user/domain.com''' </blockquote> then <blockquote>'''http://www.domain.com/pictures/''' would get its content from '''/home/user/domain.com/pictures''' automatically. </blockquote> This area allows you to override this default setting and use any folder you'd like to provide content for sub-directories of your domain. It's great for sharing your domain among multiple ftp users. Meaning, you can assign folders under your domain to other FTP users. Note, however, that the directory you remap will only be accessible by the user you remapped it to. Not even the 'main' domain user will be able to access it.  
  
 
Now you could have: <blockquote>'''http://www.domain.com/pictures/''' get its content from '''/home/otheruser/images''' </blockquote>
 
Now you could have: <blockquote>'''http://www.domain.com/pictures/''' get its content from '''/home/otheruser/images''' </blockquote>

Revision as of 09:52, 27 May 2011

Use "Domains > Remap Sub-Dir" to make a sub-directory of your domain use a non-standard location in your file system its source for web content.

Normally if you have
http://www.domain.com/ set up with the web directory /home/user/domain.com
then
http://www.domain.com/pictures/ would get its content from /home/user/domain.com/pictures automatically.
This area allows you to override this default setting and use any folder you'd like to provide content for sub-directories of your domain. It's great for sharing your domain among multiple ftp users. Meaning, you can assign folders under your domain to other FTP users. Note, however, that the directory you remap will only be accessible by the user you remapped it to. Not even the 'main' domain user will be able to access it. Now you could have:
http://www.domain.com/pictures/ get its content from /home/otheruser/images

Be warned, CGI scripts (NOT PHP SCRIPTS) won't work in sub-directories remapped to other user's home directories because of file ownership issues (error caused by a simple Python CGI script in a remapped sub-directory):

[Sun Mar 20 08:02:09 2011] [error] [client xx.xxx.xxx.xxx] suexec failure: could not open log file
[Sun Mar 20 08:02:09 2011] [error] [client xx.xxx.xxx.xxx] fopen: Permission denied
[Sun Mar 20 08:02:09 2011] [error] [client xx.xxx.xxx.xxx] Premature end of script headers: test.cgi

Note also that PHP scripts in remapped sub-directories - within your own home directory - can only run with the server's default PHP version.

Also, you can't use this area to change the web directory for an entire domain! To do that, just go to the "edit" link at "Domains > Web".

DreamHost PS

Lighttpd

When using URL remapping on DreamHost PS together with Lighttpd and you are remapping to a different user you must not enable the enhanced security feature on the new user in order for the remap to work.