arahne
Oct 16 2003, 01:46 AM
I have several domains hosted on a Plesk box with identical content.
Because I make frequent updates on them sometimes more than 3 a day, meaning more than 300 files, I need to know if there is any method to make these domains to share the same webspace (something similar with a symlink, if it's possible).
smack
Oct 16 2003, 08:55 AM
You can setup the duplicate domains as "standard redirect" instead of "physical hosting", and have them all point to your main domain name. Not sure if you can change from physical to redirect without deleting and recreating the domain via the control panel...but this option should be available by clicking the Setup button in each domain.
arahne
Oct 16 2003, 09:03 AM
That's not what I intend by saying sharing the same space....
Because I need it to have the same root directory, but the domains should be visible as different entities on the web.
root_loggins
Oct 16 2003, 10:18 AM
Using a frame might be a good solution.
Put this in your domains http dir, call it index.html and make sure the src= points to your main sites address/directory.
Also look at a program called "truevirtual" Do a google on it - works great too.
Your Sites Title
smack
Oct 16 2003, 11:21 AM
The above can be done via the plesk control panel as well using the other redirect option.
You could try a sym link from all your httpdocs directories to a single directory. While technically this will work, I'm not sure if apache will follow a sym link on the root web folder for a domain, so you might have to tweak the config file (or the individual configs plesk makes for each domain).
arahne
Oct 16 2003, 12:16 PM
ok... I don't think I made myself understood from the first time:
I don't need a client solution, or a plesk controlled solution... I need a system level solution because I need that two URLs to point to the same file on the filesystem.
in example:
on the filesystem I have the following file:
/home/httpd/vhosts/domain1.com/httpdocs/file1.html
on the web I need this to be visible as:
http://www.domain1.com/file1.html
http://www.domain2.com/file1.html
http://www.domain3.com/file1.html
http://www.domain4.com/file1.html
I don't need solutions with framesets (client based), redirects (plesk management).
I noticed that Apache does not follow symlinks... if I do something wrong, please someone tell me...
Is there any other solution?
root_loggins
Oct 16 2003, 01:03 PM
I gave you the answer to your problem before...
Make the frame page I showed above and name it file1.html
then in the src= tag put
http://domain/file1.html to point to the one domain and directory you want to maintain.
Done!
arahne
Oct 16 2003, 01:25 PM
I'm a bit dissapointed...
I already told you I don't need a client based solution (with frameset) because it's no use to me...
only one domain should have physical hosting, the others should use the same space as the first (having even the same root in Apache!)
All the solutions I received until now are either framsets or redirects. I don't need such solutions, because these have been already discussed with the domains owner and he is fully against these type of solutions.
I need a solution that allows me to set at operating system level the root of several domains to a given directory on the filesystem.
I tried to use the /conf/httpd.include file but it seems to have disastruous results when it comes to executing PHP scripts.
Gentle Giant
Oct 16 2003, 02:22 PM
Does the URL have to remain as domain1 domain2 etc.?
It is fairly easy to do with a vhost.conf and rewrites - but then the URL will change to the default one, but the same file is visible under each domain.
I do not know of a method where the URL will not change.
smack
Oct 16 2003, 07:01 PM
Symbolic link. It'll work. Apache has a follow symlink directive. You may have to have all of the domains under the same user so that you don't run into permissions problems.
I am kind of curious as to why you want different URLs to point to the same content without redirect... well, actually, I'd rather not know.
arahne
Oct 17 2003, 01:16 AM
Thank you!!!!
Now it works!
I forgot to change the user Apache is running as in order to match the user in the destination directory.
So : FOR FUTURE REFERENCE:
To allow two domains to share the same webspace (to have identical content):
1. create all the domains you need in PLESK with physical hosting.
2. define one as primary and upload there the files you want. (let's call it domain1.com)
For all the others do for each:
1. enter the root directory of each domain (/home/httpd/vhosts/domainx.com/)
2. empty the directory httpdocs/ and remove it
3.create a symlink ( ln -ds /home/httpd/vhosts/domain1.com/httpdocs/ httpdocs ) . This will replace the old httpdocs/ directory with a symlink to the actual files. This is not actually used, but in order to avoid certain problems it's better to be created.
4. change the owner of the symlink (chown domain1-user:psacln httpdocs/)
5. enter the folder conf/ and edit httpd.include with your favourite editor (i use vim)
6. change on the line User the user to match the domain1-user
7. in the line DocumentRoot /home/httpd/vhosts/domainx.com/httpdocs/ change domainx.com to match the domain1.com
8. in the section title
change also the domainx.com with domain1.com.
9 If you want them to seemless combine (to share everything: logs,error documents,cgi script aliases etc) then change in this file all the references to domainx.com to domain1.com
Repeat these steps for all the domains you want to point to domain1.com.
Finally, restart Apache with apachectl restart.
It's done!
uponone
Nov 14 2003, 05:25 PM
Thanks for the info Arahne,
I did as you said but when I attemped to visit my newly set-up domain, I got a 404 error.
I re-read the instructions and tried angain, still a 404.
Any idea what might be wrong?
Thanks,
Chris
arahne
Nov 15 2003, 01:58 AM
Are you sure you have files on the first domain? The first domain is active?
This should not happen if you have done everything as I said. Please check (and double check) DocumentRoot section in httpd.include.
Don't forget to restart apache with apachectl restart after you finished with all the changes.
Also, it is safe to keep a copy of the original file.
Squire
Nov 15 2003, 07:07 AM
Haven't tested it personally, but I am under the impression that httpd.include is overwritten every time a change is made via the control panel. That's going to cause a problem me thinks.
Squire
uponone
Nov 15 2003, 12:43 PM
Hi Arahne,
Thanks again for your help! I did some double-checking and found my error. Would you believe I missed a space when setting my permissions!
I did have another couple of quick questions if you don’t mind.
Why edit the httpd.include file? After creating the symlink, I got the results I was looking for. Is there something I am missing if I do not edit it?
Also, as Squire mentioned, every change I have attempted to make to this file has been overwritten as soon as I make any changes in the Plesk control panel. Is there a way to stop this?
Chris
Squire
Nov 15 2003, 03:04 PM
There's no way to stop the httpd.include from being overwritten to my knowledge Chris.
I always use a vhost.conf file to make those kinds of per domain changes. That accomplishes the same thing, and it doesn't get overwritten.
Squire
calbazon
Mar 30 2004, 08:45 PM
Hi Guys,
Thanks for the great information on how to do this! I tried it and it worked great except for one thing. PHP isn't parsed when going through the link. It is passed through as text. Any ideas on how to force the link to execute the code instead of passing it through unparsed?
Thanks
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please
click here.