Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-26-2008, 10:37 PM
Junior Member
 
Join Date: Apr 2008
Posts: 7
Default separating sites on a server

I'm experimenting with Zend Framework. I have several site on my test server (Apache2, php5, MySQL5, Windows XP). Before I just put everyting in different folders. Ex. htdoc/site1, htdoc/site2

For the Zend project I made a fake domain. Here is how I did it:


Code:
<VirtualHost *:80>

	ServerName phpweb20
	DocumentRoot "C:\Apache2.0\Apache2\htdocs\phpweb20"
	
	<Directory "C:\Apache2.0\Apache2\htdocs\phpweb20">
		AllowOverride All
		Options All
	</Directory>
	
	php_value magic_quotes_gpc off
	php_value register_globals off

</VirtualHost>
hosts
Code:
127.0.0.1       localhost
127.0.0.1	phpweb20
So, how do I create separate virtual hosts or haw can I keep the other folders functioning as there were?

Currently my other site give a Zend error. Ex. http://localhost/site2 is now looking for Site2Controller.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-27-2008, 12:34 AM
Junior Member
 
Join Date: Apr 2008
Posts: 7
Default

I think I have it figured out. there is a good explanation here: Setting Up A Virtual Host in Apache

This only answers half my question though. I'm currently using a forum in one of my site. I have plans for two other sites that will also have forums. So far, i like this particular forum (Simple Machines Forum) however, it is procedural and all fits in a sub folder.

Question: Won't Zend Framework thing that domanName.com/forum is trying to reach a controller directory? Is there a way to have such a forum system implemented along side a site on Zend Framework?

Certainly, the reason for Zend Framework is to implement things such a forums in a site. If I were 20 times more competent at this stuff I'd think about writing one. But until then an open source forum like SMF is pretty handy and secure.

Any suggestions?

This forum is a vBulletin but it's on a separate URL from everything else...

Last edited by horseatingweeds : 04-27-2008 at 07:11 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-30-2008, 01:31 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

This is all due to your .htaccess files and RewriteEngine rules.

In any subfolder of the site you DO NOT want to get redirected back to the bootstrap (index.php) and thus pushed through the MVC you need a new .htaccess with the following:
Code:
RewriteEngine Off
ie. in htdocs/forum you need this .htaccess

As for the sites you have living under the web root htdocs/site1, htdocs/site2, etc. you need to set the Base Path for the RewriteEngine so its looking in the correct location. For more details and help with mod_rewrite check out the Apache Docs
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk
Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:17 AM.