Thursday 11th of March 2010

logo
Roots Hosting provides hosting for websites we make only. We use and recommend HostForWeb because they provide us with the best support (I've tried compared and abandoned: HostGator, Godaddy, BlueHost and SiteGround)


Roots Hosting, web-design and hosting solution for small businesses based in Thailand
Hosting and Web-Design in Thailand, USA, France, Switzerland, Cambodia, Malaysia, Indonesia...

Glad if we can help!

We propose services of creating, hosting, and maintaining websites in and outside of Thailand and currently provide services for customers in Bangkok, Pattaya, Rayong, Ko Samui in Thailand; Crans-Montana in Switzerland; Paris, France; Phnom Penh Cambodia; New York, USA.


WEBSITES FROM 100 TO 1000 EUROS


If you are looking for website hosting services only, please click on the red sign "hosting and full support" on the top right of the page.


Roots Hosting specialises in hospitality related websites such as hotels, guesthouses, travel websites for which we also can arrange promotion and booking support, while we also have experience in making websites for discotheques, real estate agencies online, and different kinds of interactive commercial websites such as online shops, forums, classified ads engines...


Read more...
 
Easy Step-by-Step Tutorial to Insert a Google Map Code in a Website Page
JOOMLA, Integration, Security

First login or regtister a Google account and get a Google API for your website here:

http://code.google.com/apis/maps/signup.html
a Google API loks like this:
ABQIAAAAjoYI18iwzhxdzE_oHo1bORQRyasdf8tDNhV3CFNpdUSnILgyHxSuu9rmuk4eBqx67BCZRJ6hvKErZA


I'm not sure how you make and update your website, but what you have
to manage to do is
Read more...
 
Tutorial: List of shell / SSH commands to monitor server and other basic functions
HOSTING ISSUES

HERE ARE SOME USEFUL / VITAL SSH COMMANDS THAT ALLOW BEGINNERS TO MONITOR THE BASICS OF APACHE SERVER (HERE CENTOS 4), TO INQUIRE SERVER LOAD PROBLEMS, HANDLE CHMOD COMMANDS, DELETE HACKED / CORRUPT FILES AND FOLDERS, INQUIRE ABOUT SERVER ACTIVITY AND DISK USAGE... INSTEAD OF WAITING FOR SUPPORT IN AN ENDLESS COMMUNICATION WHIRLPOOL FOR SOMETIMES SIMPLE THINGS, HERE ARE SOME BASIC SSH COMMANDS TO KEEP A HAND ON YOUR SERVER OR VIPS AND USE SUPPORT THE MOST EFFICIENTLY POSSIBLE: ---- VERY USEFUL FOR JOOMLA USERS, MOST COMMANDS YOU NEED ARE HERE ----


LINUX CENTOS USEFUL COMMANDS FOR DUMMIES



GENERAL SERVER HANDLING:





Getting General Command Help From Within SSH

With you are connected in with SSH, in most cases you can find help on a command by typing:

--help

eg. cd --help

If that doesn't work, you can also try:

man

eg. man iptables

Man stands for manual, like a help manual.




Common SSH Commands or Linux Shell Commands

cd : change directory · · cd /usr/local/apache : go to /usr/local/apache/ directory
cd ~ : go to your home directory
cd - : go to the last directory you were in
cd .. : go up a directory cat : print file contents to the screen

cat filename.txt : cat the contents of filename.txt to your screen
tail : like cat, but only reads the end of the file
tail /var/log/messages : see the last 20 (by default) lines of /var/log/messages
tail -f /var/log/messages : watch the file continuously, while it's being updated
tail -200 /var/log/messages : print the last 200 lines of the file to the screen

more : like cat, but opens the file one screen at a time rather than all at once
more /etc/userdomains : browse through the userdomains file. hit Spaceto go to the next page, q to quit

pico : friendly, easy to use file editor
pico /home/burst/public_html/index.html : edit the index page for the user's website.


File Editing with VI ssh commands
vi : another editor, tons of features, harder to use at first than pico
vi /home/burst/public_html/index.html : edit the index page for the user's website.
Whie in the vi program you can use the following useful commands, you will need to hit SHIFT + : to go into command mode

:q! : This force quits the file without saving and exits vi
:w : This writes the file to disk, saves it
:wq : This saves the file to disk and exists vi
:LINENUMBER : EG :25 : Takes you to line 25 within the file
:$ : Takes you to the last line of the file
:0 : Takes you to the first line of the file

grep : looks for patterns in files
grep root /etc/passwd : shows all matches of root in /etc/passwd
grep -v root /etc/passwd : shows all lines that do not match root

ln : create's "links" between files and directories
ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf : Now you can edit /etc/httpd.conf rather than the original.
changes will affect the orginal, however you can delete the link and it will not delete the original.

Shell Text Editor (nano)

The best Linux text editor for SSH is nano (also known as pico but was renamed). You can create, edit and manipulate files of
all types as long as they are text based in this program. It is small and easy to use and install.

nano

eg. nano httpd.conf




Installing Nano (Text Editor) In SSH

wget download.fedora.redhat.com/pub/fedora/
linux/core/3/i386/os/Fedora/RPMS/compat-openldap-2.1.30-2.i386.rpm
rpm --install compat-openldap-2.1.30-2.i386.rpm
wget ftp://rpmfind.net/linux/redhat/9/en/os/i386
/RedHat/RPMS/pine-4.44-18.i386.rpm
rpm -Uhv ftp://mirror.switch.ch/mirror/scientificlinux
/40rolling/i386/SL/RPMS/compat-libcom_err-1.0-5.i386.rpm
rpm --install pine-4.44-18.i386.rpm

If you're still use to using the pico command, you can add use the following to create a link.
This means so when you type pico it will link to the new command nano without you noticing.

cd /usr/bin
ln nano pico





accessing files: If you would like to look into any of those, just type:

less /home/beatbang/public_html/cache/com_jevents/NAME-OF-THE-FILE-FROM-/root/beatbang.list.files.txt-HERE


Making Files and Directories

There are lots of ways to create a file on the fly.

Best way is to use a text editor like nano:

nano filename.conf

OR to put something quickly in a file use:

echo "my content" > test.txt

This will create an empty file.
Touch updates when a file was
last updated but in this case will also create it if it doesn't exist:

touch test.txt

Make a directory, you can use:

mkdir




chmod: changes file access permissions
The set of 3 go in this order from left to right:
USER - GROUP - EVERONE


Article provided by WebHostGear.com
0 = --- No permission
1 = --X Execute only
2 = -W- Write only
3 = -WX Write and execute
4 = R-- Read only
5 = R-X Read and execute
6 = RW- Read and write
7 = RWX Read, write and execute


Article provided by WebHostGear.com

Usage:
chmod numberpermissions filename

chmod 000 : No one can access
chmod 644: Usually for HTML pages
chmod 755: Usually for CGI scripts


chown: changes file ownership permissions
The set of 2 go in this order from left to right:
USER - GROUP

chown root myfile.txt : Changes the owner of the file to root
chown root.root myfile.txt : Changes the owner and group of the file to root
OPERATIONS:
CHMOD:
chmod -R 755 /home/hotelboo/public_html/*
chmod -R 777 *.*

chown -R user?.?grp location/*

chown -R user.group *

File System Permissions

Permissions in the file system are broken down into:

* File permissions
* Group permissions

Permissions can be assigned to files and directories.

File permissions can be adjusted with the CHMOD tool
(stands for change mode). Permissions are broken up to Read, Write, Execute.
These permissions can then be assigned to root (master user),
the group, and everyone (general public like web guests).

Permissions are represented by a number (CHMOD Numbers).
Digit rwx Result
0 --- no access
1 --x execute
2 -w- write
3 -wx write and execute
4 r-- read
5 r-x read and execute
6 rw- read and write
7 rwx read write execute

Remembering that permissions are assigned to three groups
(root, group and everyone) each group is assigned a number.
For example, 777 refers to full access for everyone.
Numbers 775 or 755 are the general permissions assigned to web directories and pages.

To change the CHMOD permissions:

chmod

eg. chmod 755 index.html

or for a directory:

eg. chmod 755 public_html

To mass change permissions, which you must be VERY careful of, you can use the -r parameter because it changes everything.

eg. chmod -r 755 public_html

Everything under public_html will now have the permission of 755
(root full access, group read and execute, public read and execute).

There is an excellent tutorial showing more in depth information
on mode and group permissions located at http://www.library.yale.edu/~lso/workstation/docs/permissions/



command --help
tab or tabtab



root@server [/]# chmod -R 755 /home/hotelboo/public_html/*
root@server [/]# chmod -R 644 /home/hotelboo/public_html/*.*

Here are commands to chmod all files and folders in users directory to 755 and files to 644.

#Chmod Directorys for 755
find /home/changrea/public_html -type d -exec chmod 755 {} \;

# Chmod Files for 644
find /home/changrea/public_html -type f -exec chmod 644 {} \;



Tutorial: List of shell / SSH commands to monitor server and other basic functions
Support Tutorials - HOSTING ISSUES

Here is a list of the most common and most used SSH commands on a Linux-Centos server



Here are commands to chmod all files and folders in users directory to 755 and files to 644.

#Chmod Directorys for 755
find /home/changrea/public_html -type d -exec chmod 755 {} \;

# Chmod Files for 644
find /home/changrea/public_html -type f -exec chmod 644 {} \;


Create FTP Account For New Location

adduser
passwd

On request enter the password and re-enter the password on request.

chmod -R 755 /home/

As required, change ownership to:

chown -R . /home/




Create FTP Account For Duplicate Location (eg. second user same path)

Scenario: site1 already exists and user33 needs access to site1 files.

adduser user33
passwd user33

On request enter the password and re-enter the password on request.

nano /etc/passwd

Change user33 path from /home/user33 to /home/site1

nano /etc/group

Change user33 to site1 group (eg. site1:x:501:user33)




Delete Users

One of these commands will delete a specified user:

userdel

OR

deluser

OR

rmuser


Ping

The popular ping command is used to check if a connection can be established with a server. It also measures the response times amongst a few other details. To run a ping use:

ping




Tracing

You can run a trace on any host providing you can connect to it. A trace, pings each hop of the connection and displays the information until it reaches the last node in the connection,
generally your server. Traces are generally used to test for network issues.

traceroute




WHOIS

The internet is built on IP addresses. However to make it easier to access a server, the domain name implemented. To record who owns what domain name all information is stored in a
large database generally referred to as the WHOIS database. You can run your own search by typing whois.

whois google.com

WHOIS look ups can also be done on IP addresses to see who they are registered to for things like reporting spam or abuse.
Simply use the same command but replace it with the IP address to query instead.

Some providers offer are more refined database of their own that they store customer information in. For example:

rwhois://rwhois.layeredtech.com:4321

This is one example of a referral server and you can query it and find our more information generally even reseller names and details.

eg. whois -h rwhois.layeredtech.com -p 4321




RDNS lookup (host)

To check what an IP resolves to (reverse DNS entry) use the host command.

host 72.14.207.99




Send Message In SSH

You can send messages or broadcast notices to other SSH users by using the wall command.

eg. wall




Find Service

You can you the where is command if you are unsure of paths:

eh. whereis mysql




What is fsck?

Stands for "File system check" - It checks the disk for corrupt sectors and attempts to repair. Can be used when errors like "seg fault" appear and other situations.




SERVER INFO, FILE LOCATION PATH
Common Paths and File Locations

MYSQL Config - /etc/my.cnf
MYSQL - /usr/local/mysql/

SSH Config - /etc/ssh/ (generally the conf file with sshd in it)

Apache (or httpd) - /usr/local/apache/ OR /etc/httpd
Apache Conf file - /usr/local/apache/conf/httpd.conf
Apache Daemon - /usr/local/apache/bin/apachectl

Logs - /var/log/

User Data - /home/




Restarting Services (Apache, Mysql, etc)

If setup, you can generally use the "service" command. eg:

service httpd restart

It's a shortcut method to accessing daemons.

HTTPD - service httpd restart OR service apache restart
MYSQL - service mysql restart



Running Scripts/Programs

You can do so in two ways:

Change directory to the correct path then execute:

cd /scripts
./scriptname

OR

/scripts/scriptname

For sh scripts, you need to put sh in front of it:

cd /scripts
sh scriptname

OR

sh /scripts/scriptname




Repairing Databases

pathtomysql/bin/mysqlcheck -B --repair

Generally the path to mysql is /usr/local/mysql/ but not always.

If you get an access denied error, you need to login first. If you have root access you can just add a -p on the end.

pathtomysql/bin/mysqlcheck -B -p --repair

Do not enter your password in the command. It will prompt you to login after you press enter. If you need to login with a user account (not root) add an -u for user.

pathtomysql/bin/mysqlcheck -B -u -p --repair

The -B parameter means select a single database or two or three. If you want to repair all of them, use -A instead (root required):

pathtomysql/bin/mysqlcheck -A -p --repair

Remember the different ways of accessing the program:

a) cd pathtomysql/bin/
./mysqlcheck -A -p --repair

b) /pathtomysql/bin/mysqlcheck -A -p --repair

c) mysqlcheck -A -p --repair

Sometimes servers are setup (sbin) so you don't have to type all the full paths or change to them.




Red IP Addresses/Sites Do Not Work Off Primary Shared IP (cPanel/WHM)

If you go to "Show or Delete Current IP Addresses" in WHM and you see red IP addresses, the ipaliases service has failed or been forced to stop.
This happens sometimes and their isn't a feature in WHM to restart it. You need to restart it via SSH:

service ipaliases restart

OR

/etc/init.d/ipaliases restart




Easy way to find php.ini path

The easiest way to find the php.ini file (the file where all the general php settings are stored), short of not knowing it off
the top of your head; you can use a combination of commands.

Do note execute these commands yet! You can use the command:

php -i

This prints out all the php information as seen via a web browser when the phpinfo(); command is used. Within all this information is the path to
the php.ini file. So we're simply going to grep the information. You can use this command to find the path to the php.ini file:

php -i | grep php.ini

It will return something like this:

Configuration File (php.ini) Path => /usr/local/lib/php.ini

That's your file!




















SECURITY AND LOGS:
view your servers current load and what processes and activity your server is currently running
You can log into your vps using ssh and use the commands
uptime
top -c
service httpd fullstatus


For monitoring the VPS status try:
free -m (memory usage)
top (overall processor/memory usage)
ps auxf
mysqladmin processlist


I see that you want to optimize your vps, by finding what makes load on your vps. For that top is not good enough,
because it shows current load (last 1, 5 and 15 minutes), and resources state distribution per live processes,
either running or sleeping. If some cron task is making spikes, you probably will never catch it with top,
but you need to arrange some more sophisticated monitoring system.
Handy thing for top is changing sort column with

< or >
(default sort column is %CPU),

but press
shift+< twice a
nd you will get processes sorted by cumulative time.
That's excellent for runing processes, but as I said above,
if process is strated from cron, you need other solution. I hope this answers your questions




You can check all active Apache processes using this command:
service httpd fullstatus
That way you can see if some domain is getting too much traffic and using resources.


netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n
That one lists IP's by connection number.

iptables -I INPUT -s IP -j DROP
That one blocks a IP.


You can check all active Apache processes using this command:

service httpd fullstatus





BLOCK IP:
What it means, is that an IP tried to get access, but failed.

The CPHulk feature did it's job, and blocked the IP.


Also, I blocked this IP via SSH:

iptables -I INPUT -s 202.113.244.42 -j DROP




PREVENT BRUTE FORCE OF SERVER:

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

That one lists IP's by connection number.

iptables -I INPUT -s IP -j DROP

That one blocks a IP.

tail -f /var/log/secure

tail -f /var/log/secure
This can be used to see if someone is trying to brute force into your server.



last : shows who logged in and when
last -20 : shows only the last 20 logins
last -20 -a : shows last 20 logins, with the hostname in the last field

w : shows who is currently logged in and where they are logged in from.
who : This also shows who is on the server in an shell.

netstat : shows all current network connections.
netstat -an : shows all connections to the server, the source and destination ips and ports.
netstat -rn : shows routing table for all ips bound to the server.

top : shows live system processes in a nice table, memory information, uptime and other useful info. This is excellent
for managing your system processes, resources and ensure everything is working fine and your server isn't bogged down.
top then type Shift + M to sort by memory usage or Shift + P to sort by CPU usage

ps: ps is short for process status, which is similar to the top command. It's used to show currently running processes
and their PID.
A process ID is a unique number that identifies a process, with that you can kill or terminate a running program on
your server (see kill command).
ps U username : shows processes for a certain user
ps aux : shows all system processes
ps aux --forest : shows all system processes like the above but organizes in a hierarchy that's very useful!

touch : create an empty file
touch /home/burst/public_html/404.html : create an empty file called 404.html in the directory /home/burst/public_html/

file : attempts to guess what type of file a file is by looking at it's content.
file * : prints out a list of all files/directories in a directory


Firewall - iptables commands
iptables -I INPUT -s IPADDRESSHERE -j DROP : This command stops any connections from the IP address
iptables -L : List all rules in iptables
iptables -F : Flushes all iptables rules (clears the firewall)
iptables --save : Saves the currenty ruleset in memory to disk
service iptables restart : Restarts iptables

Apache Shell Commands
httpd -v : Outputs the build date and version of the Apache server.
httpd -l : Lists compiled in Apache modules
httpd status : Only works if mod_status is enabled and shows a page of active connections
service httpd restart : Restarted Apache web server

MySQL Shell Commands
mysqladmin processlist : Shows active mysql connections and queries
mysqladmin drop databasenamehere : Drops/deletes the selected database
mysqladmin create databasenamehere : Creates a mysql database

Restore MySQL Database Shell Command
mysql -u username -p password databasename < databasefile.sql : Restores a MySQL database from databasefile.sql

Backup MySQL Database Shell Command
mysqldump -u username -p password databasename > databasefile.sql : Backup MySQL database to databasefile.sql




kill: terminate a system process
kill -9 PID EG: kill -9 431
kill PID EG: kill 10550
Use top or ps ux to get system PIDs (Process IDs)

EG:


PID TTY TIME COMMAND
10550 pts/3 0:01 /bin/csh

10574 pts/4 0:02 /bin/csh

10590 pts/4 0:09 APP



Each line represents one process, with a process being loosely defined as a running instance of a program. The column
headed PID (process ID) shows the assigned process numbers of the processes. The heading COMMAND shows the location
of the executed process.

Putting commands together
Often you will find you need to use different commands on the same line. Here are some examples.
Note that the | character is called a pipe, it takes date from one program and pipes it to another.
> means create a new file, overwriting any content already there.
>> means tp append data to a file, creating a newone if it doesn not already exist.
< send input from a file back into a command.

grep User /usr/local/apache/conf/httpd.conf |more
This will dump all lines that match User from the httpd.conf, then print the results to your screen one page at a time.

last -a > /root/lastlogins.tmp
This will print all the current login history to a file called lastlogins.tmp in /root/

tail -10000 /var/log/exim_mainlog |grep domain.com |more
This will grab the last 10,000 lines from /var/log/exim_mainlog, find all occurances of domain.com (the period represents 'anything',
-- comment it out with a so it will be interpretted literally), then send it to your screen page by page.

netstat -an |grep :80 |wc -l
Show how many active connections there are to apache (httpd runs on port 80)

mysqladmin processlist |wc -l




Check ports for processes

If you want to check what process is running on the server on a certain port you can use the lsof command. You can check everything by typing:

lsof

You can also check just a single port and protocol, using port 80 as an example:

lsof -i tcp:80

This will check port 80 on TCP protocol. Here's an example output:

root@server [/]# lsof -i tcp:80
COMMAND PID USER FD TYPE DEVICE SIZE NODE NAME
httpd 3313 root 19u IPv4 8033 TCP *:http (LISTEN)
httpd 25553 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 25554 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 25555 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 25556 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 25557 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 25789 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 26410 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 27622 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 27625 nobody 19u IPv4 8033 TCP *:http (LISTEN)
httpd 28113 nobody 19u IPv4 8033 TCP *:http (LISTEN)




Flush Exim Queue

If you've got 2000 emails queued to be sent which you know are all spam, you can quickly clear the queue by typing:

exim -qff

You can also use it in debugging mode:

exim -qff -d9




Access Denied Error from phpMyAdmin via WHM (cPanel)

When you try and load phpMyAdmin from cPanel's Web Host Manage (WHM) a message saying access denied appears. There is a very simple solution to this.

From web host manager, under SQL Services click MySQL Root Password. Enter in a password and save it.

Try loading up phpMyAdmin again from web host manager and it should be fine. No SSH commands, no configuration files - type and click.




Locate files owned by nobody and delete

This is extremely useful for locating files that have been uploaded using an exploit and are still owned by the nobody user. Note this isn't
the solution to cleaning up an exploit, just a tool to assist in the clean up.

The below command will search all user document root for files owned by nobody and display them on the screen. This is one of the most
likely location of uploaded nobody files but its possible for files to be outside this directory. You'll need to adjust the scope of the command where necessary.

find /home/*/public_html -user nobody -print

The below command will search and delete all files in the users document root that are owned by the nobody user. It's recommended
you just do a find first, then if it's clear run the below command:

find /home/*/public_html -user nobody -print | xargs rm

To delete folders owned by nobody user too, use:

find /home/user/public_html -user nobody -print | xargs rm -Rf



Check Binded IP addresses

ifconfig

Under eth0 you'll see something like:

inet addr:xx.79.162.45 Bcast:xx.79.162.45 Mask:255.255.255.248

Gives you the IP details. The "lo" one is the loopback adapter, allows it to talk to itself. Insane hey?






































INQUIRING, DEBUGGING FILE AND FILE MANAGER

du : shows disk usage.
du -sh : shows a summary, in human-readble form, of total disk space used in the current directory, including subdirectories.
du -sh * : same thing, but for each file and directory. helpful when finding large files taking up space.
If you would like to do run a disk space usage breakdown,you can always try by positioning yourself into directory you want to count space on and run:

du --max-depth=1 -h

There are some variants on du (disk usage) command, if interested type: man du into a command line or browse on teh Internet for linux manual pages.

Anyhow, I created a file with list of all files under:

/root/beatbang.list.files.txt

for your inspection. If you would like to look into any of those, just type:

less /home/beatbang/public_html/cache/com_jevents/NAME-OF-THE-FILE-FROM-/root/beatbang.list.files.txt-HERE




Listing Directory Content
BEST I FOUND IS:

ls -Xl

To list the files and folders inside a directory you can use the ls command.

eg. ls

For better display, you can use:

eg. ls -l

On some servers, if its setup you can simply type two L's and it will work like ls -l

eg. ll

For more advanced directory listing options type:

eg: ls --help

If you would like to run a filter over the results you can add a pipe, followed by the grep command and then your criteria..

eg. ll | grep index

OR

eg. ll | grep .php

Don't forget if ll doesn't work, use the ls or ls -al commands. Wildcards are not needed. The grep command searches for pattens in things.
This is merly one example of its uses.

ls : list files/directories in a directory, comparable to dir in windows/dos.
ls -al : shows all files (including ones that start with a period), directories, and details attributes for each file.




file information command:
wc : word count
wc -l filename.txt : tells how many lines are in filename.txt

cp : copy a file
cp filename filename.backup : copies filename to filename.backup
cp -a /home/burst/new_design/* /home/burst/public_html/ : copies all files, retaining permissions form one directory to another.
cp -av * ../newdir : Copies all files and directories recurrsively in the current directory INTO newdir

mv : Move a file command
mv oldfilename newfilename : Move a file or directory from oldfilename to newfilename

Delete / remove files:
rm : delete a file
rm filename.txt : deletes filename.txt, will more than likely ask if you really want to delete it
rm -f filename.txt : deletes filename.txt, will not ask for confirmation before deleting.
rm -rf tmp/ : recursively deletes the directory tmp, and all files in it, including subdirectories. BE VERY CAREFULL WITH THIS COMMAND!!!
Delete the folder and everything under it:

rm -r


To delete everything without prompting for delete add a -f in there too:

rm -rf

Delete a file:

rm

Delete file without prompt:

rm -f


rm -rf sess* when inside a directory, delete (remove) all files starting with "sess"


So to delete everything under the "downloads" directory you could:

Example 1:

cd /home/user1/public_html/
rm -rf download

This would delete the download directory, without prompt and everything under it.

Example 2:

cd /home/user1/public_html/download
rm -rf ./*

for emergency delete files of folder can't access:
find -name \*.cache -exec rm -rf {} \.

Most efficient to force delete::

find |grep '.cache'|xargs rm -rf

which works like this
the find string lists all files in this directory and below.
the grep string searches the output for all files that contain the character ".cache" then prints only those to output
the xargs runs the command rm -rf on the output output
This is a slightly longer way to run the command, however is more reliable.




useful functions:
TAR: Creating and Extracting .tar.gz and .tar files
tar -zxvf file.tar.gz : Extracts the file
tar -xvf file.tar : Extracts the file
tar -cf archive.tar contents/ : Takes everything from contents/ and puts it into archive.tar
gzip -d filename.gz : Decompress the file, extract it

ZIP Files: Extracting .zip files shell command
unzip file.zip







Useful symbols including wildcards

One powerful feature is the use of the symbols. They allow you to write information to and from a file.

eg. echo "my data" > test.conf

The above command will replace all the file content with "my data". If you want add to the bottom of the file:

eg. echo "my data" >> test.conf

It also works the other way too. For example if you have an sql back up in backup.sql, you can import it:

eg. mysqldump -B [database name] -u [username] -p < backup.sql

The * symbol refers to everything. For example to delete everything in the current folder use:

rm -rf ./*

 
Joomla and Linux Session Save path / session.save_path
SERVER AND DNS

hi,
I'm not sure what I did wrong, but I tried to change session.save_path settings to Y;/path
when I did that I started to have big problems on my website and when I tried to put it back to N;/path, the problems are still there...
it used to show :N;/path **DEFAULT**, Click to Edit (with a line crossing the N'/path)
now if i only put N'/path, my website is still not back to normal, i cant' even login
is there a way to come back to what it was before? what did I do wrong?

Read more...
 
Joomla integration and security on VPS, ioncube, mod_security, Linux, and PHP versions
JOOMLA, Integration, Security


Posted On: 23 Jan 2009 08:10 AM
hi
to make this short, please tell me if our PHP version is over 5.1 or just 5
thanks

Posted On: 23 Jan 2009 08:14 AM
PHP 5.2.6 (cgi) (built: Aug 15 2008 01:18:07)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd., and
with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

Read more...
 
Setting up CNAME and A record for subdomain for online hotel booking affiliate program
SERVER AND DNS

Hi,
I'm testing some program and for it, i need to make a subdomain (hotels/ already created, i hope properly),
and I need to make an A Record for that subdomain that would point to IP xxx
and this i don't know how to do, even from whm...
also, if u can help me to finish that, can u tell me if this can bring collateral problem?
thanks if you can help

exemple website by:

Reserve Cheap Hotel Room in UK London, France Paris, Switzerland Geneva, USA New York, Thailand Bangkok, Cambodia Phnom Phen, Japan Osaka, Tokyo, Kyoto, Singapore, Hong Kong, China Beijing Shanghai, Australia Sidney Perth, India Bombay Goa Delhi, Russia Moscow St Petersbourg

Read more...
 
How to Zip and UnZip files and folders online directly on my server's hosting account?
HOSTING ISSUES

hi,
I've tried several ways to zip folders and unzip them online (zip/tar/rar/gzip) but it seems that i'm unable to do so, each format bringing his difficulties...
please tell me what format is best and what tool to use to compress (7zip for exemple doesn't allow multi-file archives in gzip)
Thanks if you can help

Read more...
 
Can't access Virtuozzo Parallel Power Panel / SSl Certs
SERVER AND DNS

when i try to reach https://216.222.52.223:2653/vz/cp and https://216.222.52.223:2653/vz/cp I get the following error message:

"Secure Connection Failed
An error occurred during a connection to 216.222.52.223:2653.
You have received an invalid certificate. Please contact the server administrator or email correspondent and give them the following information:
Your certificate contains the same serial number as another certificate issued by the certificate authority. Please get a new certificate containing a unique serial number.
(Error code: sec_error_reused_issuer_and_serial)
The page you are trying to view can not be shown because the authenticity of the received data could not be verified."

Read more...
 
Problems reaching international websites from Thailand with Tot and totbb: how to check
SERVER AND DNS

hi,
I'm having a problem...
all my websites take ages to open, if pages open at all...
all other websites i open are fine... only mine are soooooo slow
when I look at VPZZ resources, i see that load average is very inconsistent and go up quite much
is there a problem there please?
kindly
Posted On: 24 Nov 2008 02:43 AM
Hi,

Read more...
 
How to Check if Curl is Enabled (Linux Centos SSH Command)
SERVER AND DNS


I need to enable curl on hte server but don't know how to do it
can you tell me how to do please
thanks

Read more...
 
Sharing Resources on VPS and how to manage basic server activity through ssh commands
SERVER AND DNS

Hi,
I noticed recently that this sever had abnormal resources usage via VZPP/resources
i know that it's not a good reference, but i also know that an empty server like this one should never pass 12 or 13% of resources usage.
but for the past days that i start to work on it again, i can see that activity is constantly over 33%
I was scared of script or email exploit, but actually deleted the only account there (hotelboo) and re-created it from scratch
but activity is still 33%... like if something was using the server, but not from script exploit...

Read more...
 
Reloading Backup Via Cpanel WebHost Manager
HOSTING ISSUES

hi,
would it be possible to reload the backup called backup-7.18.2008_11-36-34_hotelboo.tar.gz
it's in /home/helbdfdoo/
Also... Is that something i should do from WHM? what if I wanted to do that myself?
Thanks

Read more...
 
Problem with Mail not arriving after migration because no cancellation of MX entries left on old account
EMAIL / MX / Spam

my customer complains that This e-mail address is being protected from spambots. You need JavaScript enabled to view it has stopped working today...
I tested, and it's correct, mails don't reach the inbox
I don't know what could have happened for nobody has touched that account in ages
Kindly    
Posted On: 11 Nov 2008 10:21 AM
Greetings
the email accounts inbox in whm appears to be broken. I can tell this because in whm the account reads as having 0 megs of data in it. however, in ssh the account inbox has 188 k or 1.8 megs of data in it. The quickest fix for this is going to be simply deleting the email account in whm, and recreating it, witch will fix the broken files and permissions and quotas or what ever file tree is broken in the email account. (there are many, many that could possibly be broken and causing this problem )

Read more...
 
Website Content Theft and Copyright Policies from Main Hosting Companies
HOSTING ISSUES

hi,
I'd like to know if Web Hosts offer any kind of support in case of stolen content.
all my websites have been copied on this spam website such as: http://www.freewebsiteratings.com/153167/reggaeguesthouse.com
is there some action that hfw can do to have this wesite banned from search engines or something?
if not, its IP is 66.40.10.24 but it's probably a fake one... is there a way to really track origin IP of this website and block the IP from which they crawl and copy my data?
Kindly.     
Posted On: 06 Nov 2008 02:05 AM
Hi,

Unfortunately we and most hosts do not provide this kind of support,since it is not related to the hosting company itself.You need to report that to the abuse of the hosting company that hosts that site.

 
Website unreacheable and appears down actually due to DNS problem
SERVER AND DNS

I try to open my website www.rootsreggaeclub.com but it looks unreachable
it was all good last night though...
please advise
Kindly
Posted On: 21 Oct 2008 09:40 PM
Greetings,

The website is currently up and running fine from here.

Are you still experiencing the issue at the moment ?
If so, please go to http://whatismyip.org and let me know what your IP is.

Read more...
 
Secure Connection Failed
HOSTING ISSUES

I'm checking with you just in case.
when it's the first time on a certain machine that i try to connect to virtuozzo on either of my vps, i get warnings regarding the security certificates, exemple:

Secure Connection Failed

216.246.52.233:4643 uses an invalid security certificate.

The certificate is not trusted because it is self signed.
The certificate is only valid for vps65.servershost.net
The certificate expired on 20/6/2551 19:19.

(Error code: sec_error_expired_issuer_certificate)

* This could be a problem with the server's configuration, or it could be someone trying to impersonate the server.

* If you have connected to this server successfully in the past, the error may be temporary, and you can try again later.




It's probably nothing, but I'm checking with you just in case
Kindly

Posted On: 19 Sep 2008 01:31 AM
Hi,

Servers use their internal security certificate.You will get that message every time.It is nothing to worry about.

 

 

 

 

Note: in this case my computer clock was set to default and was making all security certificates look awkward to my browsers

 
Joomla integration in new VPS: Solving Porblems between Joomla Editors and Linux Centos VPS
JOOMLA, Integration, Security

Since transfer to this server I'm having problems with a text editor that doesnt' want to open properly anymore since we're on this server.
more interesting, it works from my computer only, and not from any other computer (we tried 6)
very strange issue, I've been on it all day thinking it's a script problem but I think it's server side:
problem appeared today, all was ok on shared
windows IE7 gives an error message that says that access is denied, error code:0, in file mambots/editors/fckeditor/editor/fckeditor.html
line39 which says:
37 function LoadScript( url )
38 {
39 document.write( '<\/scr' + 'ipt>' ) ;
40 }

plus other errors related to line 182
182 if ( FCKBrowserInfo.IsGecko )
183 {
184 function Window_OnResize()
185 {
186 if ( FCKBrowserInfo.IsOpera )
187 return ;............................................

on Apache raw error logs there are also loads of errors related to javascript for this fck editor

Read more...
 
Enabeling Function Include on domain account basis
SERVER AND DNS
hi,
I was advised to disable function include on the server which i did
but There's one site i got where the customer wants to install an online translator which requires function include...
is there a way to allow this only for this specific account and not the rest of the server?
Read more...
 
Spam control from cpanel
EMAIL / MX / Spam

my customer have noticed that since we're on the new server they get more spam than when we were on teh shared

are there some settings from the shared servers that we ought to implement in server.rootshosting.net and server.securehotelbooking.net in order to make them more spam proof... at least like the shared?

Read more...
 
Tips / Tutorial: How to make a successful Link Exchange Directory
Newsflash

question: is contacting other websites for cross-linking considered as spamming?
answer: no, not if it's done properly, please read below

Read more...
 
Troubleshooting: issue with subdomains i Cpanel
HOSTING ISSUES

hi,

all subdomains under this account seem ok to me in dns zone but they don't resolve

Read more...
 
All the problems that can happen when setting up a VPS for Joomla: full recommendations
JOOMLA, Integration, Security

hi,

I just purchased a VPS, we're now going to set it up in order to make joomla 1.5 completely secure:

Read more...
 
Website Going Down After mod_security Install
SERVER AND DNS
all websites under server.rootshosting.net appear to be down

I'm not sure what you can see from where you are, but from here all url display "fail to connect message"

it was all good yesterday and I didn't make any modification since last time i saw it all good

Read more...
 
DNS zones issues tutorial and troubleshooting with host company
SERVER AND DNS

Hi,

I'm going through "edit dns zone" in whm and eventhough I'm not clever with dns settings, I can see that there are many unusual things that should be corrected, I'd like to do it myself so i stop to bother you with it but dont want to make a mess of things:

Read more...
 
Mail Issues and Troubleshooting: online mailer problem
EMAIL / MX / Spam

hi,

I got a customer complaining that his mailbox  is not functionning properly anymore

it was ok 3 or 4 days ago...

now the mail forms dont' work and I tried to go online and send a mail with the HORDE system and got the following message:

Read more...
 
Joomla change files and folders chmod to 755 and 644 with ssh commands
JOOMLA, Integration, Security

I did that operation several times to make sure and here is what happens:

brand new installation of application joomla 1.5. all is ok

i run command through ssh (from inside public_html): chmod -R 755 *

after I do that all the files in folder /public_html/includes/js/jscalendar-1.0/ go with ownership 0000 and become unwritable/undeletable/

Read more...
 
Issues with Ajax on Apache VPS Centos 4??
HOSTING ISSUES

hi,

I'm working with a developper and he's installed some ajax calendar which work fine on local but not at all on the server

he's been trying all day to fix it from script side but ... nothing...

Read more...
 
Setting Up VPS for Joomla and Making Migration, Tutorial and Advises
JOOMLA, Integration, Security

Hi,

Now migration of all websites is made and I have several problems that I'd like to ask you advise with.

I hope somebody can bear with me for final VPS setup to have my websites work 100% as they were on shared.

1st and main problem I have is: eventhough suexec is installed

(if I understood you properly suexec allow me to work joomla with folder755 file644),

I still have many scripts that can't function properly with folder755 file644, most of them require 777 still...

I appears that this issue affects mainly galleries but other scripts as well.

Read more...
 
Problems with Subdomains after Migration
SERVER AND DNS

hi,

several days ago i had problems with subdomains on website bookhostelbook.com and that problem was solved

but today some of the subdomains that I re-created are down (at least one traveldirectory.bookhostelbook.com)

I re-entered redirection / deleted and re-created it sveral times, with or without trailing "/"... but it's not working whatever setting I try and I think I tried all possibilities

Read more...
 
Shell Commands to Protect Directories / Use Cpanel
SERVER AND DNS

hi,

I'm trying to get familiar with VPS and right now I'm working on trying to setup passwords for some critical directories

in order to do that I'm trying to understand about the function htpasswd which seems to be a basic but I keep on getting

Read more...
 
my websites and cpanel are down
HOSTING ISSUES
Posted On: 01 Mar 2007 01:52 PM
Hi,
1. I cant access my cpanel
2. my websites are down. www.bookhostelbook.com and www.reggaeguesthouse.com
,rootsreggaeclub.com appears to be working properly. I havn't made any
significant modification recently

Error message is:
Forbidden
You don't have permission to access / on this server.

Additionally, a 403 Forbidden error was encountered while trying to use an
ErrorDocument to handle the request.
Read more...
 
location of sendmail executable
EMAIL / MX / Spam
osted On: 11 Oct 2007 02:39 PM
hi,
I am setting up a program that is asking me "location of your sendmail executable"
It's supposed to be located at " /usr/sbin/sendmail" but i am unable to lacate it
Read more...
 
.htaccess
HOSTING ISSUES

Posted On: 24 Oct 2007 12:48 AM
Hi,

I installed a component on a software and my whole website went down, even the main url. before i work on it, i'd like to know if it's coming from my software (in which case it's not ur problem :) or if something went wrong on the hosting server side

Read more...
 
« StartPrev12NextEnd »

Page 1 of 2
Featured Links:
Hotel-Web-Designer, internet solutions for hotels and resorts, web design, hosting, promotion, online reservation system, internet marketing consulting