Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
apache and index.html
View previous topic :: View next topic  
Author Message
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 136

PostPosted: Sun Jul 10, 2011 11:45 pm    Post subject: apache and index.html Reply with quote

I've come so far as to set up a vstftpd-server, putting proftpd down and starting at boot and working perfectly. Smile
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!Wink

Best regards
Lars
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Mon Jul 11, 2011 5:52 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 136

PostPosted: Mon Jul 11, 2011 10:29 pm    Post subject: Reply with quote

Embarassed Of course! Embarassed
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
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Tue Jul 12, 2011 5:38 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Lars
Senior Member


Joined: 25 Oct 2010
Posts: 136

PostPosted: Tue Jul 12, 2011 11:27 am    Post subject: Reply with quote

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 Smile !

Maybe someday I'll return with some question, if I cannot get a solution in any other way.

Best regards
Lars
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional