PDA

View Full Version : two domains - php/post enabled on both?



bearbr
03-22-2006, 10:47 PM
Hi all,

I'm trying to set up two domains on my VPS with different doc root directories - the first domain is the default one for the account and php and posting works. I have a second domain with a different doc root directory and I'm not able to do a POST and when I hit a PHP page it just shows the source. I've tried to copy the directory configuration from the working one to the non-working one in the httpd.conf file but nothing has worked.

What am I missing?

Thanks,

bearbr

jalal
03-23-2006, 12:52 AM
Did you restart Apache after changing the .conf file?

And what does "not able to do a POST" mean?

bearbr
03-23-2006, 07:28 AM
Hi,

Thank you for the reply - yes I restarted via apachectl restart. When I try to do a post I get:

405 Method Not Allowed
The requested method POST is not allowed for the URL /contact/feedback.php.

bearbr

wildjokerdesign
03-23-2006, 07:38 AM
What is it that you have added to the httpd.conf for the second domain?

BTW: There really should not have been any need to change the httpd.conf. I have a couple secondary domains that have there www roots out side of the main domains www root and have not had to make any changes for php. I have had to add changes for perl or cgi scipting.

bearbr
03-23-2006, 08:10 AM
Here's what I've currently got:

<VirtualHost *>
ServerName skyvalleyschool.com
ServerAlias www.skyvalleyschool.com
DocumentRoot /www/skyvalleyschool
ScriptAlias /cgi-bin "/www/skyvalleyschool/cgi-bin"
<Directory /www/skyvalleyschool>
Options Indexes ExecCGI FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
AddType application/x-httpd-php .php
</VirtualHost>

wildjokerdesign
03-23-2006, 08:32 AM
The only thing that I can see is that your DocumentRoot is useing a symlink instead of a full path. www is a symlink on the server that leads to /usr/local/apache. It may also be that you have them in /usr/local/apache physically but I don't think that should matter.

The secondary domains I have that do not have any problems or added httpd.config settings are located in /usr/home/username directorys and I have thier DocumentRoots set to that physical path.

You might try changeing the the DocumentRoots for yours to /usr/local/apache/skyvalleyschool and see if that makes a difference. It is possible that if you set up Options FollowSymLinks for the www directory that it would fix your porblem but I am not sure that is a good idea security wise. I would almost suggest moveing your files to a different direcotry. Either the default that SiteManger supplies, /usr/home/username as I use or a directory under your main domain. I actually have a few secondary domains set up at /var/www/username on some accounts which would be ok. I really think it is the use of a symlink in the path.

bearbr
03-23-2006, 02:07 PM
I tried using the exact path /usr/local/apache and it didn't help. Then I moved it to /usr/home/xxxxx and it didn't work there either. Is there some setting that is overriding the permissions?

bearbr
03-23-2006, 02:36 PM
Ok, I got it working. Instead of:

<Directory /www/skyvalleyschool>
Options Indexes ExecCGI FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
AddType application/x-httpd-php .php

I have:

<Directory "/www/skyvalleyschool">
Options FollowSymLinks MultiViews Includes ExecCGI
</Directory>

I guess the Allow/Order stuff must have been screwing me up...

wildjokerdesign
03-23-2006, 03:25 PM
I guess the Allow/Order stuff must have been screwing me up...
It was either that or the lack of quotes " " around the path. :) I just noticed in your last post that the original examples you where giveing did not use the quotes and then the one you post shows them.

I have the allows in a couple of mine and they do not effect php. I would leave it as is if all is working though. :) BTW the AllowOverride None would keep you from being able to use .htaccess files in that directory so if you did happen to add them back in and ran across a case where your .htaccess file did not work in that directory that would be why.

Glade you got it working. Thanks for letting us know the outcome.

bearbr
03-23-2006, 05:30 PM
Thank you for your help