LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 06-06-2006, 10:19 AM   #1
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Rep: Reputation: 31
Question 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
 
Old 06-06-2006, 11:33 AM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Comment out the virtual hosts section in your httpd.conf. e.g.
Code:
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
 
Old 06-06-2006, 12:12 PM   #3
deesto
Member
 
Registered: May 2002
Location: NY, USA
Distribution: FreeBSD, Fedora, RHEL, Ubuntu; OS X, Win; have used Slackware, Mandrake, SuSE, Xandros
Posts: 448

Original Poster
Rep: Reputation: 31
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.

Last edited by deesto; 06-06-2006 at 02:05 PM.
 
Old 08-20-2006, 04:40 PM   #4
davedoc
LQ Newbie
 
Registered: Aug 2006
Posts: 1

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


Reply

Tags
apache, configuration, freebsd, packages, php, virtualhosts


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
Apache2 + php5 won't load mustangfanatic Slackware 9 04-19-2006 12:45 PM
Apache2 and PHP5 SpiderIRE Linux - Software 3 09-30-2005 03:25 PM
Apache2 and PHP5 rul3r Slackware 7 09-11-2005 05:21 PM
Apache2 + PHP5.0.3 24jedi *BSD 1 07-21-2005 03:07 PM
Installing Apache2 and PHP5 biglaz Linux - General 1 10-15-2004 10:42 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 06:37 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