Virtual Directory Support under Apache?

myce

Well-Known Member
Oct 24, 2001
46
0
306
Hi,

I have a client who hosts 186 websites on my server, and he wants to use some new software that requires I setup Virtual Directory Support under Apache in order to run it. Can someone please tell me what effect, if any, this will have on a WHM/cPanel server? And also, can someone tell me what I need to do to install this? I've searched all over, and this seems to be a topic with a lot of requests for "HOW TOs" but with very few replies. So, any help is appreciated.
 

myce

Well-Known Member
Oct 24, 2001
46
0
306
Ok, no replies, so I'll bump this back to the top in desperation! Has anyone sucessfully installed virtual directory support on a cPanel/WHM box? Does anyone have a clue what I'm even talking about? This is the TOUGHEST topic I have ever researched; no one offers any information about this, here or anywhere (i.e. other forums!). Any help is appreciated; REALLY! :confused:
 

RickG

Well-Known Member
Feb 28, 2005
238
2
168
North Carolina
Can you find out the objective of your client and/or what the software accomplishes?

I'm not certain you (or the client) is using the correct terminoligy. "Virtual Directory" is sometimes used when discussing Apache under a MAC OS.

In our Linux environment, it is simply either an alias or a standard virtual host container in your httpd.conf

If you can get some more information maybe we can help.
 

myce

Well-Known Member
Oct 24, 2001
46
0
306
Virtual Directory Support "enabled" for PHP, I am told, is the outcome of setting up Virtual Directory Support under Apache. I'm not sure my terminology is correct. I've looked at scores of links to "Virtual Directory Support under PHP" but none ever tell you "HOW" to set it up.

FYI, I tried setting up something called "wildcard (catch-all) subdomains" 6 months ago that I think may be what they want. It required setting up:

NS settings:
*.yourdomain.com IN CNAME yourdomain.com.

Apache server settings:
ServerName yourdomain.com
ServerAlias *.yourdomain.com

It also required this slug of code in the .htaccess file:

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^manage(.*)$ - [L]
RewriteRule ^batch(.*)$ - [L]
RewriteRule ^templates(.*)$ - [L]
RewriteRule ^favicon\.ico(.*)$ - [L]
RewriteRule ^robots\.txt$ - [L]
RewriteRule ^plain\.php$ - [L]
RewriteRule ^(.*)$ index.php [L]

This did not work and play well with cPanel; as I remember, it required manual changes everytime a new domain was added to force the Apache settings to the end of the httpd.conf file and to add the CNAME record for NS. But, the objective was to create "virtual" domains and subdirectories from data stored in a database. When I logged onto the domain using FTP, there were no physical directories below root, but there were literally thousands of "virtual" domains that could be viewed via your browser. The purpose was to create dynamic content on domains that don't really exist in the physical realm. Can you spell "A-D-S-E-N-S-E?" ;)
 
Last edited:

fdg

Registered
Jun 5, 2008
2
0
51
I set up virtual directories for every site using IIS. My sites are PHP, so I'd like to switch to Apache. But I need to determine the answer to this question as well.

Suppose you have a folder called "pages", which resides above the root directory of your site. For instance:

Your site root: /home/sitedirectory/siteroot/index.hml
Your pages: /home/sitedirectory/pages/

In this case, you could could configure the IIS server to call your pages (above the root directory) via http like this:

http://www.example_com/pages/somepage.html

Notice that the pages directory doesn't really exist below the site root. However, creating a virtual directory will allow you to do this.

I think in the Apache world this is handled with symlinks... is this correct?