Not Acceptable An appropriate representation of the requested resource could not be found on this server. 406 Error in DirectAdmin
That would be because false-positive ModSecurity rules are being hit. You may either try changing ModSecurity ruleset or disabling ModSecurity altogether, for example, to change ModSecurity ruleset from owasp to comodo, execute the following commands:
./build set modsecurity yes
./build set modsecurity_ruleset comodo
Additionally you might need to run For Apache
How to Disabled ModSecurity altogether
./build set modsecurity no
./build set modsecurity_ruleset comodo
With over 70% of all attacks now carried out over the web application level, organizations need every help they can get in making their systems secure. Besides ModSecurity antivirus can help to reduce malware. For linux server ClamAV/Maldet antivirus enough good. You can follow the post
“How to install ClamAV antivirus on DirectAdmin Linux server”
“How to install ClamAV antivirus on DirectAdmin Linux server and scan public_html folder”
Web application firewalls are deployed to establish an external security layer that increases the protection level, detects and prevents attacks before they reach web-based software programs.
ModSecurity is an open-source web-based firewall application (or WAF) supported by different web servers: Apache, Nginx and IIS.
The module is configured to protect web applications from various attacks. ModSecurity supports flexible rule engine to perform both simple and complex operations. It comes with a Core Rule Set (CRS) which has various rules for:
cross website scripting
bad user agents
To enable ModSecurity:
cd /usr/local/directadmin/custombuild ./build set modsecurity yes ./build set modsecurity_ruleset owasp ./build modsecurity
In this article, i will explain how to solve “failed to mount /etc/fstab” boot error in Linux. The file in question contains descriptive information concerning the filesystems the system can mount automatically at boot time.
This information is static and is read by other programs on the system such as mount, umount, dump and fsck. It has six important filesystem mount specification fields: the first field describes the block special device or remote filesystem to be mounted, the second field defines the mount point for the filesystem and the third specifies the filesystem type.
The fourth field defines the mount options associated with the filesystem, and the fifth field is read by dump tool. The last field is used by fsck tool to establish the order of filesystem-checks.
After editing the /etc/fstab to create an automount and rebooting my system; it booted into emergency mode showing the error message below.
Linux Emergency Mode
I logged in as root from the interface above, and typed the following command to look through the systemd journal; then I saw the errors shown in the screen shot (indicated using red).
As you can see, the main error (failure of etc-fstab.mount unit) lead to several other errors (systemd unit dependency issues) such as failure of local-fs.target, rhel-autorelabel-mark.service etc.
# journalctl -xb
Boot Error Messages
Causes of “failed to mount /etc/fstab” Error in Linux
The error above may result from any of the issues below, in the /etc/fstab file:
missing /etc/fstab file
wrong specification of filesystem mount options,
failing mount points or
unrecognized characters in the file.
To solve it, you can use the original file if you created a backup, otherwise comment out any changes you made using the “#” character (and also ensure that all the uncommented lines are filesystem mount lines).
So I opened the /etc/fstab using vi/vim/nano text editor to check for any errors.
# vi /etc/fstab
Linux /etc/fstab File
I realized I had typed an “r” letter at the beginning of the file as shown in the screen shot above – this was recognized by the system as a special device which did not actually exist in the filesystem, thus resulting to the sequential errors shown above.
This took me several hours before noticing and fixing it. So I had to remove the letter, commented out the first line in the file, closed and saved it. After running a reboot, the system booted well again.
How to Avoid Such Issues in the Future
To avoid encountering such issues on your system, take note of the following:
Always create a backup of your config files before editing them. In case of any errors in your configs, you can revert to the default/working file.
# cp /etc/fstab /etc/fstab.orig
Secondly, check config files for any errors before saving them, certain applications offer utilities to check syntax of config files before running the application. Use these utilities where possible.
However, if you happen to get any system errors messages:
First look through the systemd journal using the journalctl utility to determine what exactly caused them:
# journal -xb
If you can’t resolve the errors in one way or the other, run to any of the millions of Linux forums on the web and post the issue there.
Single User Mode (sometimes known as Maintenance Mode) is a mode in Unix-like operating systems such as Linux operate, where a handful of services are started at system boot for basic functionality to enable a single superuser perform certain critical tasks.
It is runlevel 1 under system SysV init, and runlevel1.target or rescue.target in systemd. Importantly, the services, if any, started at this runlevel/target varies by distribution. It’s generally useful for maintenance or emergency repairs (since it doesn’t offer any network services at all), when a computer is not capable of normal operations.
Some of the low-level repairs include running such as fsck of damaged disk partitions, reset root password if you have lost it, fix “failed to mount /etc/fstab” error – just to mention the most critical of them. And also when the system fails to boot normally.
In this tutorial, we will describe how to boot into single user mode on CentOS 7. Note that practically this will help you enter the emergency mode and access an emergency shell.
How to Boot into Single User Mode
1. First restart your CentOS 7 machine, once boot process starts, wait for the GRUB boot menu to appear as shown in the screen shot below.
2. Next, select your Kernel version from the grub menu item and press e key to edit the first boot option. Now use the Down arrow key to find the kernel line (starts with “linux16“), then change the argument ro to rw init=/sysroot/bin/sh as shown in the screen shot below.
3. Once you have finished the task in the previous step, press Ctrl-X or F10 to boot into single user mode (access an emergency shell).
4. Now mount root (/) filesystem using the following command.
At this point, you can perform all the necessary low-level system maintenance tasks. Once you are done, reboot the system using this command.
CentOS7 is root password changing is totally different from CentOS 6. Now I going to show you how to reset root password in CentOS 7. This way also working for Citrix Xenserver Virtual Machine, KVM and other’s Virtual Machine platform. Even you can reset CentOS 7 password, if your server going to Emergency Maintenance mode.
Step 1: In the boot grub menu select option to edit
Step 2: Go to the line of Linux 16 and find out ro
Step 3: Now change ro with rw init=/sysroot/bin/sh
Step 4: Now press Control+x to start on single user mode
Are you looking to move WordPress from HTTP to HTTPS and install an SSL certificate on your website? We have been getting a lot of requests on this topic because Google announced that Chrome browser will start marking all websites without SSL as insecure starting July 2018. In this article, we will show you how to properly move WordPress from HTTP to HTTPs by adding a SSL certificate.
Don’t worry, if you have no idea what SSL or HTTPS is. We’re going to explain that as well.
What is HTTPS?
HTTPS or Secure HTTP is an encryption method that secures the connection between users’ browser and your server. This makes it harder for hackers to eavesdrop on the connection.
Every day we share our personal information with different websites whether it’s making a purchase or simply logging in.
In order to protect the data transfer, a secure connection needs to be created.
That’s when SSL and HTTPS come in.
Each site is issued a unique SSL certificate for identification purposes. If a server is pretending to be on HTTPS, and its certificate doesn’t match, then most modern browsers will warn the user from connecting to the website.
Now you are probably wondering, why do I need to move my WordPress site from HTTP to HTTPS specially if it’s a simple blog or small business website that doesn’t collect any payments.
Why do you need HTTPS and SSL?
Last year Google announced a plan to improve overall web security by encouraging website owners to make the switch from HTTP to HTTPS. As part of this plan, their popular Chrome web browser would mark all websites without a SSL certificate as “Not Secure” starting July 2018.
As part of the announcement, Google also said that websites with SSL will also see SEO benefits and higher rankings. Since last year, a large number of websites have switched from HTTP to HTTPS.
Google has been slowly rolling out the “Not Secure” warning in Chrome. For example, if someone visits a HTTP website using the incognito window, it will be marked as Not Secure. If someone visits a HTTP website on regular mode and tries to fill out a contact form or another form, then the website will be marked as insecure.
When your readers and customers see this notice, it gives them a bad impression for your business.
This is why all websites need to move form HTTP to HTTPS and install SSL immediately.
Not to mention, if you want to accept payments online on your eCommerce website, then you need SSL.
Most payment companies like Stripe, PayPal Pro, Authorize.net, etc will require you to have a secure connection before accepting payments.
For more details, see our guide on how to get a free SSL certificatefor your WordPress website.
If your hosting company does not offer a free SSL certificate, then you’ll need to purchase an SSL certificate.
We recommend using idatahost.com because they offer the best SSL deal for both regular and wildcard SSL certificates.
By purchasing a SSL certificate from them, you also get a TrustLogo site seal for your website.
Once you have purchased an SSL certificate, you will need to ask your hosting provider to install it for you.
Setting up WordPress to Use SSL and HTTPs
After you have enabled SSL certificate on your domain name, you will need to set up WordPress to use SSL and HTTPs protocols on your website.
We will show you two methods to do that, and you can choose one that best fits your need.
Method 1: Setup SSL/HTTPS in WordPress Using a Plugin
This method is easier and is recommended for beginners.
First, you need to install and activate the Really Simple SSL plugin.
Upon activation, you need to visit Settings » SSL page. The plugin will automatically detect your SSL certificate, and it will set up your WordPress site to use HTTPs.
The plugin will take care of everything including the mixed content errors. Here’s what the plugin does behind the scenes:
Check SSL certificate
Set WordPress to use https in URLs
Set up redirects from HTTP to HTTPs
Look for URLs in your content still loading from insecure HTTP sources and attempt to fix them.
Note: The plugin attempts to fix mixed content errors by using output buffering technique. It can have a negative performance impact because it’s replacing content on the site as the page is being loaded. This impact is only seen on first-page load, and it should be minimal if you are using a caching plugin.
While the plugin says you can keep SSL and safely deactivate the plugin, it’s not 100% true. You will have to leave the plugin active at all times because deactivating the plugin will bring back mixed content errors.
Method 2: Setup SSL/HTTPS in WordPress Manually
This method requires you to troubleshoot issues manually and edit WordPress files. However this is a permanent and more performance optimized solution. This is what we’re using on WPBeginner.
If you find this method difficult, then you can hire a WordPress developer or use the first method instead.
Once you do this, your website is now fully setup to use SSL / HTTPS, but you will still encounter mixed content errors.
These errors are caused by sources (images, scripts, or stylesheets) that are still loading using the insecure HTTP protocol in the URLs. If that is the case, then you will not be able to see a secure padlock icon in your website’s address bar.
Many modern browsers will automatically block unsafe scripts and resources. You may see a padlock icon but with a notification about it in your browser’s address bar.
You can find out which content is served through insecure protocol by using the Inspect tool. The mixed content error will be displayed as a warning in the console with details for each mixed content item.
You will notice that most URLs are images, iframes, and image galleries while some are scripts and stylesheets loaded by your WordPress plugins and themes.
Fixing Mixed Content in WordPress Database
Majority of the incorrect URLs will be images, files, embeds, and other data stored in your WordPress database. Let’s fix them first.
All what you need to do is find all mentions of your old website URL in the database that started with http and replace it with your new website URL that starts with https.
Upon activation, you need to visit Tools » Better Search Replace page. Under the ‘Search’ field, you need to add your website URL with http. After that, add your website URL with https under the ‘Replace’ field.
Below that, you will see all your WordPress database tables. You need to select all of them to run a thorough check.
Lastly, you need to uncheck the box next to ‘Run as dry run?’ option, and then click on ‘Run Search/Replace’ button.
The plugin will now search your WordPress database for URLs starting with http and will replace them with secure https URLs. It may take a while depending on your WordPress database size.
Fixing Mixed Content Errors in WordPress Theme
Another common culprit causing mixed content error is your WordPress theme. Any decent WordPress theme following WordPress coding standards will not cause this issue.
First, you will need to use your browser’s Inspect tool to find the resources and where they are loading from.
After that, you will need to find them in your WordPress theme and replace them with https. This will be a little difficult for most beginners, as you will not be able to see which theme files contain these URLs.
Fixing Mixed Content Errors Caused by Plugins
Some mixed content resources will be loaded by WordPress plugins. Any WordPress plugin following WordPress coding standards will not cause mixed content errors.
We don’t recommend editing WordPress plugin files. Instead, you need to reach out to the plugin author and let them know. If they do not respond or are unable to fix it, then you need to find a suitable alternate.
Note: If for some reason, you’re still encountering mixed content error, then we recommend using the Really Simple SSL plugin temporarily, so your users are not impacted while you fix the issue on a staging website or hire a developer.
Submit Your HTTPS Site to Google Search Console
Search engines like Google consider https and http as two different websites. This means you will need to let Google know that your website has moved to avoid any SEO issues.
To do that, you just need to go to your Google Search Console account and click on ‘Add a Property’ button.
This will bring up a popup where you need to add your website’s new https address.
After that, Google will ask you to verify ownership of your website. There are several ways to do that, select any method and you will instructions to verify your site.
Once your site is verified, Google will start showing your search console reports here.
You also need to make sure that both the https and http versions are added in your Search Console.
This tells Google that you want the https version of your website to be treated as the primary version. Combined with the 301 redirects that you setup earlier, Google will transfer your search rankings to the https version of your website, and you will most likely see improvements in your search rankings.
We know that we did when switched our websites from http to https.
We hope this article helped you add HTTPS and SSL in WordPress.
This tutorial explains a simple, straightforward method for migrating cPanel accounts from one server to another. You can use this method to transfer accounts from an old server to a new one, help customers from another host move to your host, etc.
Requirements: – cPanel on both servers – WHM access on the new server (one that the accounts are being moved to)
Definitions The server you are transferring the accounts from = “old server” The server you are transferring the accounts to = “new server”
Instructions 1. Log into WHM of your new server and create a new account called “restore”, or anything you like for that matter. Remember the FTP IP address, username (‘restore’, in this example), and account password. We will need these for later.
2. Log into the cPanel account you are wanting to transfer on the old server.
3. Click on “Backup >> Generate/Download a Full Backup”.
4. Once here, select the backup destination to be “Remote FTP Server (passive mode transfer)”.
5. Enter your email address for verification, followed by all of the FTP account information for “restore”, which we created on the new server.
-Remote Server: new server’s IP address -Remote User: restore -Remote Password: restore’s password -Port: 21 -Remote Dir :www
Then, click “Generate Backup”. This may take some time to backup the files, depending on how large the account is. You should receive an email provided in the above info once it is complete. If you have more accounts to backup please start with step 2 and repeat it.
NOTE : You do not have to create separate new accounts for each backup. You can use the one you have created.
You can enable the SSH access from your cPanel -> Advanced Section -> SSH/Shell Access.
Once you open the corresponding section, you can generate a new pair of SSH keys. You will need these keys in order to configure an SSH connection from your local computer to the server. The public key is saved on the server and you will have to insert the private in your local SSH software.
You should enter your first name, last name and e-mail account. You can generate a random pass phrase or enter a chosen one. Write it down. You will need it in order to establish the SSH connection. In the Allowed IP address field set the IP from which you want to establish the SSH connection. You can find it once you open the http://whatismyip.com/ URL in your web browser.
Once you are ready, click on the Generate button.
If you already have an SSH pair, you can directly paste the public key in the Public Key text window. Enter the Allowed IP address and Upload button.
In the Manage Current keys section you can view the details for the allowed SSH connections. You can check the corresponding comments, a part of the public key and the allowed IPs.
You can remove all the SSH keys or just a chosen one.
You can add more IPs through the Add IP link. Paste the new IP in the visualized field and click on the Add IP button.
By clicking on the Private Key link you will see the DSA Private Key. It is required in the client’s SSH software in order to proceed with the SSH connection.
In the Useful Resources section you will find links to our Knowledge Base. Following them you will learn how to establish an SSH connection through Windows, Linux and MacOS.