Apache VirtualHost and localhost

后端 未结 11 1025
广开言路
广开言路 2020-12-07 09:48

I\'m working with XAMPP on Mac OS X.

I\'m trying to run a Symfony website properly for a client, and I really don\'t know Symfony (yet). I just want to install and la

11条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 10:42

    For someone doing everything described here and still can't access:

    XAMPP with Apache HTTP Server 2.4:

    In file httpd-vhost.conf:

    
        DocumentRoot "D:/xampp/htdocs/dir"
        ServerName something.dev
       
        Require all granted #apache v 2.4.4 uses just this
       
    
    

    There isn't any need for a port, or an IP address here. Apache configures it on its own files. There isn't any need for NameVirtualHost *:80; it's deprecated. You can use it, but it doesn't make any difference.

    Then to edit hosts, you must run Notepad as administrator (described bellow). If you were editing the file without doing this, you are editing a pseudo file, not the original (yes, it saves, etc., but it's not the real file)

    In Windows:

    Find the Notepad icon, right click, run as administrator, open file, go to C:/WINDOWS/system32/driver/etc/hosts, check "See all files", and open hosts.

    If you where editing it before, probably you will see it's not the file you were previously editing when not running as administrator.

    Then to check if Apache is reading your httpd-vhost.conf, go to folder xampFolder/apache/bin, Shift + right click, open a terminal command here, open XAMPP (as you usually do), start Apache, and then on the command line, type httpd -S. You will see a list of the virtual hosts. Just check if your something.dev is there.

提交回复
热议问题