Jump to content

Changing document root for an apache alias


s0c0

Recommended Posts

This might be better for the Apache forum, but I'll explain anyways.  I'm switching up my local dev environment so I can use SVN.  I have a directory for all my SVN stuff on my local machine now in /var/svn.  When I call $_SERVER['DOCUMENT_ROOT'] its listing the document root as /var/www.  For this alias I've setup in apache I want the document root to be /var/svn/myproject.  Alot of my includes are failing because of this now.

I fixed this by creating a new virtual host and telling apache to listen on a new port.

 

in /etc/apache2/sites-available/default:

<VirtualHost *:8080>
        ServerAdmin webmaster@localhost
        ServerName 127.0.0.1
        DocumentRoot /var/svn/client
        ErrorLog /var/log/apache2/error.log
        # Possible values include: debug, info, notice, warn, error, crit,alert, emerg.
        LogLevel warn
        CustomLog /var/log/apache2/access.log combined
</VirtualHost>

 

in /etc/apache2/ports.conf

NameVirtualHost *:80
NameVirtualHost *:8080
Listen 80
Listen 8080

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.