A question about folders...

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

A question about folders...

Postby sgreig » 20. February 2010 22:46

Hi there,

I recently had to wipe my hard drive, which means I lost my previous XAMPP install. I have it reinstalled now, but I had a specific setup before that I can't remember how to duplicate. I'm hoping someone on here can give me the answer.

I have a directory called "public_html" within my home directory, "scott," where I keep local versions of websites and test configurations for my web development. On my previous XAMPP install, I had it configured so that if I typed in "http://localhost/scott" in a browser, it would pull up the index of the "public_html" directory and I could run my test installations of wordpress, drupal, etc. from there. When I try typing in "http://localhost/scott" now, it gives me a page not found error. I can't for the life of me remember where I learned how to set that up in the first place, but can one of you guys give me a hand? Thanks.
Posts: 1
Joined: 20. February 2010 22:37

Re: A question about folders...

Postby MC10 » 20. February 2010 23:15

Create the folder "scott" inside "xampp\htdocs", and then create "public_html" inside of "scott". Stick all of your files inside as you used to.
Posts: 148
Joined: 20. February 2010 20:13

Re: A question about folders...

Postby syntax_error » 21. February 2010 17:04

Standard Apache's solution for this is userdir module, which automatically enables access to public_html folder in users' home directories, through http://localhost/~username - see documentation: http://httpd.apache.org/docs/2.2/howto/public_html.html (XAMPP's configuration is in /opt/lampp/etc/extra/httpd-userdir.conf )

Anyway, easier solution for you may be through aliases. Add this to httpd.conf (or create separate configuration file which you can then include):
Code: Select all
Alias /scott "/home/scott/public_html"
<Directory /home/scott/public_html>
   AllowOverride All
   Options Indexes FollowSymLinks

I assume you have standard home directory in /home/scott. Also, make sure you have proper access rights set on both you home directory (at least execute for everyone) and public_html (read and execute for everyone) - that's because Apache is running as different user and group. If you get 403 error, try to play with permissions a bit.

Or you can use roughly MC10's solution and create symlink to directory /opt/lampp/htdocs/scott
Posts: 14
Joined: 09. February 2010 19:24

Re: A question about folders...

Postby Olwe » 12. June 2010 18:17

I tried the Apache way. I looked in httpd-userdir.conf and the default seemed to be to allow http://localhost/~me and the userdir module seems to be loading, but I get "Object Not Found." BTW, how does XAMPP Apache know who the user is? I can imagine httpd-userdir.conf is perfect, the module is loading it, but how does it know to refer to my /home/me/public_html ?
Posts: 9
Joined: 11. June 2010 01:19

Re: A question about folders...

Postby Olwe » 12. June 2010 20:08

Solved: In httpd.conf there's a line that needs to be uncommented:
# User home directories

Include etc/extra/httpd-userdir.conf[/quote]

Then you can get your /home/me/public_html seen by Apache....
Posts: 9
Joined: 11. June 2010 01:19

Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 2 guests