반응형

SELinux - httpd 가 WAS port 로 연결 실패 - (13)Permission denied: proxy: HTTP: attempt to connect to 127.0.0.1:8080 (localhost) failed

 

semanage 로 해당 포트가 binding 된 context 가 있나 확인

~# semanage port -l |grep 8081 
transproxy_port_t              tcp      8081

 

관련 SELinux context 는 http_port_t 이므로 허용 가능한 port 를 확인

~# semanage port -l |grep http_port_t
http_port_t                    tcp      80, 443, 488, 8008, 8009, 8443

httpd_port_t 에 10080 포트를 추가

~# semanage port -a -p tcp -t http_port_t 10080

httpd_port_t 로 8081 수정

~# semanage port -m -p tcp -t http_port_t  8081


반응형

'리눅스' 카테고리의 다른 글

CentOS7 MariaDB 설치 (2023년10월)  (1) 2023.10.10
우분투 젠킨스 설치.  (0) 2023.06.14
리눅스 계정 timeout  (0) 2023.02.24
젠킨스 포트 변경  (0) 2023.02.24
아파치 포비든 Forbbiden 403 오류  (0) 2022.11.11
리눅스 (CentOs7) 젠킨스 설치. (2022.11.07)  (0) 2022.11.07
docker 기본 명령어  (0) 2022.10.26
MariaDB 2개 설치 - CentOS7 ( 2021년 )  (2) 2022.01.14
반응형
[root@goni9071 ~]# rpm -qa maria*

- 설치되어 있지 않으면 아무것도 나오지 않습니다.

 

원하는 버전을 설치하기 위해서 https://mariadb.org/download 에서 리파지토리르 정보를 얻습니다.

 

위 사이트 접속 합니다.

 

1. MariaDB Server Repositories 탭을 선택.

 

2. 배포판 선택

 

3. 원하는 버젼 선택

 

4. 해당 내용 복사

- 이 내용을 /etc/yum.repos.d/MariaDB.repo  파일로 저장.

 

 

5. 아래 명령어 실행으로 설치.
- yum install MariaDB-server

6. 실행

- systemctl start mariadb

7. 부팅시 자동 실행

- systemctl enable mariadb

반응형
반응형

젠킨스 공식 페이지 : https://www.jenkins.io/doc/book/installing/linux/

 

Linux

You can install Jenkins through yum on Red Hat Enterprise Linux, Alma Linux, Rocky Linux, Oracle Linux, and other Red Hat based distributions. How To Install Jenkins on Rocky Linux 9 You need to choose either the Jenkins Long Term Support release or the Je

www.jenkins.io

 

Debian/Ubuntu

On Debian and Debian-based distributions like Ubuntu you can install Jenkins through apt.

Long Term Support release

A LTS (Long-Term Support) release is chosen every 12 weeks from the stream of regular releases as the stable release for that time period. It can be installed from the debian-stable apt repository.

curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
반응형
반응형

[root계정 사용]

 

1. 파일 열기

# vi /etc/profile

 

2. /etc/profile 마지막 라인에 300초 추가.
TMOUT=300 

 

3. 파일 적용
# source /etc/profile

 

4. 확인
# echo $TMOUT

반응형
반응형

1. 젠킨스 설정 파일 열기
# vi /etc/sysconfig/jenkins

 

2. 포트 변경
JENKINS_PORT="8080"

3. 젠킨스 시스템 서비스 설정 파일 열기
# vi /usr/lib/systemd/system/jenkins.service

4. 포트 변경
Environment="JENKINS_PORT=8080"

5. 시스템 서비스 적용하기
# systemctl daemon-reload

6. 젠킨스 시작
# systemctl start jenkins

반응형
반응형

아파치 오류가 아래와 같이 발생하는 경우 입니다.

because search permissions are missing on a component of the path

 

이미 아파치 설정파일의 기본적인 설정은 다했는데도 안되는 경우가 머리 아프죠.

 

확인하기 어려운 2가지를 확인해보면 될 것 같습니다.

 

아래 명령어로 해당 파일의 권한 뿐만 아니라 전체 경로의 권한을 확인 할 수 있습니다. 모두 실행 권한이 있어야 합니다.

namei -m DocumentRoot전체절대경로/index.html

 

위 문제도 아니라면, 아래 명령어로 SELinux 가 활성화 되어있는지 확인 합니다.

sestatus

만약 활성화  되어 있다면 SELinux 관련 403 오류를 다시 찾아보시길 바랍니다.^^

반응형

'리눅스' 카테고리의 다른 글

