How to change xampp localhost to another folder ( outside xampp folder)?

前端 未结 9 1944
闹比i
闹比i 2020-12-01 01:03

How can I change my default xampp localhost c:xampp/htdoc to another folder i.e. c:/alan? When I use the IP address I should be able to view my we

相关标签:
9条回答
  • 2020-12-01 01:36

    For me it was on line 183, but it only works after you reboot your computer. I wish there was a way to quickly change it without having to reboot each time, but for now that's the only way I know how.

    0 讨论(0)
  • 2020-12-01 01:39

    Please follow @Sourav's advice.

    If after restarting the server you get errors, you may need to set your directory options as well. This is done in the <Directory> tag in httpd.conf. Make sure the final config looks like this:

    DocumentRoot "C:\alan"
    <Directory "C:\alan">
        Options Indexes FollowSymLinks
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    
    0 讨论(0)
  • 2020-12-01 01:43

    On Linux Mint (Debian Based) go to /opt/lampp/etc/httpd.conf

    Find YOUR_OWN_FILES_LOCATION to, of course, your files location.

    DocumentRoot "YOUR_OWN_FILES_LOCATION"
    <Directory "YOUR_OWN_FILES_LOCATION">
        #
        # Possible values for the Options directive are "None", "All",
        # or any combination of:
        #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
        #
        # Note that "MultiViews" must be named *explicitly* --- "Options All"
        # doesn't give it to you.
        #
        # The Options directive is both complicated and important.  Please see
        # http://httpd.apache.org/docs/trunk/mod/core.html#options
        # for more information.
        #
        #Options Indexes FollowSymLinks
        # XAMPP
        Options Indexes FollowSymLinks ExecCGI Includes
    
        #
        # AllowOverride controls what directives may be placed in .htaccess files.
        # It can be "All", "None", or any combination of the keywords:
        #   Options FileInfo AuthConfig Limit
        #
        #AllowOverride None
        # since XAMPP 1.4:
        AllowOverride All
    
        #
        # Controls who can get stuff from this server.
        #
        Require all granted
    </Directory>
    
    0 讨论(0)
  • 2020-12-01 01:44

    Edit the httpd.conf file and replace the line DocumentRoot "/home/user/www" to your liked one.

    The default DocumentRoot path will be different for windows [the above is for linux].

    0 讨论(0)
  • 2020-12-01 01:45

    @Hooman: actually with the latest versions of Xampp you don't need to know where the configuration or log files are; in the Control panel you have log and config buttons for each tool (php, mysql, tomcat...) and clicking them offers to open all the relevant file (you can even change the default editing application with the general Config button at the top right). Well done for whoever designed it!

    0 讨论(0)
  • 2020-12-01 01:47

    steps :

    1. run your xampp control panel
    2. click the button saying config
    3. select apache( httpd.conf )
    4. find document root

    replace

    DocumentRoot "C:/xampp/htdocs"
    <Directory "C:/xampp/htdocs">
    

    Those 2 lines

    | C:/xampp/htdocs == current location for root |

    |change C:/xampp/htdocs with any location you want|

    1. save it

    DONE: start apache and go to the localhost see in action [ watch video click here ]

    0 讨论(0)
提交回复
热议问题