how to configuring a xampp web server for different root directory

后端 未结 10 1913
予麋鹿
予麋鹿 2020-12-02 07:17

The web directory is the home of all of your application\'s public and static files. Including images, stylesheets and JavaScript files. It is also where the front controlle

相关标签:
10条回答
  • 2020-12-02 07:55

    You can also put in a new virtual Host entry in the

    c:\xampp\apache\conf\httpd-vhosts.conf

    like:

    <VirtualHost *:80>
      ServerAdmin webmaster@dummy-host2.example.com
      DocumentRoot "C:/xampp/htdocs/myproject/web"
      ServerName localhost
      ErrorLog "logs/dummy-host2.example.com-error.log"
      CustomLog "logs/dummy-host2.example.com-access.log" common
    </VirtualHost>
    
    0 讨论(0)
  • 2020-12-02 07:59

    If you are running xampp on linux based image, to change root directory open:

    /opt/lampp/etc/httpd.conf
    

    Change default document root: DocumentRoot "/opt/lampp/htdocs" and <Directory "/opt/lampp/htdocs"

    to your folder DocumentRoot "/opt/lampp/htdocs/myFolder" and <Directory "/opt/lampp/htdocs/myFolder">

    0 讨论(0)
  • 2020-12-02 08:00

    # 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/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks Includes ExecCGI
    
    #
    # 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 All
    
    #
    # Controls who can get stuff from this server.
    #
    Require all granted
    

    Write above code inside following tags < Directory "c:\projects" > < / Directory > c:(you can add any directory d: e:) is drive where you have created your project folder.

    Alias /projects "c:\projects"

    Now you can access the pr0jects directory on your browser :

    localhost/projects/

    0 讨论(0)
  • 2020-12-02 08:01

    ok guys you are not going to believe me how easy it is, so i putted a video on YouTube to show you that [ click here ]

    now , steps :

    1. run your xampp control panel
    2. click the button saying config
    3. select apache( httpd.conf )
    4. find document root
    5. 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)
提交回复
热议问题