Archive for the 'DirectAdmin Support' Category

Swapping between php versions when using suPHP and CLI with custombuild

If you have both suPHP and CLI installed on your system, but don’t feel like renaming all of your file.php to file.php4 (for example), there is another means to chose between php versions, without requiring to touch your php files.

To force php files to use suPHP (on the assumption your default php version uses CLI) use the following:

<FilesMatch “\.php$”>
AddHandler x-httpd-php5 .php
</FilesMatch>

This last one is on the assumption that php 5 is suPHP and CLI is php4. If php4 was suPHP, then you’d use x-httpd-php4 to force .php files to use suPHP with php 4.

Source: http://directadmin.com/

Cannot use SSH with old system accounts after Installation of DirectAdmin

For all SSH accounts created with DirectAdmin, it adds the “AllowUsers” option to the /etc/ssh/sshd_config file.

When DirectAdmin is installed, it will add “root” and “admin” to that file under the AllowUsers option.

Any other users who have had SSH account on the system will also require to be added to that file in order to access the server via SSH.

Source: http://directadmin.com

How to modify the open_basedir setting for one domain

To change 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

In the top text area, insert this one line:

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

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

Source: http://directadmin.com

SBDavid

Stopping and Restarting Apache

Stopping and Restarting Apache

In order to stop or restart Apache, you must send a signal to the running httpd processes. There are two ways to send the signals. First, you can use the unix kill command to directly send signals to the processes. You will notice many httpd executables running on your system, but you should not send signals to any of them except the parent, whose pid is in the PidFile. That is to say you shouldn’t ever need to send signals to any process except the parent. There are three signals that you can send the parent: TERM, HUP, and USR1, which will be described in a moment.

To send a signal to the parent you should issue a command such as:

kill -TERM `cat /usr/local/apache2/logs/httpd.pid`

The USR1 or graceful signal causes the parent process to advise the children to exit after their current request (or to exit immediately if they’re not serving anything).

apachectl -k graceful

Sending the HUP or restart signal to the parent causes it to kill off its children like in TERM, but the parent doesn’t exit. It re-reads its configuration files, and re-opens any log files. Then it spawns a new set of children and continues serving hits.

Signal: HUP

apachectl -k restart

Note: Before doing a restart, you can check the syntax of the configuration files with the -t command line argument.

SBDavid

About Semaphore

About Semaphore

Semaphore a term used in UNIX for a variable which acts as a counter.

There may be times when two processes try to access the same file simultaneously. In this event we must control the access of the file when the other process is accessing. This is done by assigning value to semaphore.

Semaphore is stored in kernel so that it can be accessed by all processes.

Details of Semaphore

The command

$ ipcs –s

will give the list of existing semaphores.

« Prev - Next »