Solved

Virtual host with support for PHP

Posted on 2006-06-20
6
810 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 500 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
What You Need to Know when Searching for a Webhost Provider
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn how to count occurrences of each item in an array.

730 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