Jump to content

php not working in virtual hosts with apacheb


Recommended Posts

Hi,

 

I am a newbie.  I am trying to setup virtual hosts with apache & php on linux (debian-lenny) (just did the standard apt-get install php5 apache2)

 

PHP seems to be working when directly accessed, but doesn't seem to work when you access it through a virtual host.  For example,

 

http://173.203.103.24/www.labautomate.net/htdocs/phpversion.php

 

works but

 

http://new.labautomate.net/phpversion.php

 

makes my browser try to download the php file...

 

Could someone help me figure out what is going on?

Link to comment
Share on other sites

kkm@hp1:/etc/apache2/sites-enabled$ cat www.labautomate.net

#

#  Example.com (/etc/apache2/sites-available/www.labautomate.net)

#

<VirtualHost 173.203.103.24:80>

        ServerAdmin webmaster@labautomate.net

        ServerName  www.labautomate.net

        ServerAlias labautomate.net

        ServerAlias new.labautomate.net

 

        # Indexes + Directory Root.

        DirectoryIndex index.htm index.html

        DocumentRoot /var/www/www.labautomate.net/htdocs/

 

        # CGI Directory

        ScriptAlias /cgi-bin/ /var/www/www.labautomate.net/cgi-bin/

        <Location /cgi-bin>

                Options +ExecCGI

        </Location>

 

        # Logfiles

        ErrorLog  /var/www/www.labautomate.net/logs/error.log

        CustomLog /var/www/www.labautomate.net/logs/access.log combined

</VirtualHost>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.