LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   *BSD (http://www.linuxquestions.org/questions/%2Absd-17/)
-   -   PHP5 and Apache2.2 on FreeBSD 6.1-STABLE (http://www.linuxquestions.org/questions/%2Absd-17/php5-and-apache2-2-on-freebsd-6-1-stable-452109/)

deesto 06-06-2006 11:19 AM

PHP5 and Apache2.2 on FreeBSD 6.1-STABLE
 
I upgraded my system from 5.4-RELEASE to 6.1-STABLE last week, and my web server immediately stopped serving PHP pages, where I had no problem doing so before.

/usr/ports/UPGRADING mentions that PHP has been streamlined and must be recompiled to work with Apache and other packages. After deinstalling, configuring (where applicable), and reinstalling PHP5, php5-extensions, and apache2 to the latest versions, not only are PHP files not being served, but my web server is toast:
"Forbidden You don't have permission to access / on this server."

I edited the new apache config file (now located in /usr/local/etc/apache22/httpd.conf) with my system information, including a DocumentRoot path. But when I start apache, I get some very peculiar errors:
"Warning: DocumentRoot [/www/docs/dummy-host.example.com] does not exist
Warning: DocumentRoot [/www/docs/dummy-host2.example.com] does not exist"

Not only did I confirm that I have set the DocumentRoot path, and that apache is using the correct config file... but these "dummy" paths don't exist in the config file!

I'd greatly appreciate any help in sorting this out. I can't attach my httpd.conf file here, but I'd be glad to get it to you if you'd like a look.

Thank you,
John

reddazz 06-06-2006 12:33 PM

Comment out the virtual hosts section in your httpd.conf. e.g.
Code:

# Virtual hosts
#Include conf/extra/httpd-vhosts.conf


deesto 06-06-2006 01:12 PM

LOL... fer kripes' sake: how would I have known that they've booted the vhosts stuff out to an include file?!? Thanks for that... would have been some time before I figured that out!

Still having trouble though: my "main" site loads properly, but the other virtual hosts aren't. I was getting a warning "NameVirtualHost *:80 has no VirtualHosts", which I fixed by ensuring both the NameVirtualHost entry and each separate VirtualHost entry included a value of "*:80". But when I browse to any virtual host address, it redirects to the default host content. Here's what my httpd-vhosts.conf looks like:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.SiteA.com
ServerAlias SiteA *.SiteA.com
DocumentRoot /usr/www
ErrorLog /var/log/httpd-SiteA-error.log
CustomLog /var/log/httpd-SiteA-access.log combined
</VirtualHost>

<VirtualHost *:80>
ServerName www.SiteB.com
ServerAlias SiteB *.SiteB.com
DocumentRoot /usr/www2
ErrorLog /var/log/httpd-SiteB-error.log
CustomLog /var/log/httpd-SiteB-access.log combined
</VirtualHost>


So, what's happening is that SiteA works as expected, but browsing to SiteB brings you to SiteA, or doesn't load at all ("forbidden" error). What am I doing wrong?

In addition, I'm back to my original problem, where PHP files are not loading, and browsing to a PHP page prompts the user to download the page as a file.

davedoc 08-20-2006 05:40 PM

Did you get this working. I have the same setup, same situation, same errors. Just no resolutino.


All times are GMT -5. The time now is 09:47 PM.