Centos 7.9 + Nginx 1.23.0 + MariaDB 10.3.36 + Tomcat 8.5.29.0 + Java 1.8.0
1)Maria DB 설치(10.3.36)
-설치
wget -P /root/src http://tcs-down.simplexi.com/teamuser/spchoi/mariadb-10.3.36.tar.gz
yum -y install cmake ncurses-devel openssl-devel
cd /root/src; tar xvzf mariadb-10.3.36.tar.gz; cd mariadb-10.3.36
cmake -DCMAKE_INSTALL_PREFIX=/opt/mysql -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DMYSQL_DATADIR=/opt/mysql/var -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_PARTITION_STORAGE_ENGINE=1 -DWITH_FEDERATEDX_STORAGE_ENGINE=1 -DWITH_ARIA_STORAGE_ENGINE=1 -DWITH_XTRADB_STORAGE_ENGINE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci -DENABLED_LOCAL_INFILE=1 -DWITH_EXTRA_CHARSETS=all -DWITH_READLINE=1 -DWITH_SSL=system -DWITH_ZLIB=system
make -j `grep processor /proc/cpuinfo | wc -l`; make install
useradd -M -s /bin/false mysql
chown -R mysql.mysql /opt/mysql
/opt/mysql/scripts/mysql_install_db --user=mysql --basedir=/opt/mysql --datadir=/opt/mysql/var
/opt/mysql/support-files/mysql.server start
[root@corent-1128 ~]# netstat -tnlp | grep 3306
tcp6 0 0 :::3306 :::* LISTEN 22637/mysqld
[root@corent-1128 ~]# /opt/mysql/bin/mysql -V
/opt/mysql/bin/mysql Ver 15.1 Distrib 10.3.36-MariaDB, for Linux (x86_64) using readline 5.1
2)Nginx 설치(1.23.0)
-설치
wget -P /root/src http://nginx.org/download/nginx-1.23.0.tar.gz
yum install pcre*.x86_64 geoip-devel libxslt-devel perl-ExtUtilsEmbed
yum install perl-ExtUtils-Embed
-openssl 소스설치
ㄴ nginx 소스설치시, openssl 을 수동으로 설치후 해당 경로를 잡아줘야 함
ㄴ /opt/openssl-1.0.2f 는 삭제 하면 안됨
cd /opt
tar -zxf openssl-1.0.2f.tar.gz
cd /root/src; tar xvzf nginx-1.23.0.tar.gz; cd nginx-1.23.0
./configure \
--prefix=/opt/nginx \
--conf-path=/opt/nginx/conf/nginx.conf \
--error-log-path=/opt/nginx/logs/error.log \
--http-log-path=/opt/nginx/logs/access.log \
--user=nginx \
--group=nginx \
--with-file-aio \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_realip_module \
--with-http_addition_module \
--with-http_xslt_module \
--with-http_image_filter_module \
--with-http_geoip_module \
--with-http_sub_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_mp4_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_random_index_module \
--with-http_secure_link_module \
--with-http_degradation_module \
--with-http_slice_module \
--with-http_stub_status_module \
--with-http_perl_module \
--with-mail \
--with-mail_ssl_module \
--with-pcre \
--with-pcre-jit \
--with-stream \
--with-stream_ssl_module \
--with-openssl=/opt/openssl-1.0.2f \
--with-debug \
--with-http_perl_module
make
make install
-nginx 구문 이상여부 확인
[root@corent-1128 ~]# /opt/nginx/sbin/nginx -t
nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
nginx: [emerg] getpwnam("nginx") failed
nginx: configuration file /opt/nginx/conf/nginx.conf test failed
ㄴ 위처럼 에러 발생시 useradd -s /bin/false nginx 진행
[root@corent-1128 ~]# /opt/nginx/sbin/nginx -t
nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /opt/nginx/conf/nginx.conf test is successful
-nginx 실행
[root@corent-1128 ~]# /opt/nginx/sbin/nginx
-nginx 재시작
[root@corent-1128 ~]# /opt/nginx/sbin/nginx -s reload
-nginx 프로세스 확인
[root@corent-1128 ~]# ps -ef | grep nginx
root 32399 1 0 10:52 ? 00:00:00 nginx: master process /opt/nginx/sbin/nginx
nginx 32403 32399 0 10:52 ? 00:00:00 nginx: worker process
root 32408 24007 0 10:52 pts/0 00:00:00 grep --color=auto nginx
-nginx 서비스 오픈 확인
[root@corent-1128 ~]# netstat -tnlp | grep 80
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 32399/nginx: master
-nginx 버전 확인
[root@corent-1128 ~]# /opt/nginx/sbin/nginx -v
nginx version: nginx/1.23.0
3)Tomcat 설치(8.5.29)
Tomcat8 설치
wget -P /root/src/ http://archive.apache.org/dist/tomcat/tomcat-8/v8.5.29/bin/apache-tomcat-8.5.29.tar.gz
cd /root/src; tar xvzf apache-tomcat-8.5.29.tar.gz
mv apache-tomcat-8.5.29 /opt/tomcat
[root@corent-1128 ~]# /opt/tomcat/bin/startup.sh
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
ㄴ java를 설치하면 아래와 같이 정상적으로 실행됨
[root@corent-1128 ~]# /opt/tomcat/bin/startup.sh
Using CATALINA_BASE: /opt/tomcat
Using CATALINA_HOME: /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.352.b08-2.el7_9.x86_64
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
Tomcat started.
- tomcat 서비스 확인
[root@corent-1128 ~]# netstat -tnlp | grep java
tcp6 0 0 127.0.0.1:8005 :::* LISTEN 32600/java
tcp6 0 0 :::8009 :::* LISTEN 32600/java
tcp6 0 0 :::8080 :::* LISTEN 32600/java
- tomcat 버전 확인
[root@corent-1128 /opt/tomcat/lib]# java -cp catalina.jar org.apache.catalina.util.ServerInfo
Server version: Apache Tomcat/8.5.29
Server built: Mar 5 2018 13:11:12 UTC
Server number: 8.5.29.0
OS Name: Linux
OS Version: 3.10.0-1160.80.1.el7.x86_64
Architecture: amd64
JVM Version: 1.8.0_352-b08
JVM Vendor: Red Hat, Inc.
4)Java 설치(1.8.0)
- OpenJDK 1.8.0 설치
yum install -y java-1.8.0-openjdk java-1.8.0-openjdk-devel
- JDK 설치 경로 확인
[root@corent-1128 ~]# which javac
/usr/bin/javac
[root@corent-1128 ~]# readlink -f /usr/bin/javac
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.352.b08-2.el7_9.x86_64/bin/javac
- JDK PATH 설정
vim /etc/profile
CATALINA_HOME=/opt/tomcat
export PATH=$PATH:$CATALINA_HOME/bin:$APACHE_HOME/bin
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64
source /etc/profile
[root@corent-1128 ~]# echo $JAVA_HOME
/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.352.b08-2.el7_9.x86_64
[root@corent-1128 ~]# $JAVA_HOME/bin/javac -version
javac 1.8.0_352
'On-premise > Nginx' 카테고리의 다른 글
| NginX 1.9.9 + MriaDB 10.1.25 + PHP 7.1.8 (0) | 2023.11.06 |
|---|---|
| CentOS 7.3 + NginX 1.9.9 + MriaDB 10.1.25 + PHP 7.1.8 (0) | 2023.11.06 |
| Nginx (0) | 2023.11.06 |
| Nginx 인증서 설정 (0) | 2023.11.06 |
| Centos 7.7 + Nginx 1.20.1 + MariaDB 10.6.5 + PHP 8.0.12 (0) | 2023.11.05 |