views:

223

answers:

2

Hi, I'm running a VPS @ slicehost with Linux 9.10. I've got a basic Lamp setup so far. I am hosting a few sites and adding a half dozen more, and I'd like almost all of them to have word press blogs available.

I tried installing wordpress into each directory following the normal instructions thinking that apache virtual hosts, since it finds each domain, would by extension follow each domain's /blog/ directory(I've tried leaving it the default of /wordpress/ with no results either). WordPress also installed and worked fine when I set it up in the var/www directory where I originally set it up before realizing it would only host one site per installation.

I need wordpress to respond with one of many blogs which is matched to the domain it serves via virtual hosts off the same LAMP setup.

If this is a problem of layout, and there is a better way to host multiple, completely separate wordpress blogs on a single server lamp setup with virtual hosts, I'm open to that as well.

Thank you in advance for any assistance.

I'll be keeping an eye on this to be able to answer any questions.

Oh, Also, I've made separate mysql Db's & usernames for each blog to use to keep them compartmentalized.

A: 

Simply set up different VirtualHost directories and put a wordpress installation in each.

Example of your virtualhosts

<VirtualHost 12.34.56.78:80>
     ServerAdmin [email protected]
     ServerName site1.com
     ServerAlias www.site1.com
     DocumentRoot /srv/www/site1.com/public_html/
</VirtualHost>
<VirtualHost 12.34.56.78:80>
     ServerAdmin [email protected]
     ServerName site2.com
     ServerAlias www.site2.com
     DocumentRoot /srv/www/site2.com/public_html/
</VirtualHost>
<VirtualHost 12.34.56.78:80>
     ServerAdmin [email protected]
     ServerName site3.com
     ServerAlias www.site3.com
     DocumentRoot /srv/www/site3.com/public_html/
</VirtualHost>

In each of the respective public_html directories put in a wordpress installation.

So for site1.com the wordpress can be put into /srv/www/site1.com/public_html/wp

For site2.com /srv/www/site2.com/public_html/wp

This will completely keep them seperate.

CogitoErgoSum
A: 

Thanks for the answer. I'm not sure, but I think this is what i've done with a different directory and it isn't finding the WP directory, even though apache finds the index.html for each site in the exampleX.com directories. So to be clear, It loads example1.com/index.html, but not example1.com/wordpress/ even though /wordpress/ is in the same directory as the index.html(each index.html is labeled internally to make sure i'm not pointing to the wrong one somehow).

I'm serving out of home/public_html/example1.com, home/public_html/example2.com, etc.

The virtual hosts file in sites-enabled points to /home/user/public_html/ as document root.

is the /srv/ directory the important part somehow? I thought I could set the pointers to essentially where ever was convenient?

Do I need to change something else other than 000-default in the sites-enabled directory to point?

--- as I started looking at this and thinking about it, I went and checked over my virtual hosts file. It turns out I wrote the document root all the way to /public, which is at the same level as /blog/ So I backed it up to example1.com with a forwarding href in index.html for example1.com pointed to example1.com/blog/index.html(which points to index.php for wp) which brings up the famous 5 minute installation. This works well since this site is only a blog. I'll just forward to each exampleX.com/public/ from an index.html in each exampleX.com for the rest and everything should be working fine.

Thank you very much for your help.

damion