Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create a desktop working environment after installing CentOS 7 Minimal

2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to create a desktop working environment after installing CentOS 7 Minimal. I hope you will get something after reading this article. Let's discuss it together.

After installing CentOS 7 Minimal, build a desktop work environment from scratch

The solution to the non-booting of CentOS 7 DVD version installed on U disk

Change the root password

SSH login

Add regular users other than root

After installing CentOS 7, the previously installed win7 or other systems do not appear in the startup item.

Start the desktop environment

Sets whether to start the desktop environment by default

There is no solution for ifconfig command

Network configuration

The DNS tool is the same as Windows

Install third-party sources (EPEL and RPMForge)

Install the C++ compiler

Mount the NTFS file system

Install VirtualBox

Install the Markdown parser (python-markdown)

Install Flash Player

Install wkhtmltopdf

Install MPlayer

Configure GoAgent

Install configuration Management Git

Install configuration Management Apache HTTP Server (httpd)

Install configuration Management MySQL (MariaDB)

Install configuration Management PHP

Linux (Yum system) commonly used compression and packaging commands

Yum and RPM common command memo

Make bash script

Hard Link (hard link)

Symbolic Link (symbolic links, soft links)

Find a file

Common profile

The solution to change the default home directory of the Aptana Rubles folder

GNOME configuration

The solution to the non-booting of CentOS 7 DVD version installed on U disk

After burning the DVD version of iso to a U disk with UltraISO, delete the packages folder (save space, or delete it), copy the iso file into the root directory of the U disk, and appear after boot.

Dracut:/#

Enter a command

$cd dev$ ls

Find the drive letter of the USB drive, such as sda5, then reboot, press the direction key to select the first item Install CentOS 7, press the Tab key, and appear

Vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\ x207\ x20x86_64 quiet

Modify to

Vmlinuz initrd=initrd.img repo=hd:/dev/sda5:/ quiet changes root password

Log in to shell,Alt+ (F1~F6) with your root account to switch tty1~tty6.

# passwdSSH login $ssh root@SERVER_IP_ADDRESS adds regular users other than root # after useradd newusername# passwd newusername installs CentOS 7, the previously installed win7 or other systems do not appear in the startup item

Add in / boot/grub2/grub.cfg

Menuentry 'Windows 7 Professional' {set root= (hd0,1) chainloader + 1}

(hd0,1) represents the first partition.

Install GNOME Desktop Environment # yum grouplist# yum groupinstall "GNOME Desktop"

CentOS 6.x is different from CentOS 7's yum group, which is required for CentOS 6.x

# yum groupinstall "X Window System"Desktop"Chinese Support" launch the desktop environment # whether the startx setting starts the desktop environment $vi / etc/inittab by default

The / etc/inittab file explicitly declares inittab is no longer used when using systemd and instructs you how to do it in a systemd way.

# systemctl get-default# systemctl set-default multi-user.target# systemctl set-default graphical.target does not have a solution to the ifconfig command

If the desktop environment is not installed, the minimal version does not have the ifconfig command.

Find out which package provides the ifconfig command

# yum provides ifconfig

Or

# yum whatprovides ifconfig

You can see in the output that the net-tools package provides the ifconfig command.

# yum install net-tools Network configuration $ifconfig-a # ifconfig enp0s3 up / / enable enp0s3 Network Card # ifconfig enp0s3 down / / close enp0s3 Network Card $dhclient enp0s3 / / send DHCP request DNS tool is the same as Windows $nslookup install third-party sources (EPEL and RPMForge)

The official CentOS documentation states that EPEL is highly recommended and RPMForge is not recommended because RPMForge is no longer maintained, although it has been recommended by CentOS.

EPEL

Official website http://fedoraproject.org/wiki/EPEL

EL7 download address http://download.fedoraproject.org/pub/epel/7/x86_64/repoview/epel-release.html

# rpm-ivh epel-release-7-5.noarch.rpm

The repo file for EPEL is already in the directory / etc/yum.repos.d/.

RPMForge

Official website http://repoforge.org/

EL7 download address http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

# rpm-ivh rpmforge-release-0.5.3-1.el7.rf.x86_64.rpm

The repo file for RPMForge is already in the directory / etc/yum.repos.d/.

Install the C++ compiler # yum install gcc-c++ mount the NTFS file system

CentOS does not have a package that supports NTFS in its own source, so it needs to be installed from the EPEL or RPMForge (also known as RepoForge) source.

