CentOS 7 is a Linux distribution that provides a free, enterprise-class, community-supported computing platform functionally compatible with its upstream source, Red Hat Enterprise Linux
You can download OS images at https://www.centos.org/download/
Steps to install CentOS 7
- Install htop on CentOS 7 / CentOS 8
- Install lynx on CentOS 7 / CentOS 8
- Set Hostname on CentOS 7 / CentOS 8
- Set static IP address on CentOS 7 / CentOS 8
- Enable/disable network interface on CentOS 7 / CentOS 8
- Turn SELinux off on CentOS
- Install PHP on CentOS 7
- Set VirtualHost
- Install MySQL 5.7 on CentOS 7
- The default bash scripts useful on CentOS server
- Mount USB mass storage device in exfat on CentOS 7
- vim
Other topics associated with CentOS
-
503 Service Unavailable Error displayed in Apache Reverse Proxy environment — If you see 503 Service Unavailable Error in Apache Reverse Proxy Environment with the perfect settings, it might be something associated with server security - it can be solved by /usr/sbin/setsebool
-
CentOS warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory on CentOS 7 — If you faced an error "cannot change locale (UTF-8)", it can be simply solved to add following lines at /etc/environment
-
Change MySQL port number — The default port that MySQL database server is running under Linux and Unix is 3306/TCP. In order to change the default MySQL/MariaDB database port in Linux, open MySQL server configuration file for editing by issuing the below command.
-
Changing GitLab repository — In order to change the data directory, you need to add git_data_dirs in /etc/gitlab/gitlab.rb
-
Check CPU - is AMD or Intel? — In CentOS 7, CPU information is stored in /proc/cpuinfo, so you can implement to acquire CPU information in the system.
-
Check network port is open or not on CentOS 7 — To check listening port on CentOS 7, you can do it by "netstat" simply, or you can try it by "ss". I was easily able to check which port is open or not on CentOS 7.
-
-
chmod by type (directory and file permission) — To change permission by type (directory or file), the easiest way can do it is using find command and do something as a follow up action.
-
Copy updated/new files if the date is no later than the target in Linux — You can backup the latest updated/new files by cp command in Linux(CentOS 7)
-
Count number of HTTP threads in CLI — You may want to check the traffics in your server prom time to time, and checking CPU and number of threads are actually essential.
-
Count number of process in Linux shell — In some cases, you may want to know the number of processes working in the system. You can know it by grep -ef | grep <process name> | wc -l
-
Count number of processes and do something in PHP — You can limit number of cron jobs, if you use PHP for DevOps software in CentOS 7, which can be easily implemented by checking process by shell_exec.
-
Downgrade PHP from version 7.3 to 7.2 on CentOS — You can downgrade PHP from version 7.3. to 7.2 by yum and yum-config-manager.
-
Enable CORS in httpd.conf — Due to security reason, some platform does not allow to access files on apache web server that is super great feature in order not to make server in-stable, but some device having no domain connection may have no solution when requiring in communicating with such kind of servers. To resolve that issue, you will need to enable CORS in httpd.conf
-
Enable/disable network interface on CentOS 7 / CentOS 8 — Once you are done with network configuration, you need to run nmtui-connect to enable/disable network interface based on your need.
-
Enabling a service on boot in Centos 7 — In case that you have service on /etc/init.d/ but it does not start automatically, you can simply enable it by run chkconfig function.
-
firewalld on CentOS 7 — When the server is directly connected to the internet, the firewall is to be setup for security purpose. On CentOS 7, FirewallD is a kind of minimum requirements in terms of security point of view. You can simply install FirewallD by sudo yum install firealld and add policy by sudo firewall-cmd --zone=public --permanent --add-service=http
-
Force a immediate reboot of a remote linux machine — "reboot" or "shutdown" commands are executed daemons are gracefully stopped and storage volumes unmounted. This is usually accomplished via scripts in the /etc/init.d directory which will wait for each daemon to shut down gracefully before proceeding on to the next one. That environment triggers dead-lock situation when one of the daemons are not closing gracefully. To force the kernel to reboot the system will be adding an additional parameter "-f"
-
-
-
Get local IP Address in PHP on CentOS — The easiest way to get local IP Address in PHP on CentOS is using shell command like "hostname -I". I tried several methods to get it, but most of them returns the wrong answer.
-
How do I check confluence java settings on Centos 7? — If you want to check your java settings on Centos 7, you can simply check by "ps" command.
-
How do I send email on command line in Centos 7? — Unfortunately Centos 7 minimal version does not have mail client running on command line, but you can use it by installing mailx.
-
-
How to check CentOS version? — The simplest way to check CentOS version is reading release information on /etc/centos-release:
-
Increase Number of Open Files Limit in Linux — In Linux, there are some cases that application needs to open multiple files at the same time - probably database like MySQL is one of the cases accessing multiple files at the same time, because MySQL create files for table and its index on the file system, so it will cause opening multiple files at the same time.
-
Install Git 2.x on CentOS 7 — You may want to higher version of Git if you use Visual Studio Code (a.k.a. vscode) - its version will be Git 2.x probably. In that case, you can install by WANDisco repo package easily.
-
Install GitLab Community Edition on CentOS 7 — GitLab is an open source repository manager based on Rails developed by GitLab Inc. It is a web based git repository manager that allows your team collaborate on coding, testing and deploying applications. GitLab provides several features, including wikis, issue tracking, code reviews, and activity feeds. GitLab Community Edition is designed to self-hosted and free, but it does not provide technical supports. GitLab supports not only for CentOS but also other operating system as well.
-
Install htop on CentOS 7 / CentOS 8 — htop is a good option to monitor your system interactively. In order to install htop, you will need to use dnf. If you cannot install htop by yum, you will need to follow following procedure on CentOS 8.
-
Install lynx on CentOS 7 / CentOS 8 — I usually use lynx to check website on my terminal, because and it does not require to be on graphical environment - meaning I can see its content on terminal console. It can be installed by adding PowerTools repository in Yum.
-
Install mod_url to support multi byte characters on CentOS 7 — mod_url enables httpd to support multibyte characters like Korean file, so you can download Korean file (한글파일) from your apache server without any error message. httpd basically does not support it, so you should install mod_url.
-
Install MySQL 5.7 on CentOS 7 — To install MySQL 5.7, you should enable MySQL 5.7 community release yum repository on your system.
-
Install Pandas, NumPy and MatPlotLib on CentOS 7 — For data processing in Python, Pandas and NumPy are super useful. Before installing Pandas and NumPy, you should have pip on your CentOS 7.
-
Install PHP on CentOS 7 — You need to run yum in order to use PHP after setup your CentOS 7. Even though you have httpd, PHP may need to be installed manually. For compatibility with various applications like PHPMyAdmin, PHP-based server management, you will need to install additional libraries.
-
Install the latest version of Python on CentOS 7 — This is the easier method of the two for installing Python on your machine. Here, we simply add a repository that has the pre-compiled version ready for us to install. In this case, we are adding the Inline with Upstream Stable repository, a community project whose goal is to bring new versions of software to RHEL-based systems.
-
Install Tkinter on CentOS 7 — Tkinter is a Python binding to the Tk GUI toolkit. It is the standard Python interface to the Tk GUI toolkit, and is Python's de facto standard GUI.
-
Installing FFmpeg on CentOS 7 — sdsds
-
-
List the current process by CPU occupation rates — ps is useful command to check process. It also supports to check CPU occupation rates.
-
Method to check if OS is 32bit or 64bit on CentOS — To know whether your system is 32-bit or 64-bit, type uname -m
-
Mount remote directory by SSHFS in CentOS 7 — SSHFS is a filesystem client to mount and interact with directories and files located on a remote server or workstation over a normal ssh connection.
-
-
Mount USB mass storage device in exfat on CentOS 7 — To mount USB mass storage device on CentOS 7, you need to add a package repository first and install some exfat utilities.
-
My Centos does not have X Windows, how do I install it? — I haven't installed any graphical interface like X Window on Centos, and found its solution how to install it for my personal purpose. Please take a look below steps to install "Gnome Shell" as a main graphical interface.
-
My confluence server has no response without any errors — If you found that your server shows "Proxy Error" - "Error reading remote server", it might be associated with the system resources or settings.
-
No match for argument: php-mcrypt on CentOS 7 — mcrypt package is not included in the default CentOS repositories. It can be installed from the Remi repository.
-
No match for argument: php-pecl-memcache on CentOS 7 — php-pecl-memcache package is not included in the default CentOS repositories. It can be installed from the Remi repository.
-
No match for argument: php-tidy on CentOS 7 — php-tidy package is not included in the default CentOS repositories. It can be installed from the Remi repository.
-
PPTP Command line setup on CentOS 7 — CentOS provides an PPTP solutions in the repository,
-
ps aux to json — In case that you need to get process status in JSON, you can generate it by awk combined with ps.
-
pstree on CentOS — pstree is useful tool, but it is not a default application when you setup CentOS. So you will need to install it by yum.
-
Reboot server if Google DNS does not respond — The below sh script trigger rebooting server if Google DNS does not respond
-
Redis Installation on CentOS 7 — Redis package is not included in the default CentOS repositories. It can be installed from the Remi repository.
-
-
-
Restore dumped MySQL data on CentOS 7 — Restoring dumped MySQL data is something painful. _restore_mysql.sh enables you to restore the dumped MySQL data easily.
-
-
Run shell commands on remote server in SSH — I wanted to run a specific command through ssh protocol on my server. And this is super helpful to do some kind of remote processing by PHP easily, so I do not need to log on remote server.
-
Run time consuming (background) tasks as post processing with no connection with browser client in PHP — You can flushe all response data to the client and finishes the request to run time consuming tasks with no connection with brower client by fastcgi_finish_request(). This allows for time consuming tasks to be performed without leaving the connection to the client open.
-
Sample DOS Shell scripts to create/run QEMU image — In order to run QEMU Image on Windows, DOS Shell scripts are useful which helps doing the necessary things easily.
-
Set Hostname on CentOS 7 / CentOS 8 — nmtui-hostname is useful command in CentOS 8 which promt you to enter your machine hostname and press OK to finish.
-
Set locale to en_US.utf8 — If you need to change character set to en_US.utf8 or ko_KR.utf8 on CentOS 7, you can change it by localectl r changing locale.conf. Please take a look belows
-
Set static IP address on CentOS 7 / CentOS 8 — CentOS provides a command line tool - mntui-edit - it will help you to change the necessary internet settings easily.
-
Set user in sudoers and run commands with no authentication password in CentOS — You usually need to put password to run commands in sudo. You don't need to put user password if your account belongs to sudoers even though that is not that safer in terms of security point's of view.
-
-
Setup Git server on CentOS 7 — Git is a part of CentOS 7 repository, so you can install it easily by yum.
-
systemd-journald extremely high CPU usage reaching 100% on CentOS — You may want to remove systemd-journald if you faced a case like below situation that reaches 100% of CPU usage by systemd-journald in a limited environment. journald is one of the important service in the linux environment. You can enhance that situation by modifying log level.
-
Turn SELinux off on CentOS — SELinux(Security-Enhanced Linux) is a Linux kernel security module that provides a mechanism for supporting access control security policies, including mandatory access controls. SELinux is a set of kernel modifications and user-space tools that have been added to various Linux distributions.
-
Uncaught RedisException: Permission denied error in your PHP code — When you face an error Uncaught RedisException: Permission denied in your PHP code, you will need to check if that is working normally in the command line but happening in the web page. If it is, that is 100% caused by your linux security policy. In that case, you will need to turn SELinux policy off that located at /etc/selinux/config.
-
Uninstall confluence standard in CentOS 7 — Unfortunately, confluence package does not provide uninstaller, so you need to erase all associated files and settings manually.
-
-
Uploading a large sized file more than 2G — To upload a large sized file more than 2G in PHP, the OS must be based in 64bits instead of 32bits, and you should change some settings in /etc/php.ini and LimitRequestBody=0 in httpd.conf or virtualhost
-
-
When VirtualHost does not work in Apache 2.2 — If you wanted to use VirtualHost, but it shows Testing 123... only, you should check your server configuration. You cam simply check your server if configuration works or not by httpd -S