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.

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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