Preface
Use Xshell to remotely control centos7 to install the Chrome browser and open an index.html file.
content
Step 1: Install Chrome browser
1. Configure Yum source
在目录 /etc/yum.repos.d/ 下新建文件 google-chrome.repo (利用Xftp)
2. Edit google-chrome.repo
cd /ect/yum.repos.d/
vim google-chrome.repo
3. Write content
[google-chrome]
name=google-chrome
baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub
[Vi extended knowledge]
vi is a text editor under Linux, and Vim is an improved version of vi.
Enter the editor by vim file name
Just enter the editor, it is the normal mode, in this mode, any character input from the keyboard is interpreted as a command. Execute immediately after inputting the command, no need to enter.
In normal mode, enter i to enter edit mode. In this mode, the entered characters will be displayed and regarded as the content of the file. Press esc to return to normal mode.
In normal mode, enter: to enter command mode. In this mode, users can perform advanced processing on files. In this mode, type wq and press Enter to save and exit the editor.
Other exit commands:
q! ———— Do not save the modified content, force exit;
ZZ ———— save and exit;
4. Install chrome browser
yum -y install google-chrome-stable --nogpgcheck
5. Run chrome
Find the chrome installation path
which google-chrome-stable
Make a soft connection, easy to use: xxx represents the path content found by the above command
ln -s xxx /bin/chrome
Install Xvfb
Xvfb is a display server that implements the X11 display service protocol
yum install Xvfb
Restart to take effect
Configure forwarding x11 in xshell.
Start chrome
chrome --no-sandbox
6. After the above command is executed, you may be prompted to download Xmanager.
Click [Yes] to install Xmanager.
7. Open the Index.html file with chrome
chrome --no-sandbox 文件路径
Finally, you can see the browser interface pops up automatically, displaying the content of the html file.
reference
https://blog.csdn.net/zyy247796143/article/details/82143832 (centos install chrome and configure xshell to open remotely)
http://c.biancheng.net/cpp/html/2735.html (Master the use of common commands of the Linux vi editor in 10 minutes)