Results 1 to 6 of 6
Hello!
I recently installed Apache http server on my linux distribution Fedora Core 3. It's main folder is now set to /var/www/html but I would like to change default folder ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 06-16-2006 #1Just Joined!
- Join Date
- Jun 2006
- Posts
- 8
Apache directory listing
Hello!
I recently installed Apache http server on my linux distribution Fedora Core 3. It's main folder is now set to /var/www/html but I would like to change default folder to /home/ftp/pub which is already used by vsftpd. What do I have to change now in config file so Apache will list files from my anonymous FTP folder (/home/ftp/pub) but not load index files from /var/www/html? I already tried to use "alias" in config file but without success. Everytime I get "403 Forbidden" error.
Any ideas how to do that?
Regards,
krneki
- 06-16-2006 #2Linux Enthusiast
- Join Date
- Dec 2004
- Posts
- 637
Edit /etc/apache2/default-server.conf and edit this line:
DocumentRoot "/srv/www/htdocs"
Try inserting DocumentRoot "/srv/html"
Then restart apache2 and see what happens.
Of course, my example is from SuSE - noting the default /srv/www/htdocs; however, editing this line "should" take care of your problem, just make sure to restart the daemon once completed and most important, ensure to make a copy of this file prior to editing. Let us know if it works.
- 06-16-2006 #3Linux Enthusiast
- Join Date
- Dec 2004
- Posts
- 637
Oops, got confused, try inserting the following:
DocumentRoot "/srv/ftp"
You may have to chmod to get this to work.
- 06-16-2006 #4Just Joined!
- Join Date
- Jun 2006
- Posts
- 8
My FTP directory is /home/ftp2/pub . I tried to inserted it into config file but when I started Apache I got error "Warning: DocumentRoot [/home/ftp2/pub] does not exist".
I still get 403 Forbidden error. Any new ideas?
- 06-16-2006 #5Linux Enthusiast
- Join Date
- Dec 2004
- Posts
- 637
It's a permissions issue. Why don't you point it to the /srv/ftp directory? Your user account is the owner of the /home/ftp2/pub directory; therefore, you are receiving the error. Try chmod!
- 06-17-2006 #6Linux Enthusiast
- Join Date
- Aug 2005
- Location
- Hell
- Posts
- 514
Fedora Core has SELinux which enforces that things need to have the right "context" to be accessible by Apache. /var/www/html and stuff created in it automatically inherit the right context, but things created in other places do not. Do something like
Originally Posted by krneki
Code:chcon -R -t httpd_sys_content_t /home/ftp/pub


Reply With Quote
