thehenrys.net

November 13, 2009

Useful links…

Filed under: Server Admin — dh @ 2:16 pm

Examples Using the VMware Virtual Disk Manager

June 11, 2008

Setup rsync server on CentOS

Filed under: Server Admin — dh @ 11:22 am

Step-by-step installation and configuration rsync server on CentOS
From transamrit.net & http://am3n.profusehost.net/index.php?id=70

Make sure xinetd and rsync is available, if not type
# yum -y install rsync xinetd

Add xinetd service to system
# chkconfig --add xinetd

Make sure xinetd running on init 3 and 5
# chkconfig --list xinetd

Enable rsync
# vi /etc/xinetd.d/rsync
Change disable = yes into disable = no

Create username and password for rsync client to use
# vi /etc/rsyncd.secrets
adminname:hispassword

Create configuration and shares for rsync daemon
# vi /etc/rsyncd.conf

———————-
max connections = 2
log file = /var/log/rsync.log
timeout = 300

[shares]
comment = shared data stored here
path = /home/adminname/shares
read only = false
list = yes
uid = adminname
gid = adminname
auth users = adminname
secrets file = /etc/rsyncd.secrets
hosts allow = 10.10.105.0/24
———————-

Secure /etc/rsyncd.*
# chown root.root /etc/rsyncd.*
# chmod 600 /etc/rsyncd.*

Restart xinetd
# service xinetd restart

Make sure rsync now running
# chkconfig --list

Perhaps you also want to enable port 873 tcp and udp on your firewall so other can connect to your server.

May 22, 2008

Dump one MySQL database to another MySQL database

Filed under: Programming,Server Admin — dh @ 1:28 am

mysqldump -u[uname] -p[password] [table] | mysql -u[uname] -p[password] –host=[ip address] -C [table]

I.E.: mysqldump -umy_user_name -pmy_secret_password foo_table | mysql -umy_2nd_user_name -pmy_2nd_secret_password –host=1.1.1.1 -C foo_table

(whole command should be on one line of course.) :)

May 19, 2008

PHP, OpenSSL and ftp_ssl_connect() on Win32, my journey…

Filed under: Programming,Server Admin — dh @ 1:46 pm

I need to compile php for Windows so that the ftp_ssl_connect function would be available. This is how I did it. All of this is as of today, May 19, 2008. Windows XP Pro SP2.

  • Download & Install (this is a large install > 1GB):
    » Microsoft Visual C++ 2008 Express Edition
    » Windows SDK for Windows Server 2008 and .NET Framework 3.5
  • Copy C:\Program Files\Microsoft SDKs\Windows\v6.1\Include\WinResrc.h to C:\Program Files\Microsoft SDKs\Windows\v6.1\Include\winres.h
  • Create the directory C:\work
  • Download:
    » php 5.2.6 Source Code and extract it to the C:\work\ folder.
  • Download:
    » Needed Libraries (zip.zip). Edin Kadribašic has a nice zip file with everything in it. You need to go into subfolder /php/win32 and click on zip.zip. (If this link is down try this one: http://perisama.net/ ). Create folder C:\work\php_build\ and extract the zip file into it.
  • Download:
    » Newer libxml2. The libxml package that is included in the zip file was a little out of date. Download this one and extract the contents of the zip file on top of C:\work\php_build\ . Overwrite files as needed.
  • Download & Install:
    » Win32 OpenSSL (Win32 OpenSSL v0.9.8g)
  • Patch php source:
    As of php 5.2.6, you will need to patch C:\work\php-5.2.6\ext\ftp\ftp.c in your php source directory. deciacco did some awesome work in producing a working patch. You can see his site here. You can download my patched version for php 5.2.6 here. Just replace the copy of ftp.c in your C:\work\php-5.2.6\ext\ftp\ folder.
  • Open:
    Start > Program Files > Visual C++ 9.0 Express Edition > Visual Studio Tools > Visual Studio 2008 Command Prompt
  • Type these commands into the Visual Studio 2008 Command Prompt:
    Link To Commands
    You will see many, many compile warnings. This is quite normal. :)
  • If everything went well, you should now have php.exe in the folder C:\work\Release_TS\ which has ftp_ssl_connect functionality.

    February 20, 2008

    Recursively chmod directories or files only

    Filed under: Server Admin — dh @ 12:53 pm

    Great post here:
    http://movabletripe.com/archive/recursively-chmod-directories-only/

    # recursively chmod directories only
    find . -type d -exec chmod 775 {} \;

    # recursively chmod files only
    find . -type f -exec chmod 664 {} \;

    February 6, 2008

    Getting php mail() working on fresh CentOS 5 install

    Filed under: Server Admin — dh @ 10:49 am

    All I had to do was comment out the loopback only restriction and php’s mail() fuction started working great!

    vi /etc/mail/sendmail.mc

    look for:
    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

    change it to this:
    dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

    remake the sendmail.cf file
    m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

    restart sendmail:
    service sendmail restart

    :)

    Great tutorial about the BIND dns server

    Filed under: Server Admin — dh @ 10:45 am

    Here is a great tutorial about the Bind dns server:

    http://www.howtoforge.com/traditional_dns_howto

    February 1, 2008

    Add an IP to CentOS 5

    Filed under: Server Admin — dh @ 10:46 am

    I need more than one ssl website on a new CentOS 5 machine. Here is how to add another ip address to eth0.

    http://www.netadmintools.com/art496.html

    January 15, 2008

    CentOS 5 + vsftpd + lock some users in their home directory ?

    Filed under: Server Admin — dh @ 11:27 am

    vi /etc/vsftpd/vsftpd.conf

    add:
    chroot_local_user=NO

    uncomment:
    chroot_list_enable=YES
    chroot_list_file=/etc/vsftpd/chroot_list

    vi /etc/vsftpd/chroot_list

    add:
    [restricted username]

    service vsftpd restart

    done! ;)

    CentOS 5 + VMware Tools installation problem

    Filed under: Server Admin — dh @ 2:17 am

    Copied here so i wont lose it… ;)

    http://thewebmasterscafe.net/webhosting/vmware-tools-on-linux.html

    Prior to installing the VMware Tools, there are a few things you want to do. The first step would be to install the kernel header files and a C compiler:

    # yum install gcc gcc-c++ kernel-devel

    The second thing would be to create a symbolic link pointing to your kernel header files:

    # ln -s /usr/src/kernels/[your kernel version] /usr/src/linux

    Now you’re ready to install the VMware Tools. From the VMware Server Console (with your virtual machine running), click on “VM => Install VMware Tools”……?. Nothing is supposed to be happening at this point, it’s just like you inserted a virtual CD. From the command line, mount the cdrom drive, copy the installation files to a directory on your virtual hard drive and untar them:

    # mount /dev/cdrom /mnt/cdrom
    # cd /mnt/cdrom
    # cp VMwareTools-[version].tar.gz /tmp
    # cd /tmp
    # umount /mnt/cdrom
    # tar zxf VMwareTools-[version].tar.gz

    Execute the VMware Tools installation script:

    # cd /tmp/vmware-tools-distrib
    # ./vmware-install.pl

    Go through the installation and answer all the questions. I’ve left every settings to its default value.

    When you’re done, simply reboot your virtual machine. I’ve had a little problem with X as it wouldn’t start upon reboot. I just used the X configuration wizard (which launched automatically) to make some adjustments, rebooted the VM again and everything worked fine.

    Next Page »