Tag: Apache
Updating Apache to the latest version
by admin on Sep.08, 2009, under DirectAdmin
You can check the current version of apache by running
httpd -v
If you wish to update your 1.3 version of apache to the most recent, run the following:
cd /usr/local/directadmin/customapache
./build clean
./build update
./build apache_mod_ssl
If you’re using apache 2.x, use "./build apache_2" instead of apache_mod_ssl.
This should update both the configure options and the version of apache to the most recent version. Once the update has completed, you’ll need to restart apache:
RedHat:
/sbin/service httpd restart
FreeBSD:
/usr/local/etc/rc.d/httpd restart
Setting up DA with an SSL certificate
by admin on Sep.08, 2009, under DirectAdmin
You can switch DirectAdmin to use SSL instead of plain text. -> https instead of http on port 2222.
Note that this is for the DirectAdmin connection on port 2222, *not* for apache.
If you’re tryting to setup a certificate for your domain through apache, use this guide.
If you do not have your own certificates, you’ll need to create your own:
/usr/bin/openssl req -x509 -newkey rsa:1024 -keyout /usr/local/directadmin/conf/cakey.pem -out /usr/local/directadmin/conf/cacert.pem -days 9999 -nodes
chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
chmod 400 /usr/local/directadmin/conf/cakey.pem
This is the old method, use either the one above, or this one. The end result is the same, but takes more steps.
openssl req -new -x509 -keyout /usr/local/directadmin/conf/cakey.pem.tmp -out /usr/local/directadmin/conf/cacert.pem -days 3653
openssl rsa -in /usr/local/directadmin/conf/cakey.pem.tmp -out /usr/local/directadmin/conf/cakey.pem
rm -f /usr/local/directadmin/conf/cakey.pem.tmp
chown diradmin:diradmin /usr/local/directadmin/conf/cakey.pem
chmod 400 /usr/local/directadmin/conf/cakey.pem
(Paste these one at a time as the first 2 require user input)
If you already have your own certificate and key, then paste them into the following files:
certificate: /usr/local/directadmin/conf/cacert.pem
key: /usr/local/directadmin/conf/cakey.pem
Edit the /usr/local/directadmin/conf/directadmin.conf and set SSL=1 (default is 0). This tells DA to load the certificate and key and to use an SSL connection. DirectAdmin needs to be restarted after this change.
If you also have a CA Root Certificate, this can be specified by adding:
carootcert=/usr/local/directadmin/conf/carootcert.pem
into the /usr/local/directadmin/conf/directadmin.conf file (won’t exist by default) and by pasting the contents of the caroot cert into that file.
Note, as of 1.30.2, you can set the value of the SSL redirect should a User connect to an https connection with plaintext http.
http://www.directadmin.com/features.php?id=801
As of 1.33.3, you can enable a ssl cipher to force SSLv3, and disable SSLv2:
http://www.directadmin.com/features.php?id=957
How to disable SSL2.0 in apache
by admin on Sep.07, 2009, under DirectAdmin
To disable the SSL2.0 protocol (thus forcing 3.0),
for apache 1.3, find the line:
#SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
and change it to:
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:!SSLv2:+EXP:+eNULL
Note the 2 changes: a) remove the # character at the beginning of the line, and b) change +SSLv2 to !SSLv2
For apache 2.x, do the same thing, but instead it will be in the /etc/httpd/conf/ssl.conf file, or for the new apache system, /etc/httpd/conf/extra/httpd-ssl.conf (if you have both files, just change it in both).
How to add all of the Include lines into your httpd.conf
by admin on Sep.07, 2009, under DirectAdmin
If you reinstall DA (./directadmin i) on a live box, your /etc/httpd/conf/httpd.conf file will get overwritten and emptied of all data. You’ll need to read all of the Include lines for your users so that their sites show up (you’ll be seeing the apache pages, or the shared IP pages instead)
Type:
cd /usr/local/directadmin/data/users
for i in `ls`; do { echo "Include /usr/local/directadmin/data/users/$i/httpd.conf" >> /etc/httpd/conf/httpd.conf; }; done;
Note that this add the include lines for *all* users.. so if you’ve added users to DA after you ran the "./directadmin i", you’ll end up with duplicates. Make sure you don’t have duplicate Include lines.. (apache won’t restart, it will let you know)
semget: No space left on device
by admin on Sep.07, 2009, under DirectAdmin
This relates to semaphores on your system (you’ve run out). Run the following to clear them out:
ipcs | grep apache | awk ‘{print $2}’ > sem.txt
for i in `cat sem.txt`; do { ipcrm -s $i; }; done;
