DocumentRoot

Updating, recompiling, VirtualHost templates, customizations, php safemode …How to modify the open_basedir setting for one domain.

Updating, recompiling, VirtualHost templates, customizations, php safemode …How to modify the open_basedir setting for one domain.

To change or modify the open_basedir value when using php in CLI mode (not suPhp), you can do so by going to:

Admin Level -> Custom httpd configuration -> domain.com

insert this one to modify line In the top text area:

|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp/:/usr/local/lib/php/|

which is the default value in the templates.  Edit the paths in that line to meet your needs.

If you’re running CustomBuild 2.0, you may also need to add the path for modify:

/usr/local/php55/lib/php/

to the above list.  Adjust php55 (for php 5.5.x) to the php version you’re using.

How to manually create a new self-signed shared server certificate

The following command will create you a new self-sign shares server certificate

/usr/bin/openssl req -sha256 -x509 -newkey rsa:4096 -keyout /etc/httpd/conf/ssl.key/server.key -out /etc/httpd/conf/ssl.crt/server.crt -days 9000 -nodes

answer the questions as desired.

Note, you can also accomplish the same thing through DirectAdmin.
To do this, login as “admin”.
Click “User Level”.
Use a domain created under “admin”, if you don’t have one, create a fake domain, it doesn’t matter.
Go to “SSL Certificates”.
Assume “admin” is still set to use the server IP, and self-sign certificate created there will write to the same server.crt and server.key files as above.

Also, if you create a certificate request in this same manor (through DA), be advising that it will generate the key and the csr (cert request) as the result.  The key is *not* saving during this process (only for “admin” on the server IP).

So make sure you copy the key and csr then save it somewhere safe.
The original cert/key in the textarea are not touched when creating a csr.

How to setup per-domain Aliases

If you want to disable /webmail for just one domain (for example), one way to do it is that to change the Aliases to be within the VirtualHosts instead of 1 global Alias.
For doing that, we will need to use the virtual_host2.conf template (for apache 2) and use the custom httpd config settings, found in the Admin Level.

This guide assumes you’re using apache 2 with custombuild.

1) Setup the custom template so it’s safe from DA updates:

cd /usr/local/directadmin/data/templates/custom
cp ../virtual_host2.conf .

2) Edit the copied of virtual_host2.conf file, and insert the following at the top of the file:

|?WEBMAIL=ON|

Fterward just below the token that says |CUSTOM| (in the same file) add:

|*if WEBMAIL=”ON”|
Alias /webmail /var/www/html/webmail/
|*endif|

3) Go to:
Admin Level -> Custom httpd config -> domain.com

insert this one line In the textarea at the top:

|?WEBMAIL=OFF|

which will shut off webmail for just that one domain.

4) Remove the global Alias from the /etc/httpd/conf/extra/httpd-aliases.conf file.

5) Issue a full user httpd.conf rewrite, then restart apache.

echo “action=rewrite&value=httpd” >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d
/etc/init.d/httpd restart

Leave a Reply

Your email address will not be published. Required fields are marked *