permission to access /pacsone/Hello.php

Trouble during PacsOne Server installations
Post Reply
klingo
permission to access /pacsone/Hello.php

Post by klingo » Sun Jul 10, 2005 9:13 am

Hi.
I am trying to install PacsOne premium edition on a Gentoo Linux with mysql-4.0.24, apache-2.0.54 and php-4.3.11.

I tested the mysql apache installations according to the PacsOne installation manual and they both seem to be fine. However, when I try to access
http://localhost/pacsone/Hello.php
I get an error:

Forbidden
You don't have permission to access /pacsone/Hello.php on this server.

What's wrong? Even if I try to access the script as a root, I get the same error.

Thanks

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Post by pacsone » Sun Jul 10, 2005 1:56 pm

It seems that the user account under which you're running Apache with does not have sufficient security privilege to access or run the PHP scripts under the php sub-directory where PacsOne Server is installed.

Try running ls -l on the PHP scripts and find out the file permissions (user id, group id, others), and find out which user account Apache is running under. That user account needs at least the Read and Execute permissions ("r-x") for all the PHP scripts PacsOne is using.

Guest

Post by Guest » Sun Jul 10, 2005 4:10 pm

Thanks for fast reply.
pacsone wrote:It seems that the user account under which you're running Apache with does not have sufficient
I run Apache2 as apache user. However, according to installation manual

Code: Select all

chmod 644 pacsone
prevents all the "others" entering the installation directory. I have noticed pretty strange ownerships of the content of the installation directory.

Code: Select all

signal08 /home $ ls -l
total 20
drwx------   2 root  root   4096 Nov  5  2004 lost+found
drw-r--r-x   8 root  root   4096 Jul 10 10:47 pacsone
signal08 /home $ ls -l pacsone
total 6288
drwxr-xr-x  6 1000 users    4096 Dec 27  2004 ImageMagick
-rwxr-xr-x  1 1000 users 2890972 Jun  9 02:35 PacsOne.exe
-rw-r--r--  1 root root      581 Jul 10 10:30 PacsOne.ini
-rwxr-xr-x  1 1000 users 1660764 Jun  4 13:49 PacsOneSrv.exe
-rwxr-xr-x  1 1000 users 1726748 Jun  4 13:49 Setup.exe
drwxr-xr-x  2 1000 users    4096 Dec 27  2004 cd
-r-xr-xr-x  1 root users   46855 Mar 12 03:59 conformance.txt
-r-xr-xr-x  1 root users    8834 May 16 04:54 db_schema
drwxr-xr-x  2 1000 users    4096 Dec 27  2004 dvd
-rwxr-xr-x  1 1000 users    3281 Dec  5  2004 install.sh
-r-xr-xr-x  1 root users    1269 Mar 12 03:59 license.txt
drwxr-xr-x  2 root root     4096 Jul 10 10:26 log
drwxr-xr-x  3 1000 users    4096 Dec 27  2004 mysql
-rwxr-xr-x  1 root root     2297 Jul 10 10:28 pacsone
-rw-r--r--  1 1000 users    1901 Nov 15  2004 pacsone.base
drwxr-xr-x  4 1000 users    4096 Jun  4 14:20 php
-r-xr-xr-x  1 root users   17739 Mar 12 03:59 readme.txt
-rwxr-xr-x  1 1000 users     629 Nov 13  2004 uninstall.sh
-r-xr-xr-x  1 root users    8304 May 16 04:56 upgrade_schema
signal08 /home $
What group and user should own the installation directory and with what privileges?
Try running ls -l on the PHP scripts and find out the file permissions (user id, group id, others), and find out which user account Apache is running under. That user account needs at least the Read and Execute permissions ("r-x") for all the PHP scripts PacsOne is using.
Sorry, setting the permissions for "others" to "r-x" didn't solve the problem.

Thanks

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Post by pacsone » Mon Jul 11, 2005 12:54 am

The instructions in the PacsOne Server Installation Guide all have the assumption that users will install Apache and PacsOne Server under the same username, which in your case is not.

So you'll need to decide whether:

1. Run Apache and PacsOne Server under the same username, and chown -R to that username from the directory where PacsOne is installed.

2. Run Apache and PacsOne Server under the same group, and chgrp -R to that group from the directory where PacsOne is installed.

Guest

Post by Guest » Mon Jul 11, 2005 6:46 am

It is strange, but I can not get it working. I went for the option 1.

Code: Select all

chown -R apache:apache pacsone
but I still get the same error. I assume it is the apache configuration, which causes the trouble. If you have any quick suggestion as to where I should be looking, I would appreciate it.

I'll try to google for any further clues.

Thanks

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Post by pacsone » Mon Jul 11, 2005 1:32 pm

Run a ps -elf command and find out the username under which Apache process is running as. It may not be the same as the owner of the Apache files, but this is the username that must have access to all the PacsOne PHP scripts.

Guest

Post by Guest » Mon Jul 11, 2005 6:46 pm

Hi and thanks for help. As I mentioned in my last posting, setting permission to the same user as the one who runs apache2 doesn't help. It must be some configuration issue of apache, which I will have to look into. I have no experiences with running it so have to read some manuals.

Code: Select all

signal08 ~ # ps -ef | grep apache
root      9317     1  0 20:34 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache    9321  9317  0 20:34 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache    9322  9317  0 20:34 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache    9323  9317  0 20:34 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache    9324  9317  0 20:34 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache    9325  9317  0 20:34 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
apache    9326  9317  0 20:34 ?        00:00:00 /usr/sbin/apache2 -k start -D SSL -D PHP4
root     10056  9220  0 20:38 pts/1    00:00:00 grep apache
signal08 ~ # ls -l /home/pacsone/
total 6288
drwxr-xr-x  6 apache apache    4096 Dec 27  2004 ImageMagick
-rwxr-xr-x  1 apache apache 2890972 Jun  9 02:35 PacsOne.exe
-rw-r--r--  1 apache apache     581 Jul 10 10:30 PacsOne.ini
-rwxr-xr-x  1 apache apache 1660764 Jun  4 13:49 PacsOneSrv.exe
-rwxr-xr-x  1 apache apache 1726748 Jun  4 13:49 Setup.exe
drwxr-xr-x  2 apache apache    4096 Dec 27  2004 cd
-r-xr-xr-x  1 apache apache   46855 Mar 12 03:59 conformance.txt
-r-xr-xr-x  1 apache apache    8834 May 16 04:54 db_schema
drwxr-xr-x  2 apache apache    4096 Dec 27  2004 dvd
-rwxr-xr-x  1 apache apache    3281 Dec  5  2004 install.sh
-r-xr-xr-x  1 apache apache    1269 Mar 12 03:59 license.txt
drwxr-xr-x  2 apache apache    4096 Jul 10 10:26 log
drwxr-xr-x  3 apache apache    4096 Dec 27  2004 mysql
-rwxr-xr-x  1 apache apache    2297 Jul 10 10:28 pacsone
-rw-r--r--  1 apache apache    1901 Nov 15  2004 pacsone.base
drwxr-xr-x  4 apache apache    4096 Jun  4 14:20 php
-r-xr-xr-x  1 apache apache   17739 Mar 12 03:59 readme.txt
-rwxr-xr-x  1 apache apache     629 Nov 13  2004 uninstall.sh
-r-xr-xr-x  1 apache apache    8304 May 16 04:56 upgrade_schema
signal08 ~ #
Thanks

Guest

Post by Guest » Mon Jul 11, 2005 8:31 pm

OK! I found the problem and Hello.php shows now what it's suppose to.

The reason of the error and solution is described at http://defindit.com/readme_files/apache_13_error.html

It could be an idea to update the installation manual according to the souce.

Regards.

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Post by pacsone » Tue Jul 12, 2005 1:33 am

Great!

It'd be nice if you could also elaborate more on what you did to fix the permission errors, so others may share the experience here.

Thanks.

Guest

Post by Guest » Tue Jul 12, 2005 7:44 am

Sure! No problem.
:wink:

I basically followed instructions from the currently available installation manual. After having mysql, apache and php installed, when I pointed my web-browser to http://localhost/pacsone/Hello.php, I got permission problems as described above.

To fix the problem, I followed the instructions in the link I provided above.

1. cd pacsone/installation/directory
2. cd ..
3. chmod 711 pacsone
4. edit (using your favourite editor) httpd.conf or apache2.conf, and find the section where you define an alias to your pacs (see pacsone installation manual for more details):

Code: Select all

Alias /pacsone
In this section, commnet out the original Options line and and a new one so it looks like this

Code: Select all

#Options Indexes MultiViews
Options +ExecCGI +FollowSymLinks -Indexes -MultiViews
Save the changes you made and dont forget to restart apache server to take into account the new settings.

Point you web-browser to http://localhost/pacsone/Hello.php and you should get a long table with your php installation options.

Hope this may help somebody.

PS: note that the above solution is also a minor security enhancement. For more information, look at the web-page I provided above

pacsone
Site Admin
Posts:3149
Joined:Tue Sep 30, 2003 2:47 am

Post by pacsone » Tue Jul 12, 2005 12:27 pm

Thanks very much for sharing this very informational post, as it should help everyone who is setting up a PacsOne Server on Linux platforms.

Great job!

Post Reply