# yum install ntfs-3g-enablerepo=epel

Or

# yum install fuse-ntfs-3g-- enablerepo=rpmforge installs VirtualBox

VirtualBox needs to compile the kernel, so you need the kernel-devel package.

# yum install kernel-devel# yum localinstall * .rpm

For cases where VirtualBox can only hold 32-bit systems, it is related to whether the CPU of Host supports virtualization and whether virtualization is enabled. If it is not enabled, it is set in BIOS, which is generally in the sub-settings of CPU, and contains the words "Virtualization" or "Virtual". Set it to Enable.

Install the Markdown parser (python-markdown)

There are many Markdown parsers under Linux, and python-markdown is found in CentoOS's official Yum source (extras).

# yum install python-markdown

The command name of python-markdown is markdown_py. Check the help.

$markdown_py-h

It is easy to use, exemplified and used as memos.

Parse * .md and output the html content to stdout.

$markdown_py * .md

Parse * .md and output html content to * .html using redirection.

$markdown_py * .md > * .html

Instead of using redirection, you can use the-f option of the markdown_py command to output the html content to * .html.

$markdown_py-f * .html * .md

The-o option is used to specify the output format of the html after parsing, which can be html5, html4, and xhtml1, with the default xhtml1, so it is best to specify the-o option explicitly.

$markdown_py-o html5 * .md > * .html

Install Flash Player

Download yum installation package from adobe official website

# rpm-ivh * .rpm# yum install flash-plugin-- enablerepo=adobe-linux-x86_64

Download rpm installation package from adobe official website

# rpm-ivh * .rpm

Using RPMforge

# yum install flash-plugin-enablerepo=rpmforge

Install wkhtmltopdf

There is no smplayer for CentOS 7 in the repo of RPMforge (now called RepoForge), so you need to install the source code.

The following three things are usually required to install MPlayer:

Source code (source code tarball file)

Binary codecs (a bunch of binary decoder files)

A skin (skin)

Download source code on the official website.

$. / configure-enable-gui-language=zh_CN-disable-ossaudio

Enable-gui tells configure that you need a graphical interface to run MPlayer later, not just from command line.

Language=zh_CN tells configure to install the Chinese environment.

