apache2 won't execute php after adding virtual host
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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>
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>
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
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.