New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Host a directory on another server?
So say i have example.com and i want this on a seperate server to example.com/blog.
How can i do this? I know that using a subdomain such as blog.example.com will be easier but for SEO purposes, i want to have the blog on a directory instead of a subdomain.
Thanked by 1manacit
Comments
The only way i can think of is mount the remote directory on local server using some scripts
Should be well possible:
http://www.tjansson.dk/2008/01/autofs-and-sshfs-the-perfect-couple/
http://unix.stackexchange.com/questions/62677/best-way-to-mount-remote-folder
through dns like cloudflare very easy
What.
you want to use a subdomain on another host go to dns eg: sub.domain.com points to a record 55.55.55.5 well in cloudflare you can do that anyways
No subdomain in this case.
oh i see ok lol i tried ^_^
OP clearly said they know it can be done with a sub domain easily but for SEO wants to be able to do it as a domain.com/blog rather than blog.domain.com
not possible as far as i know, though redirect may be the answer
Directly, no.
Please stop posting if you don't know what are you talking about, thanks.
/rant
ok thank you
Possible via the use of Reverse Proxying at the example.com server. However you'll still be using bandwidth of the main server (with consumption multiplied by two, actually), and as all requests will go through it, this will result in a latency increase. Also there might be problems with logging or distinguishing visitors from one another (for the server handling the /blog part it will look like everyone comes from the base server's IP).
Bottom line, cut the "SEO" crap, migrate to proper subdomains if you need to host on multiple servers.
Using nginx?
location /blog { proxy_pass http://myotherserver.com/blog/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; }
Use bittorrent sync to monitor the remote folder, and grant read only access to the webserver.
Either do it on the web server level, i.e. reverse proxying to remote server
or
Do it on the file system level, i.e. use sshfs / glusterfs / whatever else to mount a remote directory to the server
Neither are really good solutions though. I don't know, search engines are important but I feel like bowing down to the god of SEO is overkill.
using lighttpd:
Interesting @wiffel, never done it with lighthttpd before. Does that forward the real IP etc in headers?
Depends on what you mean. It does add X-Forwarded-... and X-Host, ... to the headers.
There is a patched version of mod_proxy that does not do that, but I never tried that one myself.
I'm not sure if that answers your question ? You can find some more info about it at the bottom of the page about mod_proxy.
Try this https://www.digitalocean.com/community/articles/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh
Why not just create a framed webpage as the index page in the /blog folder? I think that would be the easiest solution.
Not sure if it will work for what you need, but can you not use a redirect?
So for server B where you installed the blog create a subdomain say serverb.example.com/blog then have example.com redirect to serverb.example.com/blog.
I know in freedns when you use the cloak tag it will keep the example.com url from changing to serverb.example.com/blog.
deleted - already mentioned.
If you're using Apache you do accomplish this with a reverse proxy using mod_proxy.
If SEO is the goal an (i)frame will not help one bit... and why would you do that in 2014 anyway? iframes only real good uses are like those used by YouTube for easy embedding ;_;