$web_root = "openemr" problem

medsupporter wrote on Tuesday, October 19, 2010:

Hello folks.
I have a very simple need.  I am trying to change the default web directory open path such that \\localhost will bring up openemr with out the need to type \\localhost\openemr.
More importantly, subdomain.myservername.com will directly bring up openemr and I don’t need to constantly remind folks to enter in the /openemr part……
I tried to figure this out, but have run into some problems I can’t seem to figure out.
First, I installed a valid SSL certificate, which works, just as an fyi.
Then, I changed the httpd.conf file in two places to make apache realize that the main open directory should be \openemr and not the xampp control panel that’s at the htdocs root.  I changed:
<Directory “/xampp/htdocs/openemr”> AND DocumentRoot “/xampp/htdocs/openemr”   – adding “openemr” to both….
Then, I changed globals.php in this way $web_root = “openemr”  - I removed the openemr, but left the qoutes so to TRY and tell the files that the servername\ should open openemr, and the \openemr part is not needed……

What now works is that when I type in:  https://subdomain.myservername.com/openemr  things still work fine……
When I type in: https://subdomain.myservername.com/ I get the following error:
Access forbidden!
You don’t have permission to access the requested directory. There is either no index document or the directory is read-protected.

If you think this is a server error, please contact the webmaster.

Error 403
10/19/10 16:34:25
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9

Then, when I type in:
http://subdomain.mydomainname.com (notice the not httpS) not ssl.
I get the following error:
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404
10/19/10 16:35:38
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404
10/19/10 16:35:38
Apache/2.2.11 (Win32) DAV/2 mod_ssl/2.2.11 OpenSSL/0.9.8i PHP/5.2.9

I guess I’m going about this in the wrong way…. Can someone point me in the right direction?
THANK YOU!!!!
Tom

juggernautsei wrote on Wednesday, October 20, 2010:

The thing that you are missing is the virtual host header. Click on the WAMP and mouse over Apache, Apache Modules and then install headers_module. Restart WAMP. Now uncomment line conf/extra/httpd-vhosts.conf in the httpd.conf file. Then go to the httpd-vhosts.conf file and add the names of the urls the server is listing for and the folder to go to i.e.

This is the default.
<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.localhost
    DocumentRoot “C:/Program Files/Apache Software Foundation/Apache2.2/docs/dummy-host2.localhost”
    ServerName dummy-host2.localhost
    ErrorLog “logs/dummy-host2.localhost-error.log”
    CustomLog “logs/dummy-host2.localhost-access.log” common
</VirtualHost>

It should look like this.

<VirtualHost *:80>
    ServerAdmin webmaster@yourdomainhere.com
    DocumentRoot “C:/wamp/www”
    ServerName www.yourdomainhere.com
    ServerAlias www.yourdomainhere.com
    ErrorLog “logs/yourdomainhere.error.log”
    CustomLog “logs/yourdomainhere.access.log” common
</VirtualHost>

This is for each domain you want to host on your system.

medsupporter wrote on Friday, October 22, 2010:

Thank you very much Juggernautsei.
I took your advice and configured as advised…. I think.
My settings now look like this:
From httpd-ssl.config:

Listen 443

<VirtualHost _default_:443>
    #   General setup for the virtual host
    DocumentRoot “/xampp/htdocs/openemr”

    ServerName subdomain.domain.com:443
    ServerAdmin webmaster@domain.com

    ErrorLog logs/error.log
    <IfModule log_config_module>
        CustomLog logs/access.log combined
    </IfModule>

and from httpd.config:
DocumentRoot “/xampp/htdocs/openemr”
<Directory “/xampp/htdocs/openemr”>
Listen 80

And from httpd-vhosts.confg

NameVirtualHost *:443

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
<VirtualHost *:443>
    ServerAdmin webmaster@domain.com
    DocumentRoot /xampp/htdocs/openemr
    ServerName subdomain.domain.com
    ServerAlias subdomain.domain.com
    ErrorLog logs/error.log
#    CustomLog @rel_logfiledir@/dallas-feeney.medpria.com-access_log common
</VirtualHost>

I’m getting server unavaliable when I try to access https://subdomain.domain.com
and when I try http://subdomain.domain.com I get object not found errors……

when I look at the logs I see this strange bit….
   File does not exist: C:/xampp/htdocs/openemr/openemr, referer: http://subdomain.domain.com/interface/login/login_frame.php

notice the double /openemr directory try…. I looked through all config files and I can’t find why that’s poping up….
that’s for port 80, non-ssl, however…
when I try port 443 ssl, I don’t get any error or log except this in access.log:    “\x16\x03\x01” 200 480

I’m at a total loss - can you think of what I am missing?
THANK YOU for the help.
Tom

medsupporter wrote on Friday, October 22, 2010:

UPDATE -
I took a look at the globals.php file and discovered that I needed to remove the /openemr line again from the $web_root = “openemr”  - and I deleted it and now NON-SSL works as expected….
SSL is still just site not available……
THANK YOU,
Tom

abe08 wrote on Thursday, February 14, 2013:

Hello all,

I have some problem with it.

_Forbidden

You don’t have permission to access /interface/super/edit_globals.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request._

The solution above, we must to change the httpd-vhosts.conf file  but I cannot go to directory on this file.

because in my server can’t go to directory in xampp.

How should I do?

thanks you for your help

abe08 wrote on Thursday, February 14, 2013:

I have already solve it.

Modification in httpd.conf file.

:slight_smile:

abe08 wrote on Thursday, February 14, 2013:

Sorry., I still have the same problem.

How can I go to httpd.conf file in my server?

because, I have using cPanel and didn’t have the option to edit httpd.conf file.

thank you

bigpawpa wrote on Sunday, March 03, 2013:

Hello, I am not sure what is going on with my situation. I installed 4.1.1 onto webshostingpad hosting service. I used the option I created database already. Webhostingpad does not have a root user. When I select Globals and then save i get this message;

Forbidden

You don’t have permission to access /interface/super/edit_globals.php on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.