LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-09-2009, 06:17 AM   #1
NewToApache2
LQ Newbie
 
Registered: Feb 2009
Posts: 1

Rep: Reputation: 0
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.
 
Old 02-12-2009, 03:32 AM   #2
chitambira
Member
 
Registered: Oct 2008
Location: Online
Distribution: RHEL, Centos
Posts: 373
Blog Entries: 1

Rep: Reputation: 51
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What's a good program to auto download from file hosting sites? jacatone Linux - Software 5 02-22-2009 05:42 AM
Hosting sites created by Joomla on Linux hahamama1 Linux - Server 1 05-25-2008 03:17 PM
How to control apache when hosting sites? stormrider_may Linux - Networking 2 03-24-2006 01:45 PM
Virtual hosting not point to different sites techneck Linux - Newbie 1 02-21-2006 01:46 PM
hosting multiple sites w/ apache pH* Linux - Networking 2 10-15-2004 03:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration