LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Problem with hosting 2 sites on the same server. (https://www.linuxquestions.org/questions/linux-server-73/problem-with-hosting-2-sites-on-the-same-server-703321/)

NewToApache2 02-09-2009 06:17 AM

Problem with hosting 2 sites on the same server.
 
Hi,

I’m hosting 2 sites on the same Apache2 web server with python in the background.
One is the default site and the other is the testing site for the default one.
For the default site, the psp files are in /xxx/web and the python files are in /xxx/ pythonsource/scripts. For the testing site, the psp files are in /xxx/webtest and the python files are in /xxx/ pythonsource/scriptstest.

PythonPath is a global variable. So the psp files in the default site(/xxx/web) refers to the python files in the test location(/xxx/ pythonsource/scriptstest) if the test site is also launched. Is there a way to point the psp files in /xxx/web to the python files are in /xxx/ pythonsource/scripts ?

These are the config files for 2 sites.
For the default one
NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /xxx/web/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

<Directory /xxx/web/ >
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order deny,allow
allow from all

PythonPath "sys.path+['/xxx/ pythonsource/scripts ']"
AddHandler mod_python .psp
PythonHandler mod_python.psp
PythonDebug On

# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/

DirectoryIndex index.php index.psp index.html
</Directory>

………………………………………………………………….

</VirtualHost>


For the testing site

NameVirtualHost *:8080
<VirtualHost *:8080>
ServerAdmin webmaster@localhost

DocumentRoot /xxx/webtest/
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>

<Directory /xxx/ webtest/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order deny,allow
allow from all

PythonPath "sys.path+['/xxx/pythonsource/scriptstest`]"
AddHandler mod_python .psp
PythonHandler mod_python.psp
PythonDebug On

# This directive allows us to have apache2's default start page
# in /apache2-default/, but still have / go to the right place
#RedirectMatch ^/$ /apache2-default/

DirectoryIndex index.php index.psp index.html
</Directory>

…………………………………………………………………………………………………………………………………… …..

</VirtualHost>

Thanks for help in advance.

chitambira 02-12-2009 03:32 AM

You are trying to host the two sites using same IP but listening at two different ports (80 and 8080)?. When the test site is launched, the pythonpath is modified and since it is a single variable, both sites will point to scriptstest. You may want to try and use different IPs, but otherwise if the two site run within same environment, it might be difficult to specify a different global variable for each. may with some serious coding.


All times are GMT -5. The time now is 08:05 AM.