XAMPP Accessing Hosts In Documents

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

XAMPP Accessing Hosts In Documents

Postby trymeout » 28. April 2019 22:15

When I was on Windows I had a setup that allowed me to save my websites in my Documents and how I did this was by using another port on my localhost. So far this is what I have done for making it work on Linux...

In the /opt/lampp/etc/httpd.conf file I added this line under Listen 80

Code: Select all
Listen 100


Then I removed the # from #Include etc/extra/httpd-vhosts.conf

Code: Select all
# Virtual hosts
Include etc/extra/httpd-vhosts.conf


In /opt/lampp/etc/extra/httpd-vhost.conf I added the following...

Code: Select all
<VirtualHost *:100>
   ServerName localhost
   DocumentRoot "/home/cam/Documents/Websites/100"
   <Directory "/home/cam/Documents/Websites/100">
      Options +Indexes +FollowSymLinks +Multiviews
      Allow from all
      Require all grante
   </Directory>
</VirtualHost>


Now when I go to localhost:100 in my browser I get the following message...

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.2r PHP/7.1.28 mod_perl/2.0.8-dev Perl/v5.16.3


I tried changing the DocumentRoot and Directory to /opt/lampp/htdocs and it did work. So the cause of this is that XAMPP will not allow me to access any files in my Home folder. How do I fix this so it can access files in my Home folder and Documents?
trymeout
 
Posts: 14
Joined: 20. March 2018 16:02
XAMPP version: 3.3.2
Operating System: Windows 10

Re: XAMPP Accessing Hosts In Documents

Postby trymeout » 07. May 2019 04:36

I figured it out. I need do remove everything in httpd-vhost.conf that is does not start with a #, Essentially every <VirtualHost *:80> tag needs to be removed and replaced with the following...

Code: Select all
<VirtualHost *:80>
   ServerName localhost
   DocumentRoot "/opt/lampp/htdocs"
   <Directory "/opt/lampp/htdocs">
      Order allow,deny
        Allow from all
        Require all granted
   </Directory>
</VirtualHost>

<VirtualHost *:100>
   ServerName localhost
   DocumentRoot "/home/cam/Documents/Websites/100"
   <Directory "/home/cam/Documents/Websites/100">
      Order allow,deny
        Allow from all
        Require all granted
   </Directory>
</VirtualHost>
trymeout
 
Posts: 14
Joined: 20. March 2018 16:02
XAMPP version: 3.3.2
Operating System: Windows 10


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 5 guests