Solved

Virtual host with support for PHP

Posted on 2006-06-20
6
806 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.dwt files not viewable in browser - why? 2 75
SSL sertificate 5 58
Form submit issue 11 80
Connect to MS-SQL server from Linux/PHP 8 81
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

863 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now