서버에 리눅스 그래픽모드를 처음 깔았다.
selenium 을 사용하여 데이터를 크롤링하기 위해서는 아무래도 그래픽 모드가 필요했기 때문....
그러다 보니 GUI모드를 원격으로 제어할 수 있는 VNC Server 도 설치..
아래는 그 과정이다.
################################################## 기본설정
## 언어
[root@localhost ~]# vi /etc/locale.conf
LANG="ko_KR.UTF-8"
################################################## VNC Server
yum groupinstall "GNOME Desktop"
yum install tigervnc-server
cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:1.service
vi /etc/systemd/system/vncserver@\:1.service
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
ExecStart=/sbin/runuser -l ecouser -c "/usr/bin/vncserver %i"
PIDFile=/home/ecouser/.vnc/%H%i.pid
ExecStop=/bin/sh -c '/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :'
[Install]
WantedBy=multi-user.target
###### 자동실행 설정, 실행
systemctl daemon-reload
systemctl enable vncserver@:1.service
systemctl start vncserver@:1.service
###### 사용자 추가
useradd ecouser
###### vnc로 접속할 유저로 전환 후, vncserver 실행
su – ecouser
vncserver
---> 패스워드 설정
###### 방화벽 설정
firewall-cmd --permanent --zone=public --add-service vnc-server
firewall-cmd --reload
###### reboot
# VNC Viewer 에서 접속
VNC Server: IP주소:5901
################################################## 크롬 설치
## repo 설정
vi /etc/yum.repos.d/google-chrome.repo
[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
## 설치
yum install google-chrome-stable
################################################## Python 3 설치
############# Repository 추가
[root@localhost ~]# yum install -y https://centos7.iuscommunity.org/ius-release.rpm
############# yum 으로 설치
[root@localhost ~]yum install python36u python36u-libs python36u-devel python36u-pip
############# link 설정
[root@localhost ~]# ln -s /bin/python3.6 /bin/python3
############# pip link 설정
[root@localhost ~]# ls -l /bin/pip*
-rwxr-xr-x. 1 root root 370 1월 20 2017 /bin/pip3.6
[root@localhost ~]# ln -s /bin/pip3.6 /bin/pip
pip install --upgrade pip
pip install selenium
pip install bs4
pip install pymysql
'Linux' 카테고리의 다른 글
PHP 첨부파일 용량 문제 (0) | 2020.02.06 |
---|---|
iptables DROP 로그 남기기 (0) | 2019.11.08 |
CentOS 6 으로 버전 업데이트 하고 몇가지 문제점 (0) | 2019.08.06 |
주요 리눅스 서버 지원 기간 (0) | 2019.08.05 |
Centos7 apache2.4.6 Laravel 환경 virtual host 설정 (0) | 2018.08.28 |