Multiple local 'websites' w/Rapid PHP

Post your questions and problem reports here

Moderator: kfury77

Forum rules
Please try to follow these guidelines. This will help to receive faster and more accurate response.
  • Check the Support section of the corresponding product first. Chances are you will find your answer there;
  • Do not create new topics for already reported problems. Add your comments to the existing topics instead;
  • Create separate topic for each problem request. Do NOT post a number of non-related problem reports in a single topic;
  • Give your topic a meaningful title. Titles such as "A question," "Bug report" and "Help!" provide others no clue what your message is about;
  • Include the version number of the software you are using;
  • This is not an official customer support helpdesk. If you need a prompt and official response, please contact our support team directly instead. It may take a while until you receive a reply in the forum;
Post Reply
firebuff55123
Posts: 9
Joined: Sat May 08, 2010 6:18 am

Multiple local 'websites' w/Rapid PHP

Post by firebuff55123 »

I have recently had the need to have several local websites. I am using Win7(64) and
Rapid PHP ver 9. At first I attempted to put the two sites at the same level of root
directory, such as...
-dirs-
www_website1
www_website2

But It appears that I cannot do that because it seems you can only configure ONE
document root, so it appears that I must configure the second website as a SUB dir
of the first website. Then it seems that I can configure multiple mappings for
preview.

My question is am I on the right track? I wish I could run multiple instances
of Rapid PHP so each one could have it's own configurations and allow multuple
local webites... Is that possible?

firebuff55123
User avatar
Nikolajs
Blumentals Software Developer
Posts: 108
Joined: Mon Sep 19, 2011 8:28 am

Re: Multiple local 'websites' w/Rapid PHP

Post by Nikolajs »

The right way to do this is to install WAMP and configure virtual directories, so that your websites run in a separate folder, but on different port. For example,

http://localhost:80 – this is the first (default) website
http://localhost:81 – this is another website etc.

Then you can use RapidPHP to define several projects.
Nikolay Dutchuk
Blumentals Software
firebuff55123
Posts: 9
Joined: Sat May 08, 2010 6:18 am

Re: Multiple local 'websites' w/Rapid PHP

Post by firebuff55123 »

Ah... yes I understand. Thanks.

firebuff55123
firebuff55123
Posts: 9
Joined: Sat May 08, 2010 6:18 am

Re: Multiple local 'websites' w/Rapid PHP

Post by firebuff55123 »

Well I thought I understood, but tjis FAILS to work for the local_antserve
'localhost'. The regular localhost wors just as it should. Perhaps you
can steer me in the right direction...

Here's what I have configured...
=========================================
Rapid PHP Mapping
-----------------
C:\eaahmpg\eatc7402\www\ http://localhost/eaatc_local/
C:\eaahmpg\eatc7402\www_antserve\ http://localhost:81/local_antserve/
==================================================================
hosts file
-------------
# localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
127.0.0.1 local_antserve
# ::1 localhost

======================================================================
httpd-vhosts.conf file
--------------------
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
NameVirtualHost *:81
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#



<VirtualHost *:80>
DocumentRoot C:/eaahmpg/eatc7402/www
ServerName localhost

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory C:/eaahmpg/eatc7402/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

</VirtualHost>

<VirtualHost *:81>
DocumentRoot C:/eaahmpg/eatc7402/www_antserve
ServerName local_antserve

<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory C:/eaahmpg/eatc7402/www_antserve/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
======================================

firebuff55123
User avatar
Nikolajs
Blumentals Software Developer
Posts: 108
Joined: Mon Sep 19, 2011 8:28 am

Re: Multiple local 'websites' w/Rapid PHP

Post by Nikolajs »

If you use hosts files then the Apache configuration file should look something like this:

Code: Select all

Listen           127.0.0.1:80
NameVirtualHost  127.0.0.1:80

<VirtualHost 127.0.0.1:80>
	DocumentRoot    "C:/eaahmpg/eatc7402/www"
	ServerName      localhost
</VirtualHost>
<VirtualHost 127.0.0.1:80>
	DocumentRoot    "C:/eaahmpg/eatc7402/www_antserve"
	ServerName      local_antserve
</VirtualHost>
Then you should be able to browse two local websites:
http://localhost/
and
http://local_antserve/
Nikolay Dutchuk
Blumentals Software
firebuff55123
Posts: 9
Joined: Sat May 08, 2010 6:18 am

Re: Multiple local 'websites' w/Rapid PHP

Post by firebuff55123 »

I wanted to add another 'site' to my RapidPHP. So I added 127.0.0.1 local_mx
to my hosts file in windows.

Then I adedd the following code based on what you suggested (that worked fine)
to my httpd-vhosts.conf file figuring it should be easy to add a third site.

<VirtualHost 127.0.0.1:80>
DocumentRoot "C:/eaahmpg/eatc7402/www_on_mx"
ServerName local_mx
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory C:/eaahmpg/eatc7402/www_on_mx/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

But all I recieve is a'No such server' from my browser window. I don't understand.

David Freedman
User avatar
Nikolajs
Blumentals Software Developer
Posts: 108
Joined: Mon Sep 19, 2011 8:28 am

Re: Multiple local 'websites' w/Rapid PHP

Post by Nikolajs »

See Apache log file for errors. If both prevous local websites work there must me something bad with the configuration. I think that the configuration should look something like this:

Code: Select all

<VirtualHost 127.0.0.1:80> 
    DocumentRoot "C:/eaahmpg/eatc7402/www_on_mx"
    ServerName local_mx
    <Directory "C:/eaahmpg/eatc7402/www_on_mx/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
Nikolay Dutchuk
Blumentals Software
Post Reply