๐ APM์ด๋?
- A(Apache) : ์น์๋ฒ
- P(PHP) : ์น ํ๋ก๊ทธ๋๋ฐ ์ธ์ด
- M(MYSQL) : ๋ฐ์ดํฐ๋ฒ ์ด์ค
์ด ์ธ๊ฐ์ง๊ฐ ์ฐ๋๋์ด ์ด์๋๋๋ก ๋ง๋ ํ๊ฒฝ์ APM์ด๋ผ๊ณ ํ๋ค. pache์ MySQL์ด PHP์ ํธํ์ฑ์ด ์ข๊ธฐ ๋๋ฌธ์ ์ฃผ๋ก ์ธ ํ๋ก๊ทธ๋จ์ ๋ฌถ์ด ํจํค์ง ํํ๋ก ์ฌ์ฉํ๋ค.
๐ Apache
์ ์ ๋ช ์นญ : Apache HTTP server
์น ์๋ฒ ํ๋ก๊ทธ๋จ์ด๋ค. ์น ์๋ฒ๋ ์น ์๋น์ค๋ฅผ ์ ๊ณตํด์ฃผ๋ ์๋ฒ์ธ๋ฐ, ์๋ฅผ ๋ค์ด ์ฌ์ฉ์๊ฐ ์ฌ์ดํธ์ ์ ์ํ๋ฉด ์น ์๋ฒ์๊ฒ HTML ํ์ผ์ ์์ฒญํ๋ค. ์์ฒญ์ ๋ฐ์ ์น ์๋ฒ๋ ํด๋ผ์ด์ธํธ ์ปดํจํฐ์ HTML ํ์ผ์ ์ ๊ณตํ๋ฉด์ ์ฌ์ฉ์๋ ํ๋ฉด์ผ๋ก ์น ํ์ด์ง๋ฅผ ๋ณผ ์ ์๊ฒ ๋๋ค.
๐ ํจํค์ง๊ฐ ์๋ ์์ค ์ค์น๋ฅผ ํ๋ ์ด์
๐ํ์ ํจํค์ง ์ค์น
$ sudo su
# apt-get install make
# apt-get install build-essential
-->๐ข์ค๋ฅ๐ข E: Unmet dependencies. Try 'apt-get --fix-broken install' with no packages (or specify a solution).
-->๐solve๐apt-get --fix-broken install'
# apt-get install gcc
-->๐ข์ค๋ฅ๐ข
-->๐solve๐ํ๋จ์
# apt-get install --reinstall make
# apt-get install libexpat1-dev
# apt-get install g++
# apt-get install net-tools
# apt-get install curl
๐ข$ apt-get install gcc ์ฌ๊ธฐ์ ์ค๋ฅ๋จ!๐ข
Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable)
sudo killall apt apt-get
->๋ชจ๋ ํ๋ก์ธ์ค ์ฃฝ์ด๊ธฐ
"์งํ์ค์ธ ํ๋ก์ธ์ค๊ฐ ์๋ค"๋ผ๋ ๋ง์ด ๋จ๋ฉด, ์๋์ ๋ช ๋ น์ด ํ๋ํ๋์ฉ ์ ๋ ฅํ์ฌ ๋๋ ํ ๋ฆฌ๋ฅผ ์ญ์ ํ๋ค.
$sudo rm /var/lib/apt/lists/lock
$sudo rm /var/cache/apt/archives/lock
$sudo rm /var/lib/dpkg/lock*
$sudo dpkg --configure -a
๐์์ค์ค์น ๊ด๋ก
/usr/local์ ์ค์นํ๋ ๊ฒ์ด ๊ด๋ก์ด๋ค.
- ์์คํ์ผ์ ๋ด๋ ค๋ฐ๊ณ
- ./configure๋ก ์ค์ ์ ํ๋ค.
- make๋ก ์ปดํ์ผ์ ํ ๋ค
- make install๋ก ์ค์นํ๋ค.
- configure: ์์คํ์ผ์ ๋ํ ํ๊ฒฝ์ค์ ์ ํด์ฃผ๋ ๋ช ๋ น์ด๋ค. (๋ค์ ์ต์ ์ ๋ฃ์) ์๋ฒํ๊ฒฝ์ ๋ง์ถ์ด makefile์ ์์ฑํด์ฃผ๋ ๊ณผ์ ์ด๋ค.
- make: ์์ค๋ฅผ ์ปดํ์ผ ํ๋ ๊ฒ์ด๋ค. ์ปดํ์ผ์ด๋ ์์คํ์ผ์ ์ฌ์ฉ์๊ฐ ์คํ ๊ฐ๋ฅํ ํ์ผ๋ก ๋ง๋ค์ด ์ฃผ๋ ๊ณผ์ ์ ๋งํ๋ค.
- make install: make๋ฅผ ํตํด ๋ง๋ค์ด์ง ์ค์นํ์ผ์ ์คํผํ๋ ๊ณผ์ ์ด๋ค. ํ๋ง๋๋ก build๋ ํ๋ก๊ทธ๋จ์ ์คํํ ์ ์๊ฒ ํ์ผ๋ค์ ์๋ง์ ์์น์๋ค๊ฐ ๋ณต์ฌ๋ฅผ ํ๋ค.
๐์์ค์ค์น ํ์ผ ๋ค์ด๋ก๋ ๋ฐ ์์ถํด์
$ sudo su
/usr/local# mkdir apache
1) apr-1.7.0
/usr/local# wget http://mirror.navercorp.com/apache//apr/apr-1.7.0.tar.gz
2) apr-util-1.6.1
/usr/local# wget http://mirror.navercorp.com/apache//apr/apr-util-1.6.1.tar.gz
3) pcre-8.45
/usr/local# wget https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz
4) apache-2.4.51
/usr/local# wget https://dlcdn.apache.org//httpd/httpd-2.4.51.tar.gz
์์ถํด์
/usr/local# tar xvfz apr-1.7.0.tar.gz
/usr/local# tar xvfz apr-util-1.6.1.tar.gz
/usr/local# tar xvfz pcre-8.45.tar.gz
/usr/local# tar xvfz httpd-2.4.51.tar.gz
- mkdir: ๋๋ ํ ๋ฆฌ๋ฅผ ์์ฑํ๋ ๋ช ๋ น์ด์ด๋ค.
- wget : web get์ ์ค์๋ง๋ก ์น ์๋ฒ๋ก๋ถํฐ ํ์ผ์ ๋ค์ด๋ก๋ํ๋ค.
- tar xvfz : tar.gz ํ์์ผ๋ก ์์ถ๋์ด์๋ ํ์ผ์ ์์ถํด์
- APR: APR(์ํ์น ํฌํฐ๋ธ ๋ฐํ์)๋ ์ํ์น HTTP ์๋ฒ 2.x.์ ํต์ฌ์ด๋ฉฐ ํด๋์ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ด๋ค. ์ด๋ฐ APR์ ๊ณ ๊ธ IO ๊ธฐ๋ฅ(์:sendfile, epoll and OpenSSL ๋ฑ)์ ๋ํ ์ ๊ทผ์ ํฌํจํ์ฌ OS ์์ค์ ๊ธฐ๋ฅ (๋์ ์์ฑ, ์์คํ ์ํ), ๊ทธ๋ฆฌ๊ณ ๊ธฐ๋ณธ ํ๋ก์ธ์ค ์ฒ๋ฆฌ(๊ณต์ ๋ฉ๋ชจ๋ฆฌ, NT ํ์ดํ์ ์ ๋์ค ์์ผ) ๋ฑ ๋ง์ ์ฉ๋๋ก ์ฌ์ฉ๋๊ณ ์๋ค.
- PCRE: PCRE( Perl Compatible Regular Expressions )๋ ํ ํธํ ์ ๊ท ํํ์์ผ๋ก์, ์ ๊ท์ ํจํด ์ผ์น๋ฅผ ๊ตฌํํ๋ ํจ์์ ์งํฉ์ด๋ค. ์์ฆ์๋ Apache, PHP, KDE ๋ฑ์ ํฌํจํ ์คํ ์์ค ํ๋ก์ ํธ์์ ์ฌ์ฉ๋๊ณ ์์ผ๋ฉฐ, ์ํ์น 2.4 ๋ฒ์ ์ ์ค์นํ ๋๋ pcre๋ฅผ ์ค์นํด์ผ ํ๋ค.
๐apr ์ค์น
๋ค์์ ์งํํ๊ธฐ ์ ์ ์ค๋ฅ๊ฐ ๋๊ธฐ ์ ์ ๋ช ๊ฐ์ง๋ฅผ ์ค์นํ๊ณ ์งํํ์.
no acceptable C compiler found in $PATH๋ผ๋ ์๋ฌ์
cannot remove 'libtoolT' : No such file or directory ๊ฐ ์๊ธฐ๊ธฐ์, ๋ฏธ๋ฆฌ ์ค์นํ๊ณ ์งํํ๋ค.
/usr/local# cd apr-1.7.0
/usr/local/apr-1.7.0# ./configure --prefix=/usr/local/apr
์ฌ๊ธฐ์ ์ค๋ฅ๊ฐ ๋๋ค๋ฉด
# cp -arp libtool libtoolT ๋ค์ด๋ก๋๋ฅผ ํด์ค๋ค.
/usr/local/apr-1.7.0# make
/usr/local/apr-1.7.0# make install
๐apr-util ์ค์น
/usr/local# cd apr-util-1.6.1
/usr/local/apr-util-1.6.1# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
/usr/local/apr-util-1.6.1# make
/usr/local/apr-util-1.6.1# make install
๐pcre ์ค์น
๋ค์ด๊ฒฝ๋ก : /usr/local
/usr/local# cd pcre-8.45
/usr/local/pcre-8.45# ./configure --prefix=/usr/local/pcre
/usr/local/pcre-8.45# make
/usr/local/pcre-8.45# make install
๐Apache ์ค์น (apache 2.4.52)
์ต๊ทผ ๋ฒ์ ํ์ธํ์ฌ์ ๋ค์ด ๋ฐ๋๋ค!
https://httpd.apache.org/download.cgi
Download - The Apache HTTP Server Project
Downloading the Apache HTTP Server Use the links below to download the Apache HTTP Server from our download servers. You must verify the integrity of the downloaded files using signatures downloaded from our main distribution directory. The signatures can
httpd.apache.org
/usr/local# cd httpd-2.4.51
/usr/local/httpd-2.4.51# ./configure --prefix=/usr/local/apache2.4 \--enable-module=so --enable-rewrite --enable-so \--with-apr-util=/usr/local/apr-util \--with-pcre=/usr/local/pcre \--enable-mods-shared=all
-->์ด๋ถ๋ถ์ ๋ณต๋ถํด๋ ์ค๋ฅ๋์ ๋๋ ์ค์ ๋ก ์ณค๋ค!ใ ใ
/usr/local/httpd-2.4.51# make
/usr/local/httpd-2.4.51# make install
๐ข--with-pcre=/usr/local/pcre \์ฌ๊ธฐ์ ์ค๋ฅ๋จ!๐ข
error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
$ apt install yum
$ yum -y install pcre-devel
./configure --prefix=/usr/local/apache2.4\--enable-module=so --enable-rewrite --enable-so \--with-apr=/usr/local/apr \--with-apr-util=/usr/local/apr-util\--with-pcre=/usr/local/pcre\--enable-mods-shared=all
๊ทธ๋ฅ ๋์ด์ฐ๊ธฐ๋, ์คํ๋๋ฏ!
\์ด๊ฑฐ ์ ์ ํ๊ฒ ์ฌ์ฉํด์ ์ฐ๊ณ ๋ฐ๋ก \์ฐ๊ณ ๋์ด์ฐ๊ธฐ ์ํ๊ณ ๋ฐ๋ก ๋ถ์ฌ์ --์ฐ๋๊น ์ค๋ฅ ์๋๊ณ ์๋๋ค
์ ์์ ์ผ๋ก ์งํ๋๋ฉด ์ด๋ ๊ฒ ์ถ๋ ฅ๋๋ค. ๋๋ ์๋์์ ๋ช
๋ น์ด๋ค์ ๋๋ฒ์ ๋ ์์ ์ฒ์๋ถํฐ ๋ค์ ์ณค๋ค..(์ธ๋ฒ..)
๐Apache ์คํ
์คํ: httpd -k start, ์ข ๋ฃ: httpd -k stop
/usr/local# sudo apache2.4/bin/httpd -k start
/usr/local# ps -ef | grep httpd | grep -v grep
/usr/local# sudo netstat -anp | grep httpd
/usr/local# sudo curl http://127.0.0.1
์ ์ ๋ค๋ฒ๋ง์ ๋์ ๋ง์ ์๋ฒ๋ค์ ์ง์ ํ๋ผ๋ ๋ฌธ๊ตฌ๋ด๋ค ใ ใ
์๋จ๋ฉด ์ ํ์ ํจํค์ง ์ค์น๋ถํฐ ๋ค์ ํด๋ณด์ธ์!
->์๋ฒ๋ค์์ ๋ฐ๋ก ์ง์ ํด์ฃผ์ง ์์๋ ๋ฌธ์ ์๋คํด์ ์ง์ ์ํด์คฌ์ด์! ๊ทธ๋ฅ ๋ฌด์ํด์คฌ์ด์
'Server๐งค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Server] KT ๊ณต์ ๊ธฐ ํฌํธํฌ์๋ฉ (0) | 2022.03.21 |
---|---|
[Ubuntu] APM ์์ค ์ค์น(์๋ ์ค์น)ํ๊ธฐ - 3 (PHP) (0) | 2022.03.15 |
[Ubuntu] APM ์์ค ์ค์น(์๋ ์ค์น)ํ๊ธฐ - 2 (MySQL) (0) | 2022.03.14 |
Window : WAMP ์ค์น (0) | 2022.03.13 |
Server๋ ? (0) | 2022.03.13 |