• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Custom Vhost.conf

M

MaRiOs

Guest
Im using a php script installed on a specific domain and i need in the domain the option open_basedir to be turned to "none"

this option is found on :

/home/httpd/vhosts/domainname/conf/

in the httpd.include file.

its the :

<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir "/home/httpd/vhosts/domainname/httpsdocs:/tmp"
</IfModule>

the httpd.include sais that :

# ATTENTION!
# DO NOT MODIFY THIS FILE OR ANY PART OF IT. THIS CAN RESULT IN IMPROPER PLESK
# FUNCTIONING OR FAILURE, CAUSE DAMAGE AND LOSS OF DATA. IF YOU REQUIRE CUSTOM
# MODIFICATIONS TO BE APPLIED TO THE CONFIGURATION, PLEASE, PERFORM THEM IN THE
# FOLLOWING FILE(S):
# /home/httpd/vhosts/grserver.gr/conf/vhost.conf
# /home/httpd/vhosts/grserver.gr/conf/vhost_ssl.conf
# /home/httpd/vhosts/grserver.gr/subdomains/<subdomain-name>/conf/vhost.conf

so if i create a file vhost.conf
and put inside this :
<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir none
</IfModule>


the php wont take this change.
I tried to copy the whole httpd.include file into vhost.conf and every thing f**cked up hehe.

so whats the right structur of a vhost.conf file ?

all iwant is to add this <IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir none
</IfModule>

and make it work.
 
I believe you have to put the php_admin stuff between
<Directory>
</Directory>

at least that's what works for me.
 
ok I did it now the vhost.conf file contains :


<Directory>

<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir none
</IfModule>

</Directory>


I did a restart to the apache service from plesk and it the apache restarted ok.

But when i run the
file about php info :
(
<?php
phpinfo();
?>)

i still get open_basedir /home/httpd/vhosts/********/httpsdocs:/tmp

Do i have to delete this part from httpd.include ?
 
Try removing it from the .include file, and also try removing the <IfModule ...> stuff from the vhost file, just to see if apache is reading it and not due to the <IfModule....></IfModule> stuff. It can be changed again after this test...

I'm not sure why you would want 'none', not even the /tmp folder for temp session stuff?
 
Originally posted by jamesyeeoc
Try removing it from the .include file, and also try removing the <IfModule ...> stuff from the vhost file, just to see if apache is reading it and not due to the <IfModule....></IfModule> stuff. It can be changed again after this test...

I'm not sure why you would want 'none', not even the /tmp folder for temp session stuff?
ok i firstle removed it from the include file.
the result was that when i was trying to open the page with the php info or any other page
the browsers (tested on 2 of them) didnt try to read the file, they were just askin me where to save it!! .....

so that failed but i didnt restored the previous conf file.what i did is :

i opened vhost.conf and deleted the lines IfModule....></IfModule> and reloaded apache...but the same happened

browsers asking me where to save the files.

so i put the original httpd.include file
and left vhost.conf as :

<Directory>

php_admin_flag engine on
php_admin_value open_basedir none

</Directory>


and now the pages open correctly but still on the php info file i get

php_admin_value open_basedir "/home/httpd/vhosts/*********/httpsdocs:/tmp"


:(((((((
 
Arrrgh, ok, for the httpsdocs folder (I need reading glasses), you need to put the directives in the vhost_ssl.conf file, restart apache (/etc/init.d/httpd restart), then use 'https://yourdomain.com...'

Umm, in the previous posts, you have been dealing with your httpsdocs folder, but here you posted a url to the non-ssl site (httpdocs)....?

If you are running phpinfo from the non-ssl folder, instead of the ssl folder, then it will show you different results.

Directives for the non-ssl site docs go in vhost.conf, for the ssl secure site, directives go in the vhost_ssl.conf file.

So if you have the files in /httpsdocs/ then you would modify the vhost_ssl.conf and use the https://... url.

But if you have the files in /httpdocs/ then you would modify the vhost.conf and use the http://... url.
 
the url of http://66.232.152.125/modernbill/index.htm is not from my server or site.
is the website of the programm that i installed.


so..
The httpd.include is back in its original form.

i created vhost_ssl.conf file.

it has now :



<Directory>

<IfModule sapi_apache2.c>
php_admin_flag engine on
php_admin_value open_basedir none
</IfModule>

</Directory>


And the php info file is in the httpsdocs folder of course.
all the files (php pages) are in the httpsdocs folder.

The page im running to see the info of php from this url : https://www.*******.gr/filename.php
 
I DID IT!!!!!!!!!!!!!!!!!!!

YESSSS

lol


ok i did what i say in my previous post plus
that in the original httpd.include
I only removed the line
php_admin_value open_basedir "/home/httpd/vhosts/grserver.gr/httpsdocs:/tmp"

and i left all the others untouched.

I just HOPE that plesk wont change it by it self.....
 
Did you ever add index.php to the DirectoryIndex line in the file:

/etc/httpd/conf/httpd.conf

??

This is *not* done for you automatically, most admins do this right away after installing Plesk...

Remember to restart apache:

/etc/init.d/httpd restart
 
in the httpd.conf ?? or in the httpd.include

basically there is an .htaccess file in the folder of the php script and it includes the line :

DirectoryIndex index.php





ok i opened the /etc/httpd/conf/httpd.conf

and in the line :

DirectoryIndex at_domains_index.html index.html index.html.var index.shtml index.cfm

I added index.php

i saved it and did restart apache...
nothing changed.....
 
httpd.conf is correct.

Then I would suspect that some other conf file which you may have changed during this process may be interfering.

Once you put the index.php in the httpd.conf file and restart apache, that should allow you to browse to any folder and it will then look for any of the files on the DirectoryIndex line and serve it up as the default page.

Since this is not happening, then you will need to review all of the possible conf files to see where the problem may be. Since I don't have a clue as to the current contents of all the possible files, I am currently at a loss for further advice.
 
the only files i was editing the whole day are 3 :

all on the /home/httpd/vhosts/********.gr/conf

folder

and they were :

httpd.include (of which i have 2 backup files in their original forms)

and these 2 that i did created them.
vhost_ssl.conf
vhost.conf

now i've deleted vhost.conf since i'm using https only.

is there any posibility that it will have a delay in minutes till the DirectoryIndex option will work ?
 
No delay, as soon as apache is restarted the changes are in effect.

You have been working on the problem for more than a day, there may be some other file changes in a previous day when you were trying to resolve it.

For example, you had also modified the /etc/httpd/conf/httpd.conf file, possibly other files in this folder?

Did you make any changes to the php.ini file as their instructions said to do? Often we lose track of exactly which files we modify when trying to solve a problem.
 
it seems that it had major delay.
yesterday i left work at 5 pm and it wasnt working and today i came back at 9 in the morning and the index thing works fine....
but still no sollution with the vhost
 
Ok, it was probably a browser cache problem, once the browser cache got refreshed it works. (just a possibility, I've seen it happen)

This post has become rather long, other than the index.php now working, what other problem are you having now with the vhost file?

You mentioned that you had deleted the vhost.conf file which you had created in trying to resolve the index problem.
 
no im in the begginig.

there are no vhosts files in the conf directory and no changes to the httpd.include file.. :/
 
Back
Top