CentOS7 MariaDB 설치 (2023년10월)  (1) 2023.10.10
우분투 젠킨스 설치.  (0) 2023.06.14
리눅스 계정 timeout  (0) 2023.02.24
젠킨스 포트 변경  (0) 2023.02.24
리눅스 (CentOs7) 젠킨스 설치. (2022.11.07)  (0) 2022.11.07
docker 기본 명령어  (0) 2022.10.26
MariaDB 2개 설치 - CentOS7 ( 2021년 )  (2) 2022.01.14
리눅스 파일 0byte 만들기  (0) 2021.03.11
반응형

오랫만에 젠킨스를 설치합니다.

 

제품 설치는 역시 공식 문서가 최고죠.

 

https://www.jenkins.io/doc/book/installing/linux/#red-hat-centos

 

Linux

After downloading, installing and running Jenkins using one of the procedures above (except for installation with Jenkins Operator), the post-installation setup wizard begins. This setup wizard takes you through a few quick "one-off" steps to unlock Jenkin

www.jenkins.io

공식 리눅스 설치 가이드 입니다.

sudo wget -O /etc/yum.repos.d/jenkins.repo \
    https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
sudo yum upgrade
# Add required dependencies for the jenkins package
sudo yum install java-11-openjdk
sudo yum install jenkins
sudo systemctl daemon-reload

[2023년 버전]
sudo wget -O /etc/yum.repos.d/jenkins.repo \
    https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
sudo yum upgrade
# Add required dependencies for the jenkins package
sudo yum install fontconfig java-17-openjdk
sudo yum install jenkins
sudo systemctl daemon-reload



repo 가져오는데 처음 부터.... 안되는군요 ㅜㅜ

 

[오류 메시지]

ERROR: cannot verify pkg.jenkins.io's certificate, issued by ‘/C=US/O=Let's Encrypt/CN=R3’:
  Issued certificate has expired.
