Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am having real issues in a project that I'm working on with scripts running from HTTP but not from HTTPS.

The areas that this comes up in, is when permissions are needed either to execute a command on the server via exec() or passthru(), or when the script is trying to open a file using fopen.

When using HTTPS the exec() and passthru() functions return a 127 error, which I believe is a command not found error and the fopen will throw a Permission denied exception.

On top of this I can't really understand the setup on the server. I'm sure they're running apache, but I can't see it in the /etc/group file. I think this is because they have plesk (there is a psacln group).

I really need to sort this out because it is sucking up days and days of time. But more than that, I really want to understand what is going on here and why.

Can anyone tell me if it should be possible to run these scripts from HTTPS?

The OS is Ubuntu and the PHP version is 5.2.4

Many thanks

More Info on Current Setup

httpd.conf is blank


//ports.conf
Listen 80

<IfModule mod_ssl.c>
    Listen 443
</IfModule>


// envvars
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
export APACHE_PID_FILE=/var/run/apache2.pid


// part of apache2.conf where all the configuration seems to be
# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

What does it mean for the apache_run_user and apache_run_group to be set to www-data? Should this be set to something else? - apache, or psacln?

Update

I changed the permissions of the directory that my forms live in to 777 and the scripts that use fopen now work even from HTTPS.

Obviously I should need to do this and it is BAD. Should I be looking at what group PHP belongs to? Why would this differ from HTTP to HTTPS?

share|improve this question

2 Answers 2

Do you have access to Plesk? If so go to the domain, then Web Hosting Settings and see if "Use a single directory for housing SSL and non-SSL content" is checked. If not, then https will have a different DocumentRoot (probably httpsdocs).

SSL has a different config file: /var/www/vhosts/mydomain/conf/vhosts_ssl.conf.

After editing either conf file, be sure to:

sudo /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=mydomain
sudo apache2ctl reload

EDIT

Also FYI, directives in the conf files in mydomain/conf override Plesk's config for the vhost, so there are directives that you cannot see in these files that affect the vhost.

share|improve this answer

In my opinion it isn't a matter of groups. The "group" with witch the file is accessed is always the "www-data" group from Apache.

The only possibility I see, why you have to "chmod 777" all the files when executing the script via https, is a misconfiguration of your https vhost.

Maybe there is a -directive in your http vhost file which allows this kind of access and differs from your https -directive.

A configuration snippet would help.

share|improve this answer
    
Hi. The vhost.conf file (if that's the one you mean) located at /var/www/vhosts/mydomain/conf/vhosts.conf only has a couple of lines: <Directory /var/www/vhosts/ivpsc.com/httpdocs> php_admin_value safe_mode off php_admin_value open_basedir none </Directory> I'm not sure that's too helpful for you. –  Joe Sep 20 '11 at 12:29
    
aren't there different vhost files for http and https? –  Subito Sep 20 '11 at 12:31
    
No. There's another vhost.conf in /var/www/vhosts/mydomain/httpdocs with exactly the same configuration, but there is not a file in httpSdocs. –  Joe Sep 20 '11 at 14:12
    
Maybe there should be one. Try to contact your provider about this issue, I think it has something to do with the non-existent vhost declaration for https. –  Subito Sep 20 '11 at 14:18
    
OK I'll do that. Thanks a lot for your help on this. Appreciate it. –  Joe Sep 20 '11 at 14:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.