1. Apache 2.4 설치
# yum -y install gcc* openssl* make apr apr-util apr-util-devel pcre-devel
# wget http://mirror.navercorp.com/apache//httpd/httpd-2.4.41.tar.gz
# tar xvfz httpd-2.4.41.tar.gz
# cd httpd-2.4.41/
# ./configure --prefix=/usr/local/apache --enable-so --enable-rewrite --enable-ssl --enable-modules=shared --enable-mods-shared=all --enable-apr --with-mpm=prefork --enable-apr-util
# make && make install
[설치 중 Error]
gcc: error: /usr/lib/rpm/redhat/redhat-hardened-ld: No such file or directory
# dnf install redhat-rpm-config
# vi /etc/systemd/system/apachectl.service
[Unit]
Description=The Apache HTTP Server
[Service]
Type=forking
#EnvironmentFile=/usr/local/apache/bin/envvars
PIDFile=/usr/local/apache/logs/httpd.pid
ExecStart=/usr/local/apache/bin/apachectl start
ExecReload=/usr/local/apache/bin/apachectl graceful
ExecStop=/usr/local/apache/bin/apachectl stop
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target
# systemctl daemon-reload
# systemctl enable apachectl
# systemctl start apachectl
# netstat -nltp
tcp6 0 0 :::80 :::* LISTEN 4295/httpd
2. mysql 설치
# yum install gcc* ncurses-devel cmake
# groupadd -g 400 mysql
# useradd -u400 -g400 -d /usr/local/mysql -s /bin/false mysql
# tar xvfz boost_1_59_0.tar.gz
# mv boost_1_59_0 /usr/local/include/boost
# cd /usr/local/include/boost
# ./boostrap.sh
# ./b2 install
# tar xvfz mysql-5.7.14.tar.gz
# cd /usr/local/src/mysql-5.7.14/
# cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/usr/local/mysql/data -DENABLED_LOCAL_INFILE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DSYSCONFDIR=/etc -DDEFAULT_CHARSET=utf8 -DMYSQL_TCP_PORT=3306 -DWITH_EXTRA_CHARSETS=all -DDEFAULT_COLLATION=utf8_general_ci
# make && make install
# cp -arp support-files/my-default.cnf /etc/my.cnf
# /usr/local/mysql/bin/mysql_install_db --user=mysql --datadir=/usr/local/mysql/data --basedir=/usr/local/mysql
# chown -R mysql.mysql /usr/local/mysql/
# chmod 711 /usr/local/mysql
# chmod 700 /usr/local/mysql/data
# chmod 751 /usr/local/mysql/bin
# chmod 750 /usr/local/mysql/bin/*
# chmod 755 /usr/local/mysql/bin/mysql
# chmod 755 /usr/local/mysql/bin/mysqldump
# vi /etc/systemd/system/mysql.service
[Unit]
Description=MySQL Community Server
After=network.target
After=syslog.target
[Install]
WantedBy=multi-user.target
Alias=mysql.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=/usr/local/mysql/bin/mysqld_safe
# Don't signal startup success before a ping works
#ExecStartPost=
# Give up if ping don't get an answer
TimeoutSec=300
Restart=always
PrivateTmp=false
# systemctl daemon-reload
# systemctl enable mysql
# systemctl start mysql
# netstat -nltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 987/sshd
tcp6 0 0 :::22 :::* LISTEN 987/sshd
tcp6 0 0 :::3306 :::* LISTEN 3531/mysqld
tcp6 0 0 :::80 :::* LISTEN 4295/httpd
# vi /etc/profile
alias mysql='/usr/local/mysql/bin/mysql'
alias mysqladmin='/usr/local/mysql/bin/mysqladmin'
alias mysqldump='/usr/local/mysql/bin/mysqldump'
# source /etc/profile
# cat /root/.mysql_secret
mysql 비밀번호
# mysqladmin -u root -p password
3. PHP 설치
# yum -y install gmp gmp-devel pam-devel libicu-devel net-snmp-devel libxml2-devel bzip2-devel curl-devel libpng-devel libjpeg-devel gdbm-devel freetype-devel
# tar xvfz mhash-0.9.9.9.tar.gz
# cd mhash-0.9.9.9/
# ./configure
# make && make install
# tar xvfz libmcrypt-2.5.8.tar.gz
# cd libmcrypt-2.5.8/
# ./configure
# make && make install
# yum install -y epel-release
# wget http://rpms.remirepo.net/enterprise/8/remi/x86_64//remi-release-8.0-4.el8.remi.noarch.rpm
# rpm -Uvh remi-release-8.0-4.el8.remi.noarch.rpm
# yum install remi-release
# yum -y install libc-client uw-imap-devel uw-imap uw-imap-static
# ln -s /usr/lib64/libc-client.a /usr/lib/libc-client.a
#tar xvfz php-7.2.0.tar.gz
# cd php-7.2.0/
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-config-file-path=/usr/local/apache/conf --enable-sigchild --with-libxml-dir --with-openssl --with-zlib --with-mysqli --with-zlib-dir --with-bz2 --enable-calendar --with-curl --enable-dba --with-gdbm --enable-exif --enable-ftp --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --enable-gd-native-ttf --with-gettext --with-imap=/usr/local/imap-2007f --with-imap-ssl --with-kerberos --enable-mbstring --with-mhash --with-mcrypt --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-wddx --enable-opcache --enable-zip --with-pdo-mysql --with-snmp --enable-intl
# make && make install
# cp php.ini-development /usr/local/apache/conf/php.ini
4. apache + php 연동
# vi /usr/local/apache/conf/httpd.conf
ServerName www.example.com:80
<Directory /home/*>
AllowOverride All
Options Indexes FollowSymLinks
Require all granted
</Directory>
AddType application/x-httpd-php .php .jsp .html
AddType application/x-httpd-php-source .phps
'LINUX > WEB' 카테고리의 다른 글
[WEB-WAS] 503 ERROR - ajp_read_header: ajp_ilink_receive failed (0) | 2022.03.14 |
---|---|
SSL 에러 (unable to load certificate) (0) | 2021.07.12 |
한 서버의 여러 PHP버전 설치 (0) | 2019.07.07 |
WAS WEB 분리 (1) | 2019.06.13 |
Cronolog 설치 (0) | 2019.06.03 |