To connect to pkg.jenkins.io insecurely, use `--no-check-certificate'.

 

[해결방법]

sudo yum install -y ca-certificates

 

이 이후로는 막힘없이 진행 잘 되었습니다.~

 

[젠킨스 부팅 시 자동 실행]

sudo systemctl enable jenkins

 

[젠킨스 시작]

sudo systemctl start jenkins

 

[젠킨스 상태 확인]

sudo systemctl status jenkins

 

가이드와 동일하게 젠킨스 시작 후 접속하니 아래와 같은 화면이 뜹니다.

시키는 대로 해당 파일에 적힌 문자열을 복사해서 입력합니다.

 

 

 

플러그인 알아서 깔아줘. 옵션 입니다.

 

 

알아서 플러그인 설치 중 입니다.

 

[설치 후]

 

 

[계정 생성 후 URL 설정]

 

[준비완료]

 

[설치완료]

반응형

'리눅스' 카테고리의 다른 글

우분투 젠킨스 설치.  (0) 2023.06.14
리눅스 계정 timeout  (0) 2023.02.24
젠킨스 포트 변경  (0) 2023.02.24
아파치 포비든 Forbbiden 403 오류  (0) 2022.11.11
docker 기본 명령어  (0) 2022.10.26
MariaDB 2개 설치 - CentOS7 ( 2021년 )  (2) 2022.01.14
리눅스 파일 0byte 만들기  (0) 2021.03.11
쉘스크립트 - 맵  (0) 2020.10.31
반응형

[버전확인]

$ docker -v

Docker version 20.10.17, build 100c701

 

[프로세스확인] 

$ docker ps

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

 

[서비스확인]

$ systemctl status docker

● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com

 

[서비스시작] 

$ sudo systemctl start docker

 

[다시서비스확인]

$ systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2022-10-26 02:06:01 KST; 2s ago
     Docs: https://docs.docker.com
  Process: 1478 ExecStartPre=/usr/libexec/docker/docker-setup-runtimes.sh (code=exited, status=0/SUCCESS)
  Process: 1476 ExecStartPre=/bin/mkdir -p /run/docker (code=exited, status=0/SUCCESS)
 Main PID: 1481 (dockerd)
    Tasks: 9
   Memory: 22.2M
   CGroup: /system.slice/docker.service
           └─1481 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock --default-ulimit nofile=32768:65536

 

[다시프로세스확인] 

$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

 

[이미지확인]

$ docker images
REPOSITORY   TAG       IMAGE ID       CREATED      SIZE
<none>       <none>    4f4aefa11b8f   7 days ago   6.51GB

 

 

반응형
반응형

* yum 을 통해 기본 MariaDB가 설치되어 있는 상태에서 추가로 MariaDB를 1개 더 설치하는 과정입니다.

 

설치버전 : MariaDB 10.5.13-GA

다운로드 URL :

https://mariadb.org/download/?t=mariadb&p=mariadb&r=10.5.13&os=Linux&cpu=x86_64&i=systemd&m=yongbok

 

 

1. basedir 생성 후 다운받은 tar.gz 파일을 압축을 풉니다.

# mkdir /opt/mysql-10.5  <-- 여기를 mariadb 기본 디렉터리로 쓸겁니다. (위치 및 파일명 내 맘대로 정함)

# chown mysql.mysql /opt/mysql-10.5

# cd /opt/mysql-10.5

# tar -xvzf mariadb-10.5.13-linux-systemd-x86_64.tar.gz

# mv mariadb-10.5.13-linux-systemd-x86_64/* .

# rm -rf mariadb-10.5.13-linux-systemd-x86_64*

 

2. datadir 생성 

# mkdir /var/lib/mysql-10.5 <-- 여기를 data 를 저장할 디렉터리로 쓸겁니다. (위치 및 파일명 내 맘대로 정함)

# chown mysql.mysql /var/lib/mysql-10.5

 

3. cnf 설정파일 생성

# vi /etc/my-10.5.cnf <-- 기본 설정파일과 분리된 신규 설정파일. (위치 및 파일명 내 맘대로 정함)

 

[mysqld]

init_connect=SET collation_connection=utf8_general_ci

init_connect=SET NAMES utf8

character-set-server=utf8

collation-server=utf8_general_ci

table_open_cache=1024

max_connections=2048

max_user_connections=500

max_connect_errors=10000

wait_timeout=300

query_cache_type=1

query_cache_size=128M

query_cache_limit=5M

slow_query_log

long_query_time=3

max_allowed_packet=16M

sort_buffer_size=2M

skip-name-resolve

symbolic-links=0

port=3307 <-- 기존 db가 3306 쓰고 있어서 3307 포트 사용

basedir=/opt/mysql-10.5

datadir=/var/lib/mysql-10.5

socket=/var/lib/mysql-10.5/mysql.sock

 

[mysql]

default-character-set=utf8

socket=/var/lib/mysql-10.5/mysql.sock

 

[client]
socket=/var/lib/mysql-10.5/mysql.sock
port=3307


[mysqld_safe]
socket=/var/lib/mysql-10.5/mysql.sock

 

4. mariadb install

[실행]

# cd /opt/mysql-10.5

# scripts/mysql_install_db --defaults-file=/etc/my-10.5.cnf --user=mysql

 

[결과]

Installing MariaDB/MySQL system tables in '/var/lib/mysql-10.5' ...

OK

 

To start mysqld at boot time you have to copy

support-files/mysql.server to the right place for your system



Two all-privilege accounts were created.

One is root@localhost, it has no password, but you need to

be system 'root' user to connect. Use, for example, sudo mysql

The second is mysql@localhost, it has no password either, but

you need to be the system 'mysql' user to connect.

After connecting you can set the password, if you would need to be

able to connect as any of these users with a password and without sudo

 

See the MariaDB Knowledgebase at https://mariadb.com/kb or the

MySQL manual for more instructions.

 

You can start the MariaDB daemon with:

cd '/opt/mysql-10.5' ; /opt/mysql-10.5/bin/mysqld_safe --datadir='/var/lib/mysql-10.5'

 

You can test the MariaDB daemon with mysql-test-run.pl

cd '/opt/mysql-10.5/mysql-test' ; perl mysql-test-run.pl

 

Please report any problems at https://mariadb.org/jira

 

The latest information about MariaDB is available at https://mariadb.org/.

You can find additional information about the MySQL part at:

https://dev.mysql.com

Consider joining MariaDB's strong and vibrant community:

https://mariadb.org/get-involved/



5. 시스템 재시작 시 자동 실행 되도록 서비스 등록.

# vi /etc/systemd/system/mariadbd-10.5.service

 

[Unit]

Description=MariaDB 10.5.13 database server

After=network.target

After=syslog.target

 

[Install]

WantedBy=multi-user.target

Alias=mariadbd-10.5.service

 

[Service]

 

User=mysql

Group=mysql

 

# Execute pre and post scripts as root

PermissionsStartOnly=true

 

# Needed to create system tables etc.

#ExecStartPre=

 

# Start main service

ExecStart=/opt/mysql-10.5/bin/mariadbd-safe --defaults-file=/etc/my-10.5.cnf

 

# Don't signal startup success before a ping works

#ExecStartPost=

 

# Give up if ping don't get an answer

TimeoutSec=300

PrivateTmp=false

 

6. 서비스 활성 화 및 재시작 그리고 상태 확인

]# systemctl list-unit-files|grep mari

]# systemctl enable mariadb-10.5

 

] # systemctl daemon-reload

] # systemctl status mariadb-10.5

 

7. root 암호 설정하기

] # mysqladmin --defaults-file=/etc/my-10.5.cnf -u root password 

 

** 유의사항.

- make 부터해서 새로 컴파일을 한게 아니라서..

- 새로 설치한 mariadb 관련 명령어 실행시 항상 "--defaults-file=/etc/my-10.5.cnf" 옵션을 넣어 주어야만 한다.

 

반응형
반응형

cat /dev/null > 파일명

반응형

+ Recent posts