1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Virtual host XAMPP MacBook

Discussion in 'Apache' started by behnampmdg3, Nov 7, 2013.

  1. #1
    Hi I have been trying to set up virtual host on XAMPP but I keep failingQ

    When I go to
    http://z
    Code (markup):
    I see the content of /Applications/XAMPP/htdocs while it is supposed to show the content of /Applications/XAMPP/vhosts/z.

    What I have done so far:
    - Stop MAc server
    - Restart XAMPP
    - Edit /Application/XAMPP/etc/httpd.conf (for document root and incuding /Applications/XAMPP/etc/extra/httpd-vhosts.conf file

    - Edit /etc/hosts
    - Edit httpd-vhosts.conf

    ===================


    bash-3.2# sudo apachectl stop
    Code (markup):
    
    bash-3.2# /Applications/XAMPP/xamppfiles/xampp restart
    Restarting XAMPP for Mac OS X 1.7.3...
    XAMPP: Stopping Apache...ok.
    XAMPP: Stopping MySQL...not running.
    XAMPP: Stopping ProFTPD...not running.
    XAMPP: Starting Apache...already running.
    XAMPP: Starting MySQL...ok.
    XAMPP: Starting ProFTPD...ok.
    
    Code (markup):
    /Applications/XAMPP/etc/extra
    bash-3.2# cat httpd-vhosts.conf
    #
    # Virtual Hosts
    
    NameVirtualHost *:80
    <VirtualHost _default_:80>
      DocumentRoot "/Applications/XAMPP/htdocs/"
    </VirtualHost>
    
    <VirtualHost *:80>
      DocumentRoot "/Applications/XAMPP/vhosts/z"
      ServerName z
      ErrorLog "/Applications/XAMPP/vhosts/z/local-error.log"
      <Directory "/Applications/XAMPP/vhosts/z">
      Allow from all
      AllowOverride All
      Require all granted
      </Directory>
    </VirtualHost>
    
    
    Code (markup):
    /etc/hosts
    bash-3.2# cat hosts
    ##
    # Host Database
    #
    # localhost is used to configure the loopback interface
    # when the system is booting.  Do not change this entry.
    ##
    127.0.0.1   localhost
    255.255.255.255   broadcasthost
    ::1  localhost
    fe80::1%lo0   localhost
    
    127.0.0.1   activate.adobe.com
    220.244.223.153    au.yahoo.com www.yahoo.com yahoo.com yahoo.com.au
    #Added by XAMPP Control
    127.0.0.1 192-168-1-6.tpgi.com.au
    
    
    192.168.1.1   pocket.wifi
    127.0.0.1 192-168-1-3.tpgi.com.au
    
    #Added by XAMPP Control
    127.0.0.1 192-168-1-3.tpgi.com.au
    
    127.0.0.1 z
    
    
    #Added by XAMPP Control
    127.0.0.1 192-168-1-4.tpgi.com.au
    
    bash-3.2#
    
    Code (markup):
    /Applications/XAMPP/etc/httpd.conf/
    DocumentRoot "/Applications/XAMPP/xamppfiles/vhosts"
    
    # Virtual hosts
    Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
    
    
    Code (markup):
    A few points:
    1 - It is using with the /etc/hosts file (not /Applications/XAMPP/etc/hosts).
    2 - When I go to
    http://z
    Code (markup):
    I see the content of /Applications/XAMPP/htdocs. This means the only thing that is working is the /etc/hosts file and virtual host set up is being ignored!
    3 -http://localhost shows the content of /Applications/XAMPP/htdocs
    4 -
    http://vhosts
    Code (markup):
    goes to Google.com
    5 - Also why did you ask me to use /etc/hosts and not /Applications/XAMPP/etc/hosts?






    Any thoughts?
     
    behnampmdg3, Nov 7, 2013 IP
  2. cesurasean

    cesurasean Active Member

    Messages:
    269
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #2
    try a lowercase "include"
     
    cesurasean, Nov 24, 2013 IP