CentOS 7 resolv.conf make changes permanent

On rebooting CentOS 7 server, changes made to resolv.conf is lost. This is becaise one of the network interface is configured to use DNS server.

To fix, edit

Remove the line

Now NetworkManager will not modify /etc/resolv.conf file on boot.

Or you can set valid DNS servers in network config file like

If your network configuration use DHCP, set set PEERDNS=no.

Another solution is to make file immutable with

Related Posts

Domain Resolver

Install Pure-FTPd on CentOS with Virtual Users

To install Pure-FTPd on CentOS, run

Edit configuration file

To disable anonymous FTP, find

Replace with

To enable Virtual Users, find

Uncomment the line.

To Allow Apache user to login via FTP, find

Replace with

I set MinUID value to 47, as apache user have UID/GID of 48. By setting MinUID below that apache user should be able to login.

Set pureftpd to start on Boot

Restart pure-ftpd

Create a Virual User

To create a virtual user, run

It will ask you to enter password two times.

Now run

Change Password of an existing Virual User

It will ask you to enter new password.

Rebuild password database and restart pure-ftpd with

Related Posts

Install pureftpd on Ubuntu

pureftpd

Install vim from source on CentOS

To install vim from source on CentOS server, run

This will install latest version of vim. You can start it with command

To get it work with “vi” command, i removed preinstalled vim editor with command

Now create a symlink with

OpenLiteSpeed Benchmark

Install OpenLiteSpeed on CentOS

To install OpenLiteSpeed web server on CentOS, install repository for your CentOS version

For CentOS 6

For CentOS 7

For CentOS 8

To install OpenLiteSpeed, run

Before you can install PHP, you need epel repository enabled with

Install PHP with

Set symlink

Start OpenLiteSpeed with

To stop OpenLiteSpeed, run

By default, OpenLiteSpeed will run on port 8088

You can login to Admin Interface at

By default, you see an example application. The configuration file for this is at

Default DocumentRoot is /usr/local/lsws/Example/html. To change, edit file

Find

Replace $VH_ROOT/html/ with whatever path you need. You need to restart OpenLiteSpeed to make the change go live

Set hostname in CentOS 7

Hostname is a sub domain. To set hosting, edit file

Add

Example

Now run

Example

Run

Edit file

Edit or add HOSTNAME entry

Reboot the server with

You can verify hostname with command

Related Posts

Change Server Hostname in VestaCP
Set Permanant hostname on AWS EC2 CentOS 7 server
Install SSL for Cpanel Server Hostname

CentOS 7 VestaCP Upgrade PHP to 7.x

On CentOS 7 VestaCP install PHP 5.6 by default. This is very old version of PHP. To upgrade PHP to latest version 7.x, you can install remi repo.

Install EPEL repo

Install yum-utils

Install remi repo

Select PHP version you need

Here i selected PHP 7.3. You can select differnt PHP versions with commands like.

Make sure you only enable one PHP version. If you enabled a PHP version from remi repo, disable it with

Once you have desired version enabled, run yum upgrade

Or only for PHP, run

Nginx Web Server

Install Nginx on CentOS 8

To install Nginx web server on CentOS 8, create repo

Add

Install nginx with dnf or yum

Open HTTP and HTTPS ports on firewall