Custombuild is out of beta.

Is custombuild working fine on your system?


  • Total voters
    110
Now ive used the custombuild script to install php4 and php5 on the same server i can now use a .htaccess file in to public_html directory to choose the version i need for that account. What is the best way of setting this up, so when i create a domain it adds the .htaccess file to the public_html folder when the domain is created?
 

I dont think you understood what i meant.

I would like to know what is the best way of creating a .htaccess file automaticaly in the root of the public_html folder when the domain is created.

The .htaccess file would contain something like this stated below:
## Uncomment the line below to enable PHP 4 support

# AddHandler x-httpd-php4 .php

I think this would be useful for a lot of people, as from what i have seen on these forums, two versions of php are being used alot. I presume it would be a job for a script, but i dont really have any idea how.

thanks in advance
 
Okay, let's begin :)
Edit the user_create_post.sh file:
Code:
nano -w /usr/local/directadmin/scripts/custom/user_create_post.sh
Add:
Code:
#!/bin/sh
HTACCESS=/home/$username/pubic_html/.htaccess
touch $HTACCESS
echo "## Uncomment the line below to enable PHP 4 support" >> $HTACCESS
echo "# AddHandler x-httpd-php4 .php" >> $HTACCESS
echo "## Uncomment the line below to enable PHP 5 support" >> $HTACCESS
echo "# AddHandler x-httpd-php5 .php" >> $HTACCESS
That's all ;) Good luck!
 
should it be domain_create_post.sh ? instead of user_create_post.sh ?

Code:
#!/bin/sh
HTACCESS=/home/$username/domains/$domain/public_html/.htaccess
touch $HTACCESS
echo "## Uncomment the line below to enable PHP 4 support" >> $HTACCESS
echo "# AddHandler x-httpd-php4 .php" >> $HTACCESS
echo "## Uncomment the line below to enable PHP 5 support" >> $HTACCESS
echo "# AddHandler x-httpd-php5 .php" >> $HTACCESS
 
Last edited:
All works fine now :)

Added the below code to /usr/local/directadmin/scripts/custom/domain_create_post.sh:
Code:
#!/bin/sh

HTACCESS=/home/$username/domains/$domain/public_html/.htaccess

touch $HTACCESS

echo "## Uncomment the line below to enable PHP 4 support" >> $HTACCESS
echo "# AddHandler x-httpd-php4 .php" >> $HTACCESS
echo "## Uncomment the line below to enable PHP 5 support" >> $HTACCESS
echo "# AddHandler x-httpd-php5 .php" >> $HTACCESS

chown $username:$username $HTACCESS

chmod 644 $HTACCESS

Thanks for your help in pointing me in the right direction :)
 
I think the simple way is put the .htaccess file inside reseller's default directory.
 
when i try to recompile php 4 or 5 with the custombuild script so i can enable a few things, i.e exif etc, i added everything i need to /usr/local/directadmin/custombuild/configure/ap1/configure.php4 or configure.php5 but they dont seem to change anything, am i missing something ?

p.s i am using ap1
 
its ok i found it, forgot it was suphp.

Another question, i usually install my php.ini files in i.e /web/conf/php, how can i change the php.ini install path when i compile php, i see alot of it is hard coded into the custombuild script, whats the best way to do this ?
 
I forgot to do ./build clean, before i did ./build php5-cgi & ./build php4-cgi :)

All works now

Configuration File (php.ini) Path: /web/conf/php/php5

Loaded Configuration File: /web/conf/php/php5/php.ini
 
When php4/5 are compiled as cgi, the php safemode option in DA does not work, whats the best way now of setting certains domains to use safe mode?
 
Anyone has problems now? :)

options.conf
mysql=5.0
default_php=5
php4_cli=no
php4_cgi=no
php5_cli=no
php5_cgi=yes
apache_ver=2.2
mail-header-patch=yes
dovecot=no


Trying to make gd...
cd . && /bin/sh /usr/local/directadmin/custombuild/gd-2.0.35/config/missing --run aclocal-1.9 -I config
aclocal:configure.ac:64: warning: macro `AM_ICONV' not found in library
cd . && /bin/sh /usr/local/directadmin/custombuild/gd-2.0.35/config/missing --run automake-1.9 --foreign
cd . && /bin/sh /usr/local/directadmin/custombuild/gd-2.0.35/config/missing --run autoconf
configure.ac:64: error: possibly undefined macro: AM_ICONV
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
make: *** [configure] Error 1

How fix this ?

Tryed ./build iconv but no help,

now modified build script and change GD 2.0.35 to 2.0.34 version, now complied ok, without problems!
 
Last edited:
Code:
./build autoconf
./build automake
./build iconv
./build gd

If you're using "./build all", edit the build script and place "doGD;" after "doIconv;".
 
Code:
./build autoconf
./build automake
./build iconv
./build gd

If you're using "./build all", edit the build script and place "doGD;" after "doIconv;".

these with GD 2.0.35 not work, get same error (manyally or ./build all), only if change GD to 2.0.34 version, ./build all work without any problems.
 
Code:
./build autoconf
./build automake
./build iconv
./build gd

If you're using "./build all", edit the build script and place "doGD;" after "doIconv;".

This won't solve the problem.

The problem is in the configure script for gd

un-tar it (or wait for build to fail)
Go into the gd dir
open configure with your favorite editor
find the line
AM_ICONV
change it to
# AM_ICONV

the save it

now you can run the configure that build does
make clean
make
make install

However if you want to use the build script to continue the build, you have to edit it, find the doGD function and comment out the tar line.

Sorry to be so cryptic but I'm heading out. However, I've just finished building gd with the script and it worked fine.

=C=
 
Also:

./build mysql

http://files.directadmin.com/services/all/mysql/debian/mysql-5.0.45-linux-i686.tar.gz

Only this files there:

http://files.directadmin.com/services/all/mysql/debian/mysql-5.0.41-linux-i686.tar.gz

So need update and add other versions too 4.1.22, and 5.1.20

also when updating mysql to 4.1 -> 5.x, user should run these command to fix tables:

/usr/local/mysql/bin/mysqlcheck --check-upgrade --all-databases --auto-repair -p
cat /usr/local/mysql/share/mysql_fix_privilege_tables.sql | /usr/local/mysql/bin/mysql --no-defaults --force --user=root --host=localhost --database=mysql -p

-p asking password
 
Last edited:
Zoner, about the files - you should inform DirectAdmin support :) About the installation - it has been changed from Custombuild v1.0.17. Thank you.
 
Zoner, about the files - you should inform DirectAdmin support :) About the installation - it has been changed from Custombuild v1.0.17. Thank you.

Ok, sended message to support, if they updating files ...
 
Back
Top