Change htdocs from XAMPP to USB stick folder (or use XAMPP on Pendriver)

Asked

Viewed 2,359 times

0

I already researched a lot, I changed everything that was line httpd.conf and httpd-xampp.conf but nothing went right.

I am trying to change the default htdocs xampp folder to a folder on my pendriver, but when localhost requirement on the browser, it is returned:

Access Prohibited!

You are not allowed to access the requested directory. You may not exist the index file or the directory may be protected against reading.

If you believe you have encountered a problem on the server, please contact the webmaster.

Error 403 localhost Apache/2.4.29 (Win32) Openssl/1.1.0g PHP/7.2.2

Could someone help me? (xampp is installed on C: PC)


Edit:

Following more or less what @Andremesquita said and some google articles out... I did the following setup on httpd.conf:

DocumentRoot "S:\Git\projeto"
<Directory "S:\Git\projeto">
    #
    # 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.4/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:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    #AllowOverride All

    #
    # Controls who can get stuff from this server.
    #
    #Require all granted

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

</Directory>

Still unsuccessful...

  • Change the permissions on your USB stick and include the All user group with full access. Do not forget to put the permissions on apache2.conf. Should work.

  • 1

    Post as this the Virtualhost or Documentroot of the configuration files.

  • @Andremesquita, where the apache2.conf archive is located?

  • 1

    @Guilhermenascimento , would be httpd.conf and httpd-xampp.conf ?

  • This differs greatly depending on the version or environment, in Linux for example the files are other, in Mac with Mamp are other, in Mac with Apache is only another scheme. The file scheme vc itself can configure

  • I am using windows

  • Regardless if it is windows, the Apache schema and configuration files is customizable, I don’t really use Xampp (which is just a package like Wamp, easyphp and the like), what I understand is apache. However what I found strange about your problem is that Xampp Portable didn’t work for you. I think you must be using some program that is occupying port 80 (like Skype or else has two installations of Xampp and you didn’t even notice).

  • I recommend you look at the Apache log, there is the complete error.

  • Guilherme, when using the default folder (htdocs, with apache installed on the PC) works perfectly...

Show 4 more comments

3 answers

0

You need to locate the apache configuration file and include in it:

<Directory K:\inetput\>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all 
</Directory>

Where, K: inetput is the path of the pendrive.

I hope it helps. Anything, comments and we will correct the answer.

Abs

  • what is the file name?

  • In apache2, in linux, it is apache2.conf and 000-default. Guilherme, in the comment of the question spoke of httpd.conf and/or httpd-xampp.conf, but I do not know.

  • am using windows

0

Follow the step by step

  1. Open the shaman
  2. Config
  3. Apache httpd.conf
  4. Use CTRL + F
  5. Documentroot "C:/xampp/htdocs"
  6. <Directory "C:/xampp/htdocs">

Put the directory you want.

0


I did it! I decided to follow the other option that @Rafaelsouzacalearo gave...

If someone has the same problem as me, (tried to install xampp in several ways) these commands can be useful:

  • ERROR:

Apache Service Detected with Wrong path

Mysql Service Detected with Wrong path

Found Path: "C: xampp apache bin httpd.exe" -k runservice Expected Path: "s: xampp apache bin httpd.exe" -k runservice

Found Path: C: xampp mysql bin mysqld.exe --defaults-file=c: xampp mysql bin my.ini mysql Expected Path: s: xampp mysql bin mysqld.exe --defaults-file=s: xampp mysql bin my.ini mysql

Motive:

There are xampp services that have not been removed from windows after an uninstallation

How to correct:

Delete those services that are preventing xampp Portable from starting!

Open CMD as admin and run:

sc delete nome_do_serviço

in my case were "Apache2.4" and "mysql", after deleting these services, restart XAMPP.

  • ERROR:

Problem Detected!

Port 80 in use by "Unable to get info" with PID 7612!

Port 443 in use by "Unable to get info" with PID 7612!

Port 3306 in use by "Unable to get info"!

Motive:

The flash drive may have been removed without finalizing the modules and now the ports are being occupied by processes that windows has maintained.

How to correct:

Sometimes XAMPP shows the PID of the process that is occupying the port, just finishing these processes with CMD in administrator mode:

taskKill.exe /F /PID n_do_PID_AQUI

But sometimes it doesn’t show the PID as it did with the error on port 3306 I showed above, so it is necessary to search the process through the door and see which PID:

netstat -a -n -o | findstr :n_da_porta

CMD will show all processes, just see the PID number (last column) and run taskkill again and restart XAMPP.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.