You are not logged in.

#1 2011-05-27 00:16:44

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

[SOLVED] need seamless dir structure / alias for 2 servers

/htdocs is my doc root on my local testing server,

but on my file structure on my development machine i like to try to mimic my remote host as close as possible to keep files easily cross-compatible.

correct me if im wrong but most apache hosts that are user based are set up in a way that the user directory is the ftp server root (/home/user/), and the /home/user/public_html is the doc root as accessed through DNS.  Is it even possible to expect that my testing server can mimic this behaviour without using the ~user/public_html settings without creating chaos?

i was wondering if an alias for the htdocs somehow would work so that when i ftp across the lan, it smylinks the htdocs/ directory as if it were the public_html/

this way the folllowing will look like this

remote server dirs; (the way it is set up now, and is perfect, no edits needed)
root/sensitive_website_includes/
root/public_html/website1/
root/public_html/website2/

local testing server dirs;
root/sensitive_website_includes/
root/htdocs/website1/
root/htdocs/website2/

Last edited by wolfdogg (2011-06-03 21:38:44)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

#2 2011-05-27 09:14:33

wolfdogg
Member
From: Portland, OR, USA
Registered: 2011-05-21
Posts: 545

Re: [SOLVED] need seamless dir structure / alias for 2 servers

ok, i have come to the conclusion that i probably need keep using the public_html directory on my testing server even though its cumbersome because it seems to me that the /htdocs on my testing is equivalent to the /~user on the remote.  therefore,  if the /~user must contain a public_html dir then so must the /htdocs.  Also, on the remote ill just keep my sensitive includes inside the public_html, but above the website folders (above where the domain names point).

/htdocs/public_html/sensitive includes
/htdocs/public_html/website1
/htdocs/public_html/website1/apps
/htdocs/public_html/website1/forum
/htdocs/public_html/website2   etc..

note;
on the testing server -  /htdocs is the real public directory, as accessed through the lan
host root url = http://localhost/ (top most accessible location for a user via a url, and is above the website folders)
website1 url without a vhost = http://localhost/public_html/website1 (pain in the arse)
website1 url after vhost = lh.website1.com

on the remote server - /~user is the real public directory if accessed through the servers "actual" dns such as this
host root  url = http://serversdomainname/~user(top most accessible location for a user via a url, and is above the website folders)
website1 url = http://serversdomainname/~user/public_html/website1 (actual location for website)
website1 url = http://website1.com (after trying in domain name)

(note i have convinced my paid hosting company to take my primary website that the hosting account is attached to, and replace it with a fictitious one, so that all this could be accomplished, this way there isnt a domain name other than the servers that can access the public_html directory at all, this adds a good layer of security.  now all the websites are on an equal par, in subdirs)

so in the end the testing does mimic my linux remote server(paid hosting)

it would still nice to be referred to the correct documentation to mask a directory like mentioned, i guess its sort of a reverse alias if anybody is familiar with this.  and is there anybody else here that has done this sort of thing?

Last edited by wolfdogg (2011-06-03 22:00:53)


Node.js, PHP Software Architect and Engineer (Full-Stack/DevOps)
GitHub  | LinkedIn

Offline

Board footer

Powered by FluxBB