Virtual Hosts in Documents

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Virtual Hosts in Documents

Postby 7sara » 12. July 2019 19:01

Hello!

I have been using XAMPP for many years now and recently got myself a new System76 computer! And I got XAMPP all setup except I cannot figure out how to create my virtual hosts in my documents folder.

I like keeping my projects in my document and not in the htdocs directory. This is my setup below where I told it to listen on port 5000 and added my virtual host configuration. But when I go to localhost:5000 in firefox I get this error

Code: Select all
Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.
Error 403
localhost
Apache/2.4.39 (Unix) OpenSSL/1.0.2s PHP/7.3.7 mod_perl/2.0.8-dev Perl/v5.16.3


How would one be able to use their Documents folder as a virtual host on linux? :(

httpd,conf
Code: Select all
Listen 5000

# Virtual hosts
Include etc/extra/httpd-vhosts.conf


httpd-vhosts.conf
Code: Select all
# Virtual Hosts
#
# Required modules: mod_log_config

# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:80>
   ServerName localhost
   DocumentRoot "/opt/lampp/htdocs"
   <Directory "/opt/lampp/htdocs">
      Order allow,deny
        Allow from all
        Require all granted
   </Directory>
</VirtualHost>



<VirtualHost *:5000>
   ServerName localhost
   DocumentRoot "/home/sara/Documents/Websites/XAMPP/5000"
   <Directory "/home/sara/Documents/Websites/XAMPP/5000">
      Order allow,deny
        Allow from all
        Require all granted
   </Directory>
</VirtualHost>
7sara
 
Posts: 1
Joined: 11. July 2019 20:36
XAMPP version: 7.3.7-0
Operating System: Linux

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 27 guests