?
Solved

Virtual host with support for PHP

Posted on 2006-06-20
6
Medium Priority
?
812 Views
Last Modified: 2013-11-18
I have a directory in my document root "C:\Program Files\Apache Group\Apache2\htdocs"
named private_party. I need to create a new vertual host with the name www.private_party.com that uses the private_party directory and add PHP support for the www.private_party.com virtual host. I don't know how to configure the directory and to add the handlers correctly. This is what I have tried so far.

#
# the virtual host private_party
#

   <VirtualHost *>
        ServerName www.private_party.com
        DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
      Options -FollowSymLinks -ExecCGI -Includes
      ErrorLog logs/private_party.com-error_log
      CustomLog logs/private_party.com-access_log common
      ScriptAlias  "c:/php/"
   </VirtualHost>
What should it be and do I need code for any other part of my httpd.conf
0
Comment
Question by:sendhelp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 51

Accepted Solution

by:
ahoffmann earned 2000 total points
ID: 16944278
should work if you also have a

NameVirtualHost *

otherwise please post the URL which does not work.

>      ScriptAlias  "c:/php/"
do you use php as CGI?
0
 

Author Comment

by:sendhelp
ID: 16945436
Here is my URL my default is:
 <VirtualHost *>
      ServerName localhost.com
      DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs/"
   </VirtualHost>


http://localhost/private_party/test.php


everything else works using html extension, i.e.   http://localhost/private_party/index.html 
just not php extensions
0
 

Author Comment

by:sendhelp
ID: 16945536
I mean yes I have NameVirualHost *
#
# Use name-based virtual hosting.
#
#

   NameVirtualHost *
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:sendhelp
ID: 16945629
I want to use php as my cgi
Here is what I have changed or added on my httpd.conf, should I change, delete, or add anything else. I am not experienced with this at all. I am trying to work from books and a cd tutorial and php is not working for me. Please tell me where to make any changes in the file.

ServerRoot "C:\Program Files\Apache Group\Apache2"

 
DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"

DirectoryIndex index.html index.htm index.cgi default.htm default.html index.phtml index.php

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml
AddType application/x-httpd-php "/php-exe-location/php.exe"
ScriptAlias /php-exe-location/ "C:/PHP/"


#
# Use name-based virtual hosting.
#
#

   NameVirtualHost *


   <VirtualHost *>
         ServerName www.private_party.com
         DocumentRoot "C:/Program Files/Apache Group/Apache2/htdocs"
       Options -FollowSymLinks -ExecCGI -Includes
       ErrorLog logs/private_party.com-error_log
       CustomLog logs/private_party.com-access_log common
   </VirtualHost>

0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 16946309
> ServerRoot "C:\Program Files\Apache Group\Apache2"
you should not use \ but /
0
 

Author Comment

by:sendhelp
ID: 16948382
Thank you. I got everything working.
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question