I've created a symlink inside my /var/www/html/ folder called "web", which is points to a my /home/dave/web directory.
Inside that directory, I created a folder for my web site called "website".
I thought I should be able to access that web site through FireFox by going to either:
httpd://localhost/web/website
... or:
... but I just get errors. It says that httpd is not a registered protocol, and the connection to localhost/web/website was refused.
Am I not addressing these sites correctly? Have I muddled the directory trees or http protocols somehow?
Just to be clear, the directory with all the html and php files is:
/home/dave/web/website
The symlink is:
/var/www/html/web
Dave
On Wed, Oct 12, 2005 at 12:14:41AM +0900, Dave Gutteridge enlightened us:
I've created a symlink inside my /var/www/html/ folder called "web", which is points to a my /home/dave/web directory.
Inside that directory, I created a folder for my web site called "website".
I thought I should be able to access that web site through FireFox by going to either:
httpd://localhost/web/website
... or:
... but I just get errors. It says that httpd is not a registered protocol, and the connection to localhost/web/website was refused.
Am I not addressing these sites correctly? Have I muddled the directory trees or http protocols somehow?
Just to be clear, the directory with all the html and php files is:
/home/dave/web/website
The symlink is:
/var/www/html/web
http://localhost/web/website should do it. If you get connection refused, it means Apache probably isn't running.
"service httpd status" will tell you. If it's not started, you can start it with "service httpd start" and to make sure it starts at reboot run "chkconfig httpd on" (the last 2 will have to be run as root).
Matt
sender: "Dave Gutteridge" date: "Wed, Oct 12, 2005 at 12:14:41AM +0900" <<<EOQ
I've created a symlink inside my /var/www/html/ folder called "web", which is points to a my /home/dave/web directory.
Inside that directory, I created a folder for my web site called "website".
I thought I should be able to access that web site through FireFox by going to either:
httpd://localhost/web/website
... or:
... but I just get errors. It says that httpd is not a registered protocol, and the connection to localhost/web/website was refused.
Am I not addressing these sites correctly? Have I muddled the directory trees or http protocols somehow?
Exactly!
First of all, these are not CentOS specific questions... but it's an unmodarated list, so let's get over that. Second, unless you have created your own protocol called "httpd" there is NO protocol (that I know of) called that way. Just because http:// didn't give the desired result it's not a reason to start appending all the letters of the alphabet to it... You know, there is a manual for Apache... in quite a lot of languages too: http://httpd.apache.org/docs/2.0/mod/core.html#options "FollowSymLinks The server will follow symbolic links in this directory."
The server must be configured to allow symlinks to be followed. That's all the mistery.
Alex
On Tue, 2005-10-11 at 18:42 +0300, Alexandru E. Ungur wrote:
sender: "Dave Gutteridge" date: "Wed, Oct 12, 2005 at 12:14:41AM +0900" <<<EOQ
I've created a symlink inside my /var/www/html/ folder called "web", which is points to a my /home/dave/web directory.
Inside that directory, I created a folder for my web site called "website".
I thought I should be able to access that web site through FireFox by going to either:
httpd://localhost/web/website
... or:
... but I just get errors. It says that httpd is not a registered
<SNIP>
Exactly!
First of all, these are not CentOS specific questions... but it's an unmodarated list, so let's get over that.
And if so, you never should have mentioned it? Since I joined these lists, I have seen *many* non=CentOS-related questions and no one ever objects or mentions the fact. So why did you see the need for this?
I agree it would be nice to have mostly CentOS related only, but no one has expressed a strong push in that direction.
Second, unless you have created your own protocol called "httpd" there is NO
<snip>
Alex _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
this might be a dumb question, but are you trying to access this site from the same box? ie, did you bring up firefox on the server were the website is located?
if not, replace localhost with the ip address. if so, try accessing just http://localhost/ and see if anything comes up.
hth, cameron
It turns out that the reason I couldn't access files at localhost was because the httpd service was not started. I've started it, and I can access a test file that is in the /var/www/html directory.
However, the directory /var/www/html/web directory, which is a symlink to /home/dave/web can not be accessed. Any file within that directory that I try to access, says that I do not have permission to access that file.
I tried changing the permissions on both the web symlink and the source directory to 777, but that had no effect.
Why am I not able to access this directory via my local apache server?
Dave
you could change your symlink to /var/www/html instead of /var/www/html/web so that the default points to your files.
there are many other options but you would need a better understanding of apache virtual hosts to work around this.
Dave Gutteridge wrote:
It turns out that the reason I couldn't access files at localhost was because the httpd service was not started. I've started it, and I can access a test file that is in the /var/www/html directory.
However, the directory /var/www/html/web directory, which is a symlink to /home/dave/web can not be accessed. Any file within that directory that I try to access, says that I do not have permission to access that file.
I tried changing the permissions on both the web symlink and the source directory to 777, but that had no effect.
Why am I not able to access this directory via my local apache server?
Dave
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Thu, 2005-10-13 at 23:17 +0900, Dave Gutteridge wrote:
It turns out that the reason I couldn't access files at localhost was because the httpd service was not started. I've started it, and I can access a test file that is in the /var/www/html directory.
However, the directory /var/www/html/web directory, which is a symlink to /home/dave/web can not be accessed. Any file within that directory that I try to access, says that I do not have permission to access that file.
I tried changing the permissions on both the web symlink and the source directory to 777, but that had no effect.
Why am I not able to access this directory via my local apache server?
---- 1 - permissions for user apache to access directory.
ls -ld /home ls -ld /home/dave ls -ld /home/dave/web
does user apache have ability to descend? _rwxr_xr_x ^ this is the significant bit ---------------------|
2 - selinux ?
http://fedora.redhat.com/docs/selinux-apache-fc3/
Craig
ps - changing permissions of a link is pointless, the permissions are derived for the original file
1 - permissions for user apache to access directory.
I thought Apache was an application or a service. It's also a user in need of rights?
[dave@localhost ~]$ ls -ld /home drwxr-xr-x 4 root root 4096 Oct 4 19:45 /home [dave@localhost ~]$ ls -ld /home/dave drwx------ 63 dave dave 4096 Oct 13 23:55 /home/dave [dave@localhost ~]$ ls -ld /home/dave/web drwxrwxrwx 3 dave dave 4096 Oct 11 06:20 /home/dave/web
does user apache have ability to descend? _rwxr_xr_x
If I read the above results correctly, /home/dave/web/ should be open to anyone. So shouldn't apache also be able to read it?
2 - selinux ?
I seem to remember that for some setting ages ago, I had selinux disabled. But how can I be sure?
ps - changing permissions of a link is pointless, the permissions are derived for the original file
Okay. Thank you for that tip.
Dave
On Fri, 2005-10-14 at 00:01 +0900, Dave Gutteridge wrote:
1 - permissions for user apache to access directory.
I thought Apache was an application or a service. It's also a user in need of rights?
[dave@localhost ~]$ ls -ld /home drwxr-xr-x 4 root root 4096 Oct 4 19:45 /home [dave@localhost ~]$ ls -ld /home/dave drwx------ 63 dave dave 4096 Oct 13 23:55 /home/dave [dave@localhost ~]$ ls -ld /home/dave/web drwxrwxrwx 3 dave dave 4096 Oct 11 06:20 /home/dave/web
does user apache have ability to descend? _rwxr_xr_x
If I read the above results correctly, /home/dave/web/ should be open to anyone. So shouldn't apache also be able to read it?
---- chmod o+x /home/dave ----
2 - selinux ?
I seem to remember that for some setting ages ago, I had selinux disabled. But how can I be sure?
---- I'm never really sure on this...
cat /etc/sysconfig/selinux ----
ps - changing permissions of a link is pointless, the permissions are derived for the original file
Okay. Thank you for that tip.
---- You're welcome
Craig
Dave Gutteridge wrote:
2 - selinux ?
I seem to remember that for some setting ages ago, I had selinux disabled. But how can I be sure?
running "/usr/sbin/getenforce" will tell you whats the present state of affairs.
- K
Dave Gutteridge wrote:
1 - permissions for user apache to access directory.
I thought Apache was an application or a service. It's also a user in need of rights?
[dave@localhost ~]$ ls -ld /home drwxr-xr-x 4 root root 4096 Oct 4 19:45 /home [dave@localhost ~]$ ls -ld /home/dave drwx------ 63 dave dave 4096 Oct 13 23:55 /home/dave
Think this is the problem, apache (if you have a look at the httpd.conf file you will notice "User apache Group apache" somewhere) needs to access that directory. If you just give the x - execution permission to "others" for your home/dave directory it should work.
Cheers
[dave@localhost ~]$ ls -ld /home/dave/web drwxrwxrwx 3 dave dave 4096 Oct 11 06:20 /home/dave/web
does user apache have ability to descend? _rwxr_xr_x
If I read the above results correctly, /home/dave/web/ should be open to anyone. So shouldn't apache also be able to read it?
2 - selinux ?
I seem to remember that for some setting ages ago, I had selinux disabled. But how can I be sure?
ps - changing permissions of a link is pointless, the permissions are derived for the original file
Okay. Thank you for that tip.
Dave
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
--- Simone simone72@email.it wrote:
Dave Gutteridge wrote:
1 - permissions for user apache to access
directory.
I thought Apache was an application or a service.
It's also a user in
need of rights?
[dave@localhost ~]$ ls -ld /home drwxr-xr-x 4 root root 4096 Oct 4 19:45 /home [dave@localhost ~]$ ls -ld /home/dave drwx------ 63 dave dave 4096 Oct 13 23:55
/home/dave
Think this is the problem, apache (if you have a look at the httpd.conf file you will notice "User apache Group apache" somewhere) needs to access that directory. If you just give the x - execution permission to "others" for your home/dave directory it should work.
Cheers
[dave@localhost ~]$ ls -ld /home/dave/web drwxrwxrwx 3 dave dave 4096 Oct 11 06:20
/home/dave/web
does user apache have ability to descend?
_rwxr_xr_x
If I read the above results correctly,
/home/dave/web/ should be open to
anyone. So shouldn't apache also be able to read
it?
2 - selinux ?
I seem to remember that for some setting ages ago,
I had selinux
disabled. But how can I be sure?
ps - changing permissions of a link is pointless,
the permissions are
derived for the original file
Okay. Thank you for that tip.
Dave
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Wasnt that mentioned a while back about the permission on the directory. Secondly like said before isnt apache seen as an other user? If it is in some (like users) other group wouldnt that be a big no no since that would be a security risk? correct me if i am totally wrong on this assumption.
Steven
"On the side of the software box, in the 'System Requirements' section, it said 'Requires Windows or better'. So I installed Linux."
On Thu, 2005-10-13 at 10:10 -0700, Steven Vishoot wrote:
Wasnt that mentioned a while back about the permission on the directory.
--- possibly ---
Secondly like said before isnt apache seen as an other user?
--- on fedora/rhel/centos system the packaging creates user and group apache and that is the user/group by default that is serving web pages ---
If it is in some (like users) other group wouldnt that be a big no no since that would be a security risk? correct me if i am totally wrong on this assumption.
--- of course - if /home/dave is octal 0700 (_rwx______) then no one but the user dave who owns the system can descend into the folder.
if you 'chmod o+x /home/dave' it becomes octal 0701 (_rwx_____x) and then everyone can descend into the folders and even execute files that they have permissions for. That means that files created with default umask of 755 would be executable.
Do you have a better solution?
Craig
--- Craig White craigwhite@azapple.com wrote:
On Thu, 2005-10-13 at 10:10 -0700, Steven Vishoot wrote:
Wasnt that mentioned a while back about the
permission
on the directory.
possibly
Secondly like said before isnt apache seen as an other user?
on fedora/rhel/centos system the packaging creates user and group apache and that is the user/group by default that is serving web pages
If it is in some (like users) other group wouldnt that be a big no no
since
that would be a security risk? correct me if i am totally wrong on this assumption.
of course - if /home/dave is octal 0700 (_rwx______) then no one but the user dave who owns the system can descend into the folder.
if you 'chmod o+x /home/dave' it becomes octal 0701 (_rwx_____x) and then everyone can descend into the folders and even execute files that they have permissions for. That means that files created with default umask of 755 would be executable.
Do you have a better solution?
It really all depends on what he wants to do with it. if its going to be accessed by everyone or is just for him? that is something that would have to be decided before any solution can be thought of.
Craig
-- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Steven
"On the side of the software box, in the 'System Requirements' section, it said 'Requires Windows or better'. So I installed Linux."
It really all depends on what he wants to do with it. if its going to be accessed by everyone or is just for him? that is something that would have to be decided before any solution can be thought of.
I'm really the only person who uses my computer, but that might change.
In the case of using localhost to view web files, I'm definitely the only person who will ever access Apache on this machine. I have no intention of making this machine available on the internet or any network for anyone else to view web files.
As far as other users go, I might create an account for my girlfriend so that she can surf the web and check mail and things like that. She's unlikely to do some heavy exploration on the machine and cause much damage.
Anyway, basically, there will at most be two users. Of those two users, the one most likely to do any damage is me, as I'm the one who will be installing programs and stuff like that.
Dave
On Thu, 2005-13-10 at 10:22 -0700, Craig White wrote:
chmod o+x /home/dave
This has solved the problem.
Thank you for suggesting solutions and educating me a bit more about permissions. I had not realized that a parent directory needs to have it's permissions open in order to access and use a child directory that is not restricted. Now I know.
Dave
--- Dave Gutteridge dave@tokyocomedy.com wrote:
I've created a symlink inside my /var/www/html/ folder called "web", which is points to a my /home/dave/web directory.
Inside that directory, I created a folder for my web site called "website".
I thought I should be able to access that web site through FireFox by going to either:
httpd://localhost/web/website
... or:
... but I just get errors. It says that httpd is not a registered protocol, and the connection to localhost/web/website was refused.
Am I not addressing these sites correctly? Have I muddled the directory trees or http protocols somehow?
Just to be clear, the directory with all the html and php files is:
/home/dave/web/website
The symlink is:
/var/www/html/web
Dave
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
What little i know about Apache, but i thought when going through the web browser it treats it like a other user so that will not have access to the directory /home/dave/web/website. Is it asking for a user and password when you go through the web browser? This one i am Probably way off, but that is my .02 cents worth to think about.
Steven
"On the side of the software box, in the 'System Requirements' section, it said 'Requires Windows or better'. So I installed Linux."