LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-26-2006, 07:07 PM   #1
c--
Member
 
Registered: Sep 2004
Location: Oregon, USA
Distribution: Ubuntu/Debian
Posts: 82

Rep: Reputation: 15
apache2 won't execute php after adding virtual host


I've been working on developing a website using the joomla CMS on a system for a few days by accessing the IP address directly. Then i got a domain name, and tried to add a virtual host file. I copied the default in sites-available, added a ServerName line, changed the DocumentRoot, and symbolicly linked it in sites-enabled.

At this point, PHP isn't working at all. Whenever I request a page that uses php, i end up downloading the PHP source. There are no errors in the apache error.log file.

I am running debian 3.1 stable, with apache2.

heres the default virtual host file in sites-enabled, the only one there at the moment.

NameVirtualHost *
<VirtualHost *>
ServerName jabberwock.botworks.com
DocumentRoot /var/www/
ServerAdmin webmaster@localhost
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options ExecCGI Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
# 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/
</Directory>

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined
ServerSignature On

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>
 
Old 01-27-2006, 11:52 AM   #2
Jelle
Member
 
Registered: Feb 2004
Location: Utrecht, The Netherlands
Distribution: Debian
Posts: 79

Rep: Reputation: 15
So what lines in there do you think would enable php?
Maybe you have not enabled php for the whole site but only a directory. Find the lines that define php behavior in your apache(2?).conf or httpd.conf to figure out.

btw, are you sure you have apache2 installed? the domain you mentioned gives this as error message:
The requested URL /lalala was not found on this server.
Apache/1.3.33 Server at jabberwock.botworks.com Port 80
 
Old 01-27-2006, 01:19 PM   #3
c--
Member
 
Registered: Sep 2004
Location: Oregon, USA
Distribution: Ubuntu/Debian
Posts: 82

Original Poster
Rep: Reputation: 15
yes, I am sure I WAS running apache2, I switched back to the default 1.3 that came with debian because it actually worked.

as for enabling php, there are no references to it anywhere in /etc/apache2, but it was working when I accessed the site using the ip address directly. what lines should I use? is there some debian package that takes care of that automaticaly?

I don't even know what to look for here. I always code CGIs in perl so I don't have any idea about configuring apache for php, it usualy just works on the ubuntu systems I develop on.
 
Old 01-27-2006, 01:34 PM   #4
Jelle
Member
 
Registered: Feb 2004
Location: Utrecht, The Netherlands
Distribution: Debian
Posts: 79

Rep: Reputation: 15
Maybe if you do a `find /etc/apache/ -type f -exec grep 'php' {} /dev/null \;|less` you will get an idea where the current php stanza's are. I am pretty sure they are there somewhere, it is not magical how apache treats php files after all.
Btw you did use the conf.d directory for your virtual host did you?
 
  


Reply



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 virtual host. hgb Linux - Networking 10 01-24-2009 02:05 AM
Apache2 Virtual Host SSI problems superscrappy Linux - Software 1 08-30-2005 05:04 PM
apache2 help -Virtual Host- Fredstar *BSD 4 06-06-2005 01:09 PM
Can't do Apache2 virtual host different ports SK_pt Linux - Software 3 01-30-2005 07:04 PM
apache2, virtual host problems rjcrews Linux - Software 13 05-25-2004 08:16 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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