View previous topic :: View next topic |
Author |
Message |
Lars Senior Member
Joined: 25 Oct 2010 Posts: 136
|
Posted: Sun Jul 10, 2011 11:45 pm Post subject: apache and index.html |
|
|
I've come so far as to set up a vstftpd-server, putting proftpd down and starting at boot and working perfectly.
But when it came to apache I've got problems with my preconfigured index.html web-pages?
It seems as the default httpd-configuration blocks the whole server if I put an index.html mall.css in the /var/www/htdocs/ directory?
Quote: | 403 Forbidden!
You don't have permission to access /index.html on this server. |
I've tried to see if something in the /etc/httpd/httpd.conf blocks *.html files but found nothing.
Code: | # DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html index.htm index.php
</IfModule> |
suggests that both *.html and *.php should be allowed?
Do you have any suggestions?
I prefer to configure in text-editor!
Best regards
Lars |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Mon Jul 11, 2011 5:52 am Post subject: |
|
|
What are the permissions of index.html?
Try to create a simple index.html to test it, like
"It Works!"
I create a simple one and had no problems.
Code: | -rw-r--r-- 1 root root 9 Jul 11 03:45 /var/www/htdocs/index.html |
If you want to use permissions 600 then you need to make apache the owner
Code: | chown apache:apache /var/www/htdocs/index.html |
Code: | -rw------- 1 apache apache 9 Jul 11 03:45 /var/www/htdocs/index.html |
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
Lars Senior Member
Joined: 25 Oct 2010 Posts: 136
|
Posted: Mon Jul 11, 2011 10:29 pm Post subject: |
|
|
Of course!
I haven't thought about permissions in a couple of years since I used a small web-hotel.
I figured out that if the directories my index pointed to contained flash-objects or even pictures, I had to give x-permissions to them. Just to be as restrictive as possible I followed your way of thinking(?) and made apache owner and group to those directories and set the permissions 700.
The summary in short is:
Code: | /var/www# ls -l
drwxr-xr-x 15 root root 4096 Jul 11 11:15 htdocs/
drwx------ 2 apache apache 4096 Jul 11 12:53 protect/
/var/www/protect ls -l
-rw-r--r-- 1 root root 81 Jul 11 14:22 .htpasswd
-rw-r--r-- 1 root root 20 Jul 10 19:42 .htpasswdhigh
/var/www/htdocs# ls -l
lrwxrwxrwx 1 root root 28 Jul 10 20:39 Musik -> /mnt/Winserver/Apache2/Musik/
-rw-r--r-- 1 root root 2946 Jul 10 20:45 index.html
-rw-r--r-- 1 root root 5642 Oct 28 2010 mall.css
drwxr-xr-x 5 root root 4096 Jan 1 1970 public_html/ |
-The subdirectories in /var/www/htdocs/public_html
all are set to
Code: | drwx------ 3 apache apache 4096....... |
Now I only ask for your opinion, do you think that is a very insecure way of handling it?
Best regards
Lars |
|
Back to top |
|
gerasimos_h Site Admin
Joined: 09 Aug 2007 Posts: 1757 Location: Greece
|
Posted: Tue Jul 12, 2011 5:38 am Post subject: |
|
|
Since it's a webserver, apache must have permissions to files, so making apache the owner, is the proper way.
I don't see a problem with your permissions.
The subdirectories in /var/www/htdocs/public_html are all set to apache user only, if you are running web applications only, you shouldn't have any problems, but if you want users to be able to see those directories, they can't.
gerasimos_h _________________ Superb! Mini Server Project Manager
http://sms.it-ccs.com |
|
Back to top |
|
Lars Senior Member
Joined: 25 Oct 2010 Posts: 136
|
Posted: Tue Jul 12, 2011 11:27 am Post subject: |
|
|
OK! That was the way I wanted it to work.
Finally, many thanks for your build of a light, elegant multiserver! And all your help !
Maybe someday I'll return with some question, if I cannot get a solution in any other way.
Best regards
Lars |
|
Back to top |
|
|