Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am new to Ubuntu server, so learning as I go along. I have followed a tutorial for setting up Ubuntu server and everything for getting my server running with apache2 and ISPConfig.

My main site runs fine, but I use a folder for when I am messing around with web pages scripts. I used to host on Windows and I didn't have to change anything : it displayed the content of the folder when typed in the URL-bar, but this is not working on this setup.

I have another folder with an index file in it, and this runs ok, so I put an index file in the folder I am having trouble with, and it opened that without any trouble.

My guess is that there is probably something simple to change in apache settings so it can read a directory and not looking for an index file... but I'm not sure how to do that. Can someone help please ?

I hope that all this makes sense.

share|improve this question
    
The reason Windows allowed to access the folder might be because Windows is insecure :D - most people don't want other people rifling around their websites folders... –  Wilf Feb 15 at 22:40

2 Answers 2

Option 1:

Add directory option to Apache configuration file /etc/httpd/httpd.conf or /etc/apache2/apache2.conf:

sudo nano /etc/apache2/apache2.conf

And add Following code:

<Directory /var/www/domain.com/pdfs>
Options Indexes FollowSymLinks
</Directory>

Save and close the file.

Then restart Apache:

/etc/init.d/httpd restart

OR

/etc/init.d/apache2 restart

Option 2:

You can place config line Options Indexes in .htaccess file. Make sure .htaccess file support is enabled.

sudo nano .htaccess

Append following apache directive:

Options Indexes

Save and close the file.


Taken from This Page (written in 2007)

share|improve this answer
1  
That seems right, but for Ubuntu, you should replace the vi command with sudo nano, which is more easy to use for simple tasks like these. And @MarioSegura, please don't direclty link another web-page, if it's down, the person will not have the answer. Please quote this link and write the answer directly. –  MrVaykadji Feb 15 at 22:20
    
Alright thanks, sorry I'm new to askubuntu. I shall make changes to it right now –  Mario Segura Feb 15 at 22:22
    
I edited your post, you could do something like that. –  MrVaykadji Feb 15 at 22:30
    
@MrVaykadji - You can use vi - but nano works much better :-) –  Wilf Feb 15 at 22:39
    
Let's just say that I tried vi ONCE... and I wasn't able to even close it without searching the web >< (fyi : you have to type :q to close vi) –  MrVaykadji Feb 15 at 22:42

Thanks for reply couldn't figure out your method 1, couldn't get it to work but I used part of method 2, I used the .htaccess file from the web folder and added Options Indexes to it but that didn't work but I added Options +Indexes to it (taken from comments from the page your answer was from) and now it work thanks very much for help :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.