Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder timgolding's Avatar
    Join Date
    Aug 2006
    Location
    Southampton
    Posts
    1,519
    Thanks
    114
    Thanked 110 Times in 109 Posts

    virtual host on development environment

    Hi,

    I am trying to create a virtualhost for a development environment
    We have a separate local server for all our developments. At present we have been putting new projects in new folders on the test server that would look like this

    .
    ..
    domain1.com
    domain2.com
    and hadn't set up any virtual hosts. I suggested we use virtualhosts because we are getting the problem in our sites where links arn't relative to the document root when we upload them to the live server. I have set up a virtual host on a real server but that was when I had domains pointing to the server. I'm not sure how do this when our development server
    When we access our sites to test we would type

    unfortunatley the document root would still be in htdocs and not in htdocs/domain.com/

    If someone can help me replace the squiggly brackets following

    Code:
    <VirtualHost {vhost}>
      DocumentRoot /Applications/MAMP/htdocs/domian.com
      ServerName  {domain.com}
    </VirtualHost>
    Any ideas?
    You can not say you know how to do something, until you can teach it to someone else.

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    I believe, after setting up a virtual host, we can access it by just typing www.example.com
    1. Configuring 'httpd-vhosts.conf' file
    path:
    \apache\conf\extra\httpd-vhosts.conf

    Code:
    ServerName www.example.com
    DocumentRoot "C:/XAMPP/htdocs/mysitefolder"
    
    Options FollowSymLinks
    AllowOverride All
    
    
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
    2. Configuring 'hosts' file
    path:
    \system32\drivers\etc

    Code:
    127.0.0.1 www.example.com
    3. Restart xammp.

    4. Try typing "www.example.com" in your browser!!
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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