Server Monkey is looking for tutorial writers to join our staff. Interested applicants can send a quick introduction of themselves to apply@server-monkey.com


Chattr according to Wikipedia;
“chattr is a Linux command that allows a user to set certain attributes on a file. Mostly chattr is used to make files immutable so that password files and certain system files cannot be erased during software upgrades.”

To set a file as immutable;
chattr +i file_name

To remove;
chattr -i file_name

http://en.wikipedia.org/wiki/Chattr


Cpanel Script Folder

posted by Mark Muyskens

cPanel has a whole folder that contains various scripts you may run. Have you wonder what each one of them did?

  • easyapache — Upgrades and reinstalls the Apache web server.
  • phpextensionmgr — Manages PHP extensions.
  • *up — Updates a service. We currently provide the following update scripts for the services noted:
    • bandminup — Bandmin application.
    • courierup — Courier mail server.
    • cpaddonsup — cPanel’s addon scripts.
    • dovecotup — Dovecot mail server.
    • eximup — Exim mail exchanger.
    • ftpup — FTP servers (ProFTP and Pure-FTP).
    • imapup — IMAP mail server.
    • mysqlup — MySQL service.
    • nsdup — BIND nameserver.
    • phpup — Current version of PHP.
    • suphpup — SuPHP tool for handling PHP requests.
  • restartsrv_* — Restarts a service. We currently provide restart scripts for the following; simply replace the asterisk (*) in restartsrv_* with the term in bold:
    • apache — Apache web server.
    • bind — BIND nameserver software.
    • chkservd — cPanel’s AllDocumentation/AutomationIntegration.TailWatch log processing service.
    • clamd — ClamAV anti-virus software.
    • courier — Courier mail server.
    • cpdavd — cPanel’s WebDAV server.
    • cppop — cPanel’s POP server.
    • dovecot — Dovecot mail server.
    • entropychat — Entropy chat client.
    • exim — Exim mail exchanger.
    • eximstats — Exim mail statistics tracker.
    • ftpserver — FTP server.
    • httpd — Apache web server.
    • imap — IMAP server.
    • inetd — Super-server daemon for managing Internet services.
    • interchange — Interchange e-commerce software.
    • ipaliases — IP aliasing software.
    • melange — Melange chat client.
    • mysql — MySQL database server.
    • named — BIND nameserver software.
    • nsd — Open-source NSD nameserver daemon.
    • postgres — PostgresSQL database service.
    • postgresql — PostgreSQL database service.
    • proftpd — ProFTP server daemon.
    • pureftpd — Pure-FTP server daemon.
    • rsyslogd — Open-source log forwarder daemon.
    • spamd — Spam-deferral daemon.
    • sshd — Secure shell daemon.
    • syslogd — Log forwarder daemon.
    • tailwatchd — cPanel’s AllDocumentation/AutomationIntegration.TailWatch log processing service.
    • tomcat — Apache Tomcat service.
    • xinetd — Open-source super-server daemon.
  • addpop — Adds a POP account.
  • delpop — Removes a POP account.
  • wwwacct — Adds a cPanel account.
  • restorepkg — Restores an account backup or cpmove package.
  • cpbackup — Backs up all accounts.
  • pkgacct — Generates cpmove files, which contain all data for an account. This script is very useful for transferring an account.
  • upcp — Updates cPanel and WHM.
  • setupmailserver — Allows you to switch mail servers.
  • setupftpserver — Allows you to switch FTP servers.
  • setupnameserver — Allows switching between DNS servers.
  • checkperlmodules — Contains a list of standard CPAN modules to install on cPanel servers. This script is used in conjunction with realperlinstaller, below.
  • realperlinstaller — A wrapper script that automates the installation of Perl CPAN modules.
  • suspendacct — Suspends an account.
  • unsuspendacct — Unsuspends an account.
  • runweblogs — Updates statistics for a user.
  • runstatsonce — Updates statistics for all users.
  • makecppphp — Reinstalls cPanel’s internal PHP.
  • portsup — Updates ports (on FreeBSD® systems only).

What is Screen?

posted by Mark Muyskens

Screen allows you to run multiple full-screen pseudo-terminals from one real terminal, and lets you manipulate and save your screen input and output, copy and paste between windows.

First off, install screen;
yum install screen

Now, type;
screen

This will allow you to start a new screen. You can also use the -S option to name your screen like so;
screen -S 1

So your in a new screen now, awesome. Run your dang commands now.

To detach your screen while still leaving it running, you may push ctrl+a and then d.

To attach back to the screen;
screen -r

That’s about it. Screen For Dummies.

Other Commands;
Ctrl+a and then C; create a new screen
Ctrl+a and then N; switches between screens


Installing cPanel in 3 Quick Steps

posted by Mark Muyskens

Installing cPanel is as easy as…

1) cd /home
2) wget http://layer1.cpanel.net/latest
3) sh latest

and then wait while massive text scrolls your screen!



Have you ever wanted to VNC into your server and be able to access a GUI remotely? Well here’s a simple to follow tutorial that I have personally used several times!

Courtesy of WebHostingTalk.com;
http://www.webhostingtalk.com/showthread.php?t=589702


.htaccess Generator

posted by Mark Muyskens

Simple script I made the other day that will generate the exact code you need to password protect a directory. Path is set for a plesk user’s httpdocs folder but can be modified as needed.

http://server-monkey.com/htaccessgenerator



This is caused by having root login to accounts disabled.

1) Log into WHM

2) Go into Tweak Settings

3) Uncheck “Disable login with root or reseller password into the users”

4) Save



./ch_admin_passwd is Plesk’s utility to set the admin password.

Gets password from the environment variable PSA_PASSWORD
Password should be from 5 to 16 symbols and should not contain login name, whitespace, quotes or national characters”

[root@ServerMonkey bin]# export PSA_PASSWORD=’newpass’

[root@ServerMonkey bin]# echo $PSA_PASSWORD

newpass

[root@ServerMonkey bin]# ./ch_admin_passwd

[root@ServerMonkey bin]# export PSA_PASSWORD=

[root@ServerMonkey bin]# cat /etc/psa/.psa.shadow

newpass

[root@ServerMonkey bin]#


Enabling quotas in cPanel

posted by Mark Muyskens

Have you ever had the issue where all your cPanel accounts are showing as unlimited? Well lucky you, thats an easy fix. Just turn on quotas.

1) Log into server via ssh

2) Edit /etc/fstab

pico /etc/fstab

3) Look for a line that looks like the below;

LABEL=/1 / ext3 defaults 1 1

4) Once you find that line, after the word defaults add a comma and usrquota;

LABEL=/1 / ext3 defaults,usrquota 1 1

5) Save and exit

6) Remount;

mount -o remount /

7) Now run the cPanel script to fix quotas;

/scripts/fixquotas


Pure-FTPd and Passive FTP

posted by Mark Muyskens

Need to enable Passive FTP?

1) Log into server via ssh

2) Open conf file

pico /etc/pure-ftpd.conf

3) Uncomment “PassivePortRange” and change to;

PassivePortRange 61001 65535

4) Save and restart;

service pure-ftpd restart