+ Post New Thread
Results 1 to 14 of 14
Web Development Thread, Apache2Triad running 2 sites from different drives in Coding and Web Development; My school has a new server on which they want to run the school website and VLE (Moodle), and it's ...
  1. #1

    beeswax's Avatar
    Join Date
    Jul 2005
    Location
    England
    Posts
    2,285
    Thank Post
    285
    Thanked 225 Times in 153 Posts
    Rep Power
    131

    Apache2Triad running 2 sites from different drives

    My school has a new server on which they want to run the school website and VLE (Moodle), and it's been divided into 2 drives, C:\ for the website and A2T, and D:\ for the VLE. Is this possible, and if so, how is it achieved?

    *EDIT* My school hada new server which just blue screened.

  2. #2

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,413
    Thank Post
    642
    Thanked 964 Times in 664 Posts
    Blog Entries
    2
    Rep Power
    327

    Re: Apache2Triad running 2 sites from different drives

    Apache virtual host, something like this off the top of my head:

    Code:
    <VirtualHost *:80>
            DocumentRoot C:/website
            ServerName www.ourschool.lea.sch.uk
    </VirtualHost>
    
    <VirtualHost *:80>
            DocumentRoot D:/moodle
            ServerName vle.ourschool.lea.sch.uk
    </VirtualHost>
    You will be able to test this by temporarily adding lines in the c:\windows\system32\drivers\etc\hosts file:

    Code:
    172.16.8.1 www.ourschool.lea.sch.uk
    172.16.8.1 vle.ourschool.lea.sch.uk
    Where 172.16.8.1 is the IP of your new server

  3. #3

    beeswax's Avatar
    Join Date
    Jul 2005
    Location
    England
    Posts
    2,285
    Thank Post
    285
    Thanked 225 Times in 153 Posts
    Rep Power
    131

    Re: Apache2Triad running 2 sites from different drives

    you lost me after "Apache" lol. I should have added that pupils will connect to the VLE via the website, so will your above instructions still apply?
    thanks Craig

  4. #4

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,413
    Thank Post
    642
    Thanked 964 Times in 664 Posts
    Blog Entries
    2
    Rep Power
    327

    Re: Apache2Triad running 2 sites from different drives

    Sorry Basically you need to edit apache's httpd.conf file to include those lines above, which will accept connections when the specific domain is requested, and will load files from the respective DocumentRoot directives. That's if you run them across separate domains.

    If you're just using one domain but want the files stored elsewhere, you'll need to use Alias:

    Code:
    Alias /moodle/ "/D:/moodle/"
    So http://myserver/ will load files from wherever they are at the moment. http://myserver/moodle/ will load them from D:\moodle\.

  5. #5
    alan-d's Avatar
    Join Date
    Aug 2005
    Location
    Sutton Coldfield
    Posts
    2,421
    Thank Post
    360
    Thanked 258 Times in 189 Posts
    Rep Power
    76

    Re: Apache2Triad running 2 sites from different drives

    @ webman

    Would you be so kind and tell me exactly what I need to put into the httpd.conf file after:

    Listen *:80

    I have a website running from C: and I want another running from D: - single IP addy (Test setup so no DNS as yet - will have to edit host file)

    Between the apache docs and what you have put up top I can't work it out - btw I'm a noob at apache and most scripting if I'm honest

    Most kind

  6. #6

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,413
    Thank Post
    642
    Thanked 964 Times in 664 Posts
    Blog Entries
    2
    Rep Power
    327

    Re: Apache2Triad running 2 sites from different drives

    In your case you'd just use Alias:

    Code:
    Alias /moodle/ "/D:/moodle/"
    So www.example.com/moodle would load files from d:\moodle

    You only need VirtualHost if you want to run multiple hostnames/domains off a single IP address.

  7. #7
    alan-d's Avatar
    Join Date
    Aug 2005
    Location
    Sutton Coldfield
    Posts
    2,421
    Thank Post
    360
    Thanked 258 Times in 189 Posts
    Rep Power
    76

    Re: Apache2Triad running 2 sites from different drives

    Thanks for that - it's what I had but it's not working so I'm obviously doing something wrong

    On C: I have C:\Programe Files\Apache Software Foundation\Apache2.2\htdocs\CMS\news.php - which leads to the home page (http://localhost/CMS/news.php.)

    That works fine

    On D: I have D:\moodle\install.php - This should I believe be http://localhost/moodle/install.php

    I suspect that the windows host file is incorrect - what URL should I be putting after the IP address of the PC if it's only local at the mo? ops:

    Sorry to sound thick - but I am ops:

  8. #8

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,413
    Thank Post
    642
    Thanked 964 Times in 664 Posts
    Blog Entries
    2
    Rep Power
    327

    Re: Apache2Triad running 2 sites from different drives

    Could you PM me your httpd.conf so I have a better idea how it's set up please?

  9. #9
    alan-d's Avatar
    Join Date
    Aug 2005
    Location
    Sutton Coldfield
    Posts
    2,421
    Thank Post
    360
    Thanked 258 Times in 189 Posts
    Rep Power
    76

    Re: Apache2Triad running 2 sites from different drives

    Tis on the way

  10. #10

    beeswax's Avatar
    Join Date
    Jul 2005
    Location
    England
    Posts
    2,285
    Thank Post
    285
    Thanked 225 Times in 153 Posts
    Rep Power
    131

    Re: Apache2Triad running 2 sites from different drives

    I'm having to return to this as I thought I'd got it solved, but like news year's resolutions, it all disappeared on new years day. Like alan-d I'm hosting locally while I get my head round design etc but I can't figure out why on D: I have D:\moodle\install.php - This should I believe be localhost/moodle/install.php isn't working for me. Using Apache2Triad.

  11. #11
    alan-d's Avatar
    Join Date
    Aug 2005
    Location
    Sutton Coldfield
    Posts
    2,421
    Thank Post
    360
    Thanked 258 Times in 189 Posts
    Rep Power
    76

    Re: Apache2Triad running 2 sites from different drives

    I'm not in till tomorrow but if you remind me I'll send you a copy of my httpd.conf file for you to compare. I can't remember excatly what I did at the mo.

  12. #12

    beeswax's Avatar
    Join Date
    Jul 2005
    Location
    England
    Posts
    2,285
    Thank Post
    285
    Thanked 225 Times in 153 Posts
    Rep Power
    131

    Re: Apache2Triad running 2 sites from different drives

    Quote Originally Posted by alan-d
    I can't remember excatly what I did at the mo.
    I keep getting flashbacks. lol. Thanks a lot.
    beeswax

  13. #13
    alan-d's Avatar
    Join Date
    Aug 2005
    Location
    Sutton Coldfield
    Posts
    2,421
    Thank Post
    360
    Thanked 258 Times in 189 Posts
    Rep Power
    76

    Re: Apache2Triad running 2 sites from different drives

    Is this any help?

    Code:
    Alias /moodle "D:/moodle"
    <Directory "D:/moodle">
        Options FollowSymLinks MultiViews
        AllowOverride All
        Order deny,allow
        Allow from all
        Satisfy all
    </Directory>

  14. #14

    beeswax's Avatar
    Join Date
    Jul 2005
    Location
    England
    Posts
    2,285
    Thank Post
    285
    Thanked 225 Times in 153 Posts
    Rep Power
    131

    Re: Apache2Triad running 2 sites from different drives

    @ alan-d that worked a treat eventually. tried it at home, pasted above into httpd.conf file, no luck, restarted computer, no luck double-checked, no luck. brought laptop into work this morning, NM manager asks how I got on, preparing excuses as it boots, open browser, click on localhost/moodle expecting zilch and Edugeek be praised! it's a miracle. I'll take the laptop home tonight and see what happens there.

    @webman, thanks once again for all your behind the scenes work. One of the many unsung heros here on Edugeek.

SHARE:
+ Post New Thread

Similar Threads

  1. Proxy sites
    By whatwherewhen in forum Links
    Replies: 33
    Last Post: 28th October 2008, 03:14 PM
  2. Proxy sites now using 443
    By steele_uk in forum How do you do....it?
    Replies: 36
    Last Post: 5th October 2008, 03:45 PM
  3. updating version of MySQL in Apache2Triad
    By beeswax in forum Web Development
    Replies: 7
    Last Post: 27th February 2007, 12:29 PM
  4. Running multiple web sites
    By Doudar in forum Web Development
    Replies: 9
    Last Post: 2nd April 2006, 09:21 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •