Linux replace command all files with sed shell command

Scripts, SSH, www

Replace word in all files with sed via linux shell command

To replace string design/nashik to designing/india on the same file textNashik.html
Use the following linux command with the syntax.
sed -i s:design/nashik:designing/india:g textNashik.html

Another Example:
sed -i s:twitter.com/webservices:twitter.com/dnswspl:g home/*.html

Replacing phrase in all files including directories and subdirectories using sed and find

find . -type f -exec sed -i ‘s:ecommerce.html:ecommerce-shopping-cart.html:g’ *.html {} \;

NOTE: ‘:’ used as a substitue for ‘/’ as / is used in search and replace.

Related: Linux Command, Shell Command, Sed Command, Replace Text, Linux Replace

Setup email account on Android Smartphone

Email Hosting, Setup, WebMail

To setup a new email account on your Android or Smartphone…

Select “Add account” from Email tab.
Enter “Email Address”
Enter the password for “Email Address”
Press “Next”

Type of email account
You have the choice to choose the type of account you will be using on your android or smartphone.
POP3: Selecting this type will download and store emails on phone from the server.
IMAP: (Recommended) This will show a cached copy of email on your phone, emails will be stored on server.
Exchange: Exchange type is supported only for MSExchange type of server.

 

Email Account Setup

for Incoming Server Settings
Username: Enter your email address.
Password: Existing Password for your email account.
IMAP server: “mail.yourdomain.com”
Port:
NonSecure(No SSL): 143
Secure (SSL): 993
Security Type: Use “SSL/TLS – Accept all certificates” for best compatibility.
IMAP Path: INBOX (This will allow for you to store your Sent, Drafts and Deleted emails on the server.)

Press Next.

for Outgoing Server Settings
SMTP server: mail.yourdomainname.com
Port:
NonSecure (No SSL): 25 or 26
Secure (SSL): 465
Security Type: “SSL/TLS – Accept all certificates” for best compatibility.
Require sign-in Check this for authentication with the mail server.
Username: Enter email address
Password: Password for email address.

Press Next.

Other Account Options

1. “Inbox Check Frequency” – Every 15 min. You may increase this to 30 to save you on battery.
2. “Notify me when email arrives” – Yes.
3. “Sync emails from this account” – Yes.
4. “Automatically download attachments when connected to wi-fi” – Yes.

Press Next.

Final Screen to finish email account setup
Give a name to your account. (if you have multiple accounts on the one device, it will be better to give name for each email account, Business, personal etc.)
Enter the name (Senders name displayed on outgoing messages) All outgoing emails that you send from this device it will show this name to recipient.

We are Done!

Related: Email Hosting, Email Server, EMail on Mobile Setup

Execute PHP script from cron or command-line

cPanel, PHP, Scripts, SSH, Web-Hosting

Execute PHP script from cron or command-line

One of the method for running PHP scripts from a cron job is run the script using php from the crontab. You will need to call the php script from your crontab as given below.
To execute somescript.php every 1 hour you will need to edit and add below given line in your crontab file:
00 * * * * /usr/local/bin/php /home/someuser/somescript.php

If you are looking for command-line interpreter, then it can be done with the following command. It shows how to run a script using the PHP command-line interpreter:

/usr/local/bin/php -q /home/someuser/public_html/somescript.php
The -q option is for quiet mode, to prevent headers being displayed.

Make a note of code in your PHP script, it may only run correctly if called from a mentioned path. For example, if the script uses relative paths to include files, it will only run if it is called from the specified directory. The following command shows how to run a PHP script from a specific path:

cd /home/username/public_html/; /usr/local/bin/php -q script.php

Related: Dedicated Server, Virtual Server, Web Server Hosting

syslogd klogd warning in firewall

CSF, Dedicated Server, Firewall, Security, SSH, VPS Hosting, Web-Hosting

If you are getting this WARNING message, what you need to do?

Syslogd appears to be running, but not klogd which logs kernel firewall messages to syslog. You should ensure that klogd is running.

How do you enable klogd?

Fire a command:
#whereis klogd
Then simply run klogd with full path:
klogd

Related: Dedicated Servers, VPS Hosting

Find files greater than MB GB size in linux ssh

Dedicated Server, SSH, Virtual Private Server, Web-Hosting

Find files greater than MB GB size in linux ssh. ( Such a helpful ssh command to find big, larger or largest file on server)

The following ssh command will list all the files in the system greater than 200MB.
# find / -type f -size +200M

The following ssh command will list all the files greater than 2GB.
# find / -type f -size +2G

The following ssh command will list all the files greater than 10MB from home folder only.
# find /home -type f -size +10M

Related: Linux SSH, Virtual Server

HTML signature on Webmail Company Logo in Email

Email Hosting, Setup, Shared Hosting, WebMail, www

Creating HTML signature on Webmail, Squirrel, Roundcube Other Mail clients

You must be wondering how people add their company logo in the email signature! Just follow the steps given below and you will be able to add image in your email signature as well!
1. Log in to your webmail
2. Select Roundcube webmail application
3. Click on the Personal Settings on the Right Top Panel
4. Select on Identities Tab.
5. Double Click on the Display name.
6. Click on the HTML editor to enter your HTML signature
7. Click Save after you are done.
8. Go to Preference tab and check on the box for Compose HTML message.
9. Click Save and Done.

If you are not comfortable with the code then you might want to try the below given sample code and customize it as per your requirement:

Your name goes here
Your position goes here
Your Company Name
Your Tag Line
yourname@yourdomainname .com
Your phone number goes here

Your Company Name

You will want to change all the highlighted areas to the appropriate settings for your environment prior to placing in the signature area.

Note: If you are looking for the html signature in ‘SquirrelMail’ then you might get dissapointed as there is no html signature available in ‘Squirrel Webmail’. For html signature, you can start using ‘RoundCube’.

Reboot Server from SSH

Dedicated Server, Security, SSH, Virtual Private Server

Reboot Server from SSH

How to reboot Linux server from ssh? Is it same for local and remote Linux system?

Linux has various ways to reboot a system. It is also known as halt, poweroff, shutdown, init etc.

Coming to the point, rebooting your Linux server from ssh console: The most important thing, you should be logged in as root to reboot the system. Once you are in as root, type any of the following command as per your requirement.

INSTANT REBOOT LINUX SERVER:

# reboot
OR
# /sbin/reboot
OR
# shutdown -r now
OR
# /sbin/shutdown -r now

Want to send a notification to logged in users about this reboot? Then type the following command:
# shutdown -r +2 (This will send the message to all the users that the system is going to reboot in next 2 minutes.)

Related: Linux Server, Linux VPS, Dedicated Server, Private Server

PHP Warning – PHP Startup – Suhosin Extension does not officially support PHP 5.2

cPanel, Dedicated Server, PHP, Security, Setup

PHP Warning: PHP Startup: Suhosin Extension
does not officially support PHP 5.2 and below anymore, because it is
discontinued. Use it at your own risk. in Unknown on line 0

Since the php upgrade, you might have noticed these type of errors in your server logs. Must be wondering a perfect solution for this.

Actually you should be able to use the latest build, however some older scripts or applications might get in trouble, unless they are ready for latest php version. You need not to worry any more, as you have jumped to right place for it. Just follow the below given steps and you will be at rest.

What to do?

Easy enough, downgrade suhosin from 0.9.33 to 0.9.31 :

# remove suhosin from easyapache php config
/usr/local/cpanel/scripts/phpextensionmgr uninstall PHPSuHosin

# download and install older suhosin
wget http://download.suhosin.org/suhosin-0.9.31.tgz
tar zxf suhosin-0.9.31.tgz
cd suhosin-0.9.31
phpize
./configure
make
make install

#open php.ini and add line loading suhosin
vi /usr/local/lib/php.ini

#Add following line into extensions section:
extension=”suhosin.so”

Save and close the file,  restart apache and you are done. You can also verify if everything is ok with the command php -v from the prompt.

Related: Web Server, Virtual Server, PHP Host, cPanel Host

 

Remote server requires Network Level Authentication (NLA)

Dedicated Server, Security, Setup, VPS Hosting, Web-Hosting, Windows Hosting

How to enable RDP access on server requires Network Level Authentication (NLA)

With Remote Desktop (RDP) when connecting to a Windows Server (XP-SP3 or 2003/2008) with newer remote host, you might get an error saying that “The remote computer requires Network Level Authentication (NLA), which your local pc/laptop/desktop computer doesn’t support.”

To enable the RDP access on server requires Network Level Authentication (NLA) you need to follow below given steps [be careful with registry editor, it’s helpful to backup your registry first, you have been warned]:

  1. Install Service Pack 3 [if XP]
  2. Click Start->Run, type regedit and then press enter
  3. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  4. Double click on “Security Packages”, to modify the values, leave all existing values, and just add “tspkg” at the end of the list, click OK to save your changes.
  5. Now, navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders
  6. Double click on “SecurityProviders”, and in the dialog box, add “credssp.dll” at the end, be sure that if the list that is present currently is separated by commas, that you add a comma to the value immediately before the “credssp.dll”. Click OK to update.
  7. Close the registry editor and now restart your computer for changes to take the effect.
  8. Try to RDP to your remote server.

Still, finding it difficult, not to worry, get in touch with one of our technical help expert to assist you further.

Related: Windows Server, Remote Desktop, RDP, Server 2008, Windows XP SP3, Windows VPS

Domain Name – Important Factors about Domain

Domain Name, Web-Hosting, www

Important factors about domain name registration.

A factor by factor quality analysis of the domain name unichost.com, as an example, is given below. Useful for website appraisals, and buying and registering domain names.

1. Length

Unichost is a 8 character word. Shorter words make better domain names. At 8 characters unichost.com should make a good domain name.

2. Dictionary Words

Unichost per-se is not a dictionary word but it contains dictionary words. Domain names with dictionary words generally make better domain names than those without. Recommended tool for keyword analysis – www.deckey.com.

3. Top Level Domain

.com is always the best. Full score for TLD factor. People are more likely to type unichost.com than unichost.bz or unichost.me or unichost.info.

4. Distinctivity

Distinctivity is the most important factor of all. unichost.com has a high distinctivity factor. Users will be able to remember unichost.com without much effort. Good choice for a domain name.

Conclusion:

UnicHost.com scored better than 82.883% of 1984314 domain names in the Domometer database.

Related: Domain registration, Domain hosting, Website Name

 
©2017, All Rights Reserved. Managed-Servers by UnicHost Web Solutions. Powered by UnicHost.
Log in