Tuesday, July 21, 2009

Modify Joomla footer Part 2

To modify the joomla footer in a template, it is overridden in the template directory (Joomla 1.5, the mod_footer module).

/home/plinkgolf/domains/powerlinksgolf.com/public_html/templates/ja_helio/html/mod_footer/

is where the files are located.

Friday, July 03, 2009

Find out who is logged on as root (or any other user)

So I want our support team to get an email when someone logs on as root or su to root on our servers. So I saw this:
Want to be notified instantly when someone logs into your server as root? No problem, check out this nice tutorial on email notification for root logins. Keeping track of who logs into your server and when is very important, especially when you're dealing with the super user account. We recommend that you use an email address not hosted on the server your sending the alert from.

So lets get started!

1. Login to your server and su to root, I know the irony!

2. cd /root

3. pico .bashrc

4. Scroll to the end of the file then add the following:
echo 'ALERT - Root Shell Access (YourserverName) on:' `date` `who` | mail -s "Alert: Root Access from `who | cut -d"(" -f2 | cut -d")" -f1`" you@yourdomain.com

Replace YourServerName with the handle for your actual server
Replace you@yourdomain.com with your actual email address

5. Crtl + X then Y

Now logout of SSH, close the connection and log back in! You should receive an email address of the root login alert a few minutes afterwards.

But I changed to this:
Edit root (or whatever user you wanted) .bash_profile

echo 'ALERT - Root Shell Access (YourserverName) on:' `date` `who` | mail -s "Alert: Root Access from `netstat | grep ssh`" you@yourdomain.com

Replace YourServerName with the handle for your actual server
Replace you@yourdomain.com with your actual email address

This netstat gives you all users connected to your box via ssh at that time, not just the specific user who just sshed in.

Example Output (user SSH sessions from my home laptop ip of 70.131.105.251:
tcp 0 0 ls3.harmonicwebhosting.:ssh adsl-70-131-105-251.d:61852
ESTABLISHED
tcp 0 220 ls3.harmonicwebhosting.:ssh adsl-70-131-105-251.d:63195
ESTABLISHED

ALERT - Root Shell Access on (ls3.harmonicwebhosting.com-64.254.200.10): Fri Jul 3
11:37:51 CDT 2009

Wednesday, July 01, 2009

DirectAdmin DNS issue same shared Linux server-cannot send email to other domain hosted on same server

So we are running Direct Admin on one of our shared linux web hosting servers and ran into a problem where one domain had switched email services to google apps (another mail server not hosted on the Direct Admin shared mail server).

So all other domains on that server could not send email to that domain since they thought the local server was still serving mail even though they changed the MX records to google servers.

Long story short to fix this go to:
Click on the domain in question, Click on Modify DNS Records, Click on Modify MX records, then uncheck the local mail server box as follows:
Local Mail Server
Use this server to handle my emails.
If not, change the MX record and uncheck this option
*Note: Making modifications to the MX records can potentially disable all of your email accounts from recieving mail.
ONLY make modifications if you know what you are doing.
Make sure to include the period at the end of the domain. (eg: mail.domain.com. )