-- disable-ossaudio is due to the fact that the future kernel of linux2.4 gradually abandoned the oss audio architecture and switched to alsa (for more information, please see http://blog.csdn.net/meizum10/article/details/17437959).

Prompt No FFmpeg checkout, press enter to download one with git or CTRL+C to abort, press enter.

Configure usually fails because some dependencies are required. It tells you to install what is missing.

Tip. / configure: line 1522: git: command not found Failed to get a FFmpeg checkout,configure needs to use git to download ffmpeg, and if git is not installed, install git.

# yum install git

Prompt Error: Compiler is not functioning correctly. Check your installation and custom CFLAGS., source code compilation installation of course requires gcc, if not installed, then install it. Gmail + depends on gcc, so to save trouble in the future, simply install Gmail +.

# yum install gcc-c++

Prompt Error: yasm not found, use-- yasm='' if you really want to compile without, lack of yasm, go to the yasm official website http://yasm.tortall.net to download the source code tarball, simple three steps:

$. / configure$ make$ su# make install

In function avcodec_register_all' prompts Error: The GUI requires X11.`, lack of X11jinyum to install gtk2-devel, be careful not to install gtk2-devel,gtk3-devel.

# yum install gtk2-devel

Configure passed, then

$make$ su# make install

OK, installation is complete, run mplayer media file name in command line can generally be played.

Download binary codecs on the official website, which is a tarball, decompress it, get a bunch of decoder files, and put these decoder files in / usr/local/lib/codecs/. If there is no codecs folder under / usr/local/lib/, create one manually.

Download the skin file (I installed clearplayer) on the official website, which is a tarball, unzip it, get a folder, put this folder in / usr/local/share/mplayer/skins/, and then set up a symbolic link called default to point to the skin folder.

# ln-s default

Of course, you can also change the folder name directly to default.

If there is no sound in the playback, do this:

# yum install * alsa*

Installed a bunch of alsa-related stuff.

As for CentOS 6.x CentOS RPM forge (now called RepoForge), smplayer is included in the repo of RPM 6.x, so it is installed directly by yum.

# yum install smplayer-- enablerepo=rpmforge configure GoAgent

Server upload:

$python server/uploader.py / / linux & mac double-click server/uploader.bat / / windows

The client runs:

$python local/proxy.py / / linux & mac double-click local/goagent.exe / / windows

Firefox and Opera need to import certificates.

For CentOS 6.x:

# yum install centos-release-SCL# yum install python27

Create the file python27.conf in the / etc/ld.so.conf.d/ folder with the content / opt/rh/python27/root/usr/lib64.

# ldconfig / / load configuration $/ opt/rh/python27/root/usr/bin/python proxy.py installation configuration management Git installation # yum install gitgit config

After installation, you need to configure user name and user email with git config, otherwise you cannot commit.

$git config-global user.email "you@example.com" $git config-global user.name "Your Name" $git config-list

There are three options for git config, corresponding to different profiles.

-- system / etc/gitconfig

-global ~ / .gitconfig

No option .git / config

SSH KEY

In order to use the SSH keys function of GitHub, use the ssh-keygen tool to generate rsa key pairs locally.

$ssh-keygen-t rsa-C "your_email@example.com" / / generate a rsa key pair in the file ~ / .ssh/id_rsa & ~ / .ssh/id_rsa.pub$ ssh-keygen-p / / adding or changing a passphrase.gitignore

Various types of gitignore template https://github.com/github/gitignore.

# this is a comment * .an ignores documents ending at .an in all directories! lib.a but not lib.a documents *. [oa] ignore documents ending in .an or .o in all directories * ~ ignore documents ending in all directories TODO ignores TODO documents in all directories / TODO only ignores TODO documents in the root directory build/ ignores build folders / build/ only in all directories Ignore only the build folder in the root directory doc/**/*.txt ignores all .txt document asterisks under the doc folder * matches zero or more arbitrary characters [abc] matches any character listed in square brackets (this example either matches a Either match a b or match a c) question mark? Match only one arbitrary character if two characters are separated by a dash in square brackets, it means that all characters in the range of these two characters can match For example, [0-9] indicates that the common command $git init$ git add * $git commit-m 'message'$ git status$ git status-s $git status-- short$ git diff$ git clone git@github.com:who/whatrepo.git$ git clone https://github.com/who/whatrepo$ git clone https://github.com/who/whatrepo SpecifiedFolder$ git remote$ git remote- v$ git remote add [shortname] [url] $git remote rm [remote-name] $git Remote rename [old-name] [new-name] $git remote fetch [remote-name] $git push [remote-name] [branch-name] $git pull installation configuration Management Apache HTTP Server (httpd) installation # yum install httpd Management

Under Windows, httpd runs as a system service, and under Unix (Linux), httpd runs as a daemon (daemon).

The official httpd documentation recommends apachectl as the script to call the httpd executable, because apachectl will first set some environment variables necessary to ensure the correct operation of httpd, and then call the httpd executable, and apachectl will pass the command line parameters to httpd intact.

Apachectl is the front end of httpd daemon. So administrators should use apachectl to manage httpd daemon.

Apachectl is available under both CentOS 6.x and CentOS 7.

# apachectl start# apachectl stop or graceful-stop# apachectl restart or graceful# apachectl status

If you don't use apachectl as script, you can also use service as a command to manage daemon.

# service httpd start# service httpd stop# service httpd restart# service httpd status

If the system supports systemd (CentOS 7 starts supporting systemd), you can use either the service command or systemd.

# systemctl start httpd.service# systemctl stop httpd.service# systemctl restart httpd.service# systemctl status httpd.service# systemctl is-active httpd.service sets boot to start automatically

To set up automatic boot httpd, you need to distinguish between CentOS 6.x and CentOS 7.

CentOS 6.x doesn't have systemd, and my favorite way is to modify the / etc/rc.d/rc.local file.

# vi / etc/rc.d/rc.local

Add the following command.

/ usr/sbin/apachectl start

CentOS 7 uses systemd.

# systemctl enable httpd.service# systemctl disable httpd.service understands and sets up virtual hosts

The main configuration file for httpd is / etc/httpd/conf/httpd.conf. As long as the files under the directory / etc/httpd/conf.d/ have the .conf extension, their contents can be integrated into the main configuration file. So try not to modify the main configuration file directly, but under the directory / etc/httpd/conf.d/.

Httpd official documentation divides Virtual Host (virtual hosting) into two categories: IP-based and Name-based.

My understanding is:

If you put a block in the configuration file, you will configure one Virtual Host, and if you put two, you will configure two. The IP address and port need to be specified in the starting tag, that is, in this case, the IP can be *, and the port can be left unwritten.

When a request arrives, the block is matched one by one according to the IP address and port in the order in the configuration file. If none of the block matches, consult the instructions in the main configuration file. Once some block matches, only the block on these matches can be candidates for request, and there is no chance for other block, including the main configuration file.

If there is only one candidate, then there is no choice, it is you. And if there are multiple candidates, how to choose?

It depends on the ServerName and ServerAlias in block to indicate that whoever's ServerName and ServerAlias match the header's Host of request's HTTP message, then he will win. If multiple block matches, then come first and arrive later, and who will win in front. If none of them match, then come first and arrive later.

Listen 80 DocumentRoot / var/www/html ServerName www.example.com ServerAlias example.com AllowOverride All

The role of AllowOverride All is to make .htaccess files in the web directory work, and is often used to open Drupal's concise URL.

If VirtualHost specifies a port, you need to write the Listen instruction, because only when you tell httpd to listen on a port can request enter a VirtualHost through that port. The httpd master configuration file has been configured with Listen 80 by default, so if VirtualHost specifies port 80, there is no need for this instruction to listen on port 80. The repeated instructions in the configuration file do not conform to the syntax.

Install configuration Management MySQL (MariaDB) installation

MySQL

# yum install mysql-server

MariaDB

# yum install mariadb-server

Mysql-server package depends on mysql package, so there's no need to do this: yum install mysql mysql-server.

Manage MySQL# service mysqld start# service mysqld stop# service mysqld restart# service mysqld statusMariaDB# service mariadb start# service mariadb stop# service mariadb restart# service mariadb status

You can also use systemd.

# systemctl start mariadb.service# systemctl stop mariadb.service# systemctl restart mariadb.service# systemctl status mariadb.service# systemctl is-active mariadb.service configuration # mysql_secure_installation

Or

# mysqladmin-u root password''set MySQL# vi / etc/rc.d/rc.local to start automatically on the boot

Add the following command

/ usr/sbin/service mysqld startMariaDB# systemctl enable mariadb.service# systemctl disable mariadb.service login $mysql-hhost-Pport-Ddatabase-uusername-p common commands after login > create database if not exists * default character set utf8; > show databases; > use *; > show tables; installation configuration management PHP installation # yum install php

It is often not enough to install PHP; you usually need to install modules.

# yum install php-mysql# yum install php-gd# yum install php-xml# yum install php-mbstring configuration

PHP profile

/ etc/php.int

Usually you need to change the configuration file.

Upload_max_filesize = 2MLinux (Yum series) commonly used compression and packaging commands

.tar.gz

$tar xzvf * .tar.gz$ tar czvf * .tar.gz file1 file2

.tar.bz2

$tar xjvf * .tar.bz2 $tar cjvf * .tar.bz2 file1 file2

.tar.xz

$tar xJvf * .tar.xz$ tar cJvf * .tar.xz file1 file2

.zip

# yum install zip unzip$ zip * .zip file1 file2 $unzip * .zip

.rar

# yum install rar-- enablerepo=rpmforge$ rar a * .rar file1 file2 $rar x * .rar

.7z

# yum install p7zip-- enablerepo=rpmforge$ 7za a * .7z file1 file2 $7za x * .7zYum and RPM Common Command Memorandum

Yum history

# yum history# yum history list # yum history info # yum history undo # yum history redo

Yum update

# yum clean all# yum makecache# yum update

Rpm installation uninstall

# rpm-ivh * .rpm# rpm-qa# rpm-qa | grep * # rpm-e * # rpm-e *-nodeps create bash script #! / bin/bashwrite cmd line here# commentHard Link (hard link) $ln target_file link_fileSymbolic Link (symbolic link, Soft link) $ln-s target_file link_file lookup file $find /-name "*" Common configuration file / etc/resolv.conf/etc/hosts/etc/inittab/etc/yum.repos.d/~/.config/user-dirs.dirs~/.bash_profile solution to change the Aptana Rubles folder to the home directory by default

In the eclipse.ini file, add after-vmargs

-Dstudio.rubleUserLocation=Aptana RublesGNOME configuration $gnome-tweak-tool after reading this article, I believe you have some understanding of "how to create a desktop working environment after installing CentOS 7 Minimal". If you want to know more about it, please follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 210

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report