 |
24-01-2006, 07:54 PM
|
#1 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
WEb Server....Adding virtual...host how?
Post has been edited
Please If u have experience in making web server then please post else dont post by copying articles from net ect.! Coz I'm really frustrated reading samething again n again! My first question below has been solved..answer my 2nd one...scroll down below!
Forbidden
You don't have permission to access /index.html on this server.
This is the error that is killin me now whenever I try to access the the page!
The index.html page resides in /var/www/html.... I tried to run it through different browsers but no luck.
Previosly it was working fine but when I removed the index.html and made a new one the problem started! I tried index.htm with no luck. I added date.php to /var/www/html and can access it with http://localhost/date.php, but http://localhost/index.html gives me the reported error!
Help please..Thanx in advance!
|
|
|
|
Advertisements. Register and be a member of the community to get rid of them.
|
|
Advertisement
|
|
24-01-2006, 09:50 PM
|
#2 (permalink)
|
|
left this forum longback
Join Date: Sep 2005
Location: -
Posts: 7,536
|
Did U entered the dir containing index.html in the Apache config file
|
|
|
24-01-2006, 10:17 PM
|
#3 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
U mean documentroot..then yes!
__________________
Bad Bad server.....No candy for u!
|
|
|
24-01-2006, 10:39 PM
|
#4 (permalink)
|
|
Wise Old Owl
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
|
Have you set read permissions to all ?
try
Code:
$ chmod 755 index.html
__________________
Sometime you'll think you understand everything
...Then you'll regain consciousness
|
|
|
25-01-2006, 12:26 AM
|
#5 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
i'll try that n post again...but what do u mean by all?
__________________
Bad Bad server.....No candy for u!
|
|
|
25-01-2006, 12:50 AM
|
#6 (permalink)
|
|
Wise Old Owl
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
|
Read it as
Have you set read permissions to all users?
Thats what the code is meant for.
__________________
Sometime you'll think you understand everything
...Then you'll regain consciousness
|
|
|
25-01-2006, 12:55 AM
|
#7 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
Thanx man...that really worked...755 worked!
And can explain what is 755..I forgot that! I remember it has somethin to do with user,group,others like that!
One thing more I wanna set up virtual hosts..can u explain how to do that?
my configuration file for http://med.dl is as..
<VirtualHost 127.0.0.2>
DocumentRoot /home/mediator/www
ServerName med.dl
DirectoryIndex index.html index.htm index.shtml
</VirtualHost>
I thought it wud be OK..but when i tried http://med.dl and http://localhost/med.dl it gave "The requested URL /zwat was not found on this server." error!.
When I tried http://127.0.0.2 it said "You don't have permission to access / on this server" error again!
I want to setup a virtual host "med"...So that whenever i try to browse http://localhost/med it points to /home/mediator/www
I also tried 755 permission for this one bt v.host cudnt bed established!
__________________
Bad Bad server.....No candy for u!
|
|
|
25-01-2006, 04:33 AM
|
#8 (permalink)
|
|
Wise Old Owl
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
|
755 stands for -rwxr-xr-x
Its sets permisions in the following order. owner, group, others
4 for read, 2 for write and 1 for execute. simply add the numbers for which all permissions you need to set up. for allowing read and execute, 4+1=5. for allowing read and write, 4+2=6.
755 stands for read,write and execute to owner, read and execute to group, read and execute to others.
Regarding virtual Hosts, read this
__________________
Sometime you'll think you understand everything
...Then you'll regain consciousness
|
|
|
25-01-2006, 10:01 AM
|
#9 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
Tried...
# Virtual host 127.0.0.2
<VirtualHost 127.0.0.2>
DocumentRoot /home/med/www
<Directory "/home/med/www">
Options all
AllowOverride none
</Directory>
ServerPath /med
ServerName localhost
DirectoryIndex index.html index.htm index.shtml
<Directory "/home/med/www">
Options all
AllowOverride none
</Directory>
</VirtualHost>
But no Luck!
__________________
Bad Bad server.....No candy for u!
|
|
|
25-01-2006, 10:45 AM
|
#10 (permalink)
|
|
Wise Old Owl
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
|
Also try changing userDir to public_html
__________________
Sometime you'll think you understand everything
...Then you'll regain consciousness
|
|
|
25-01-2006, 10:50 PM
|
#11 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
Quote:
|
Originally Posted by desertwind
Also try changing userDir to public_html
|
I didnt get that one! Can u explain?
|
|
|
26-01-2006, 12:18 AM
|
#12 (permalink)
|
|
Wise Old Owl
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
|
The default value of userDir in httpd.conf is set to disable. comment that line and uncomment the line userDir public_html
__________________
Sometime you'll think you understand everything
...Then you'll regain consciousness
|
|
|
26-01-2006, 12:35 AM
|
#13 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
Yea tried that one but still no luck! HElp!
__________________
Bad Bad server.....No candy for u!
|
|
|
12-02-2006, 07:59 PM
|
#14 (permalink)
|
|
CCIE# 20863
Join Date: Dec 2004
Location: Outside the Matrix
Posts: 166
|
R U having SELinux???? in that case, u gotta check the security context...
|
|
|
12-02-2006, 09:24 PM
|
#15 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
Yea Already know now how to configure everything...neways thanx for concern! Now I need to know how to lock the topic!
I had initially configured selinux to allow the virtual host...but the problem persisted.....so i configured host file and permissions...added a entry in it and hooray it worked!
|
|
|
13-02-2006, 12:44 AM
|
#16 (permalink)
|
|
Wise Old Owl
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
|
Quote:
|
Originally Posted by mediator
Now I need to know how to lock the topic!
|
Thats a bit tough. ;)
request a mod to do that.
__________________
Sometime you'll think you understand everything
...Then you'll regain consciousness
|
|
|
13-02-2006, 02:00 AM
|
#17 (permalink)
|
|
18 Till I Die............
Join Date: Jul 2004
Location: India, Mumbai, Marine Lines
Posts: 5,792
|
Or to request a mod status  if you want a longer way around.
__________________
http://www.bash.org/?258908
|
|
|
15-02-2006, 10:58 PM
|
#18 (permalink)
|
|
String Phreak
Join Date: Mar 2005
Location: In ur Evil Mind!
Posts: 2,457
|
OK here's the complete process I learnt after years of research to setup a web server completely on a local machine (loopback) ! To setup network http server u dont have to edit host file!
Setting Web server
"http://mediator" ..... on local machine ...loopback
1.
HOST FILE
/etc/host
127.0.0.1 localhost.localdomain localhost Machine_Name
127.0.0.2 mediator
2.
READ PERMISSIONS
755 stands for -rwxr-xr-x
Its sets permisions in the following order. owner, group, others
4 for read, 2 for write and 1 for execute. simply add the numbers for which all permissions you need to set up. for allowing read and execute, 4+1=5. for allowing read and write, 4+2=6.
755 stands for read,write and execute to owner, read and execute to group, read and execute to others.
So that the error "You do not have permission to..." doesnt occur for new directory such as /home/user1/www the whole path must be readable and code executable. Apache by default doesnt have permission to read into /home/user1 directory
permission -> 755 or 745
command...."chmod 755 /home/user1"..."chmod 755 /home/user1/www"
command...."chomd 755 /home/user1/www.index.html"
3.
HTTPD FILE
~../httpd.conf
# Virtual host med
<VirtualHost 127.0.0.2>
DocumentRoot /home/mediator/www
ServerName med
<Directory /home/mediator/www>
order allow,deny
allow from all
</Directory>
<Location /home/mediator/www>
order allow,deny
allow from all
</Location>
DirectoryIndex index.html index.htm index.shtml
</VirtualHost>
If problem Still persists..Then configure the seLinux to allow the document directory...or disable selinux for http service as last resort!!
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|