ubuntu์ Apache ์์ค ์ค์น
ubuntu-20.04์ Apache๋ฅผ ์์ค ์ค์นํด๋ณด์.
ubuntu APM ์์ค ์ค์น
์ด ํฌ์คํธ๋ ubuntu-20.04์ APM(Apache, PHP, MySql)์ ์์ค ์ค์นํ๋ ๊ณผ์ ์ด๋ฉฐ, ์๋์ ์ธ ๊ฐ์ง ์์์ ํฌ์คํ
์ผ๋ก ์ด๋ฃจ์ด์ ธ ์๋ค.
[Linux] ubuntu์ Apache ์์ค ์ค์น
[Linux] ubuntu์ MySql ์์ค ์ค์น
[Linux] ubuntu์ php ์์ค ์ค์น
์์ ํ๊ฒฝ
macOS์์ virtualBox๋ก ๊ฐ์๋จธ์ ubunto๋ฅผ ๋ง๋ค๊ณ ๊ทธ ์์ ์์ค ์ค์น๋ฅผ ์งํํ๋ค.
macOS : Big Sur 11.4
VirtualBox : 6.1.16
ubuntu : 20.04.2.0-desktop
๊ถํ ๋ถ์ฌ & ์ค์น ๊ฒฝ๋ก
์ค์น์ ํ์ํ ๊ถํ์ ๋ถ์ฌ๋ฐ๊ธฐ ์ํด ๋ค์์ ๋ช ๋ น์ด๋ฅผ ์ ๋ ฅํ๊ณ ํจ์ค์๋๋ฅผ ์ ๋ ฅํ๋ค.
$ sudo su
์ปดํ์ผ ์ค์น๋ ๊ด๋ก์ /usr/local
์ ์ค์นํ๋ฏ๋ก ํด๋น ๊ฒฝ๋ก๋ก ์ด๋ํ๋ค.
$ cd /usr/local
๊ด๋ จ ํจํค์ง ์ค์น ๋ฐ apr, apr-util ์ค์น
๊ด๋ จ ํจํค์ง ์ค์น
apt-get update
$ apt-get install gcc zlibc zlib1g zlib1g-dev libssl-dev openssl libxml2-dev ncurses-dev libexpat1-dev
์ปดํ์ผ์ ํ์ํ ๊ด๋ จ ํจํค์ง๋ค์ ์ค์นํด์ค๋ค.
๋ช ๋ น์ด
cd
: ์์น ์ด๋ ๋ช ๋ น์ดcp
: ๋ณต์ฌ ๋ช ๋ น์ดwget
: ์ง์ ํ ์ฃผ์๋ก ๋ถํฐ ํ์ผ์ ๋ค์ด๋ฐ๋ ๋ช ๋ น์ดtar xvfz
: tar.gz ํ์์ ์์ถ์ ํ์ด์ฃผ๋ ๋ช ๋ น์ดconfigure
: ์์คํ์ผ์ ๋ํ ํ๊ฒฝ์ค์ ์ ํด์ฃผ๋ ๋ช ๋ น์ด- configure์
prefix
์ต์ : ์ปดํ์ผ๋ ํ๋ก๊ทธ๋จ์ ์ค์นํ๋ ์์น
- configure์
make
: ์์ค๋ฅผ ์ปดํ์ผํด์ฃผ๋ ๋ช ๋ น์ดmake install
: make๋ฅผ ํตํด ๋ง๋ค์ด์ง ์ค์น ํ์ผ์ ์ค์นํด์ฃผ๋ ๋ช ๋ น์ด
configure -> make -> make install ์ ์์๋ก ์์ค๋ก ๋ ํ๋ก๊ทธ๋จ ์ค์น ์งํ
Command 'make' not found
make
์ ๊ด๋ จ๋ ์ค์น๋ฅผ ํ์ง์๋๋ค๋ฉด Command 'make' not found
๋ผ๋ ๋ฉ์ธ์ง๊ฐ ๋์ค๊ธฐ ๋๋ฌธ์ ๋ค์์ ๋ ๋ช
๋ น์ด๋ฅผ ์
๋ ฅํ๋ค.
$ sudo apt install make
$ sudo apt install build-essential
apr-1.7.0 ์ค์น
$ wget http://mirror.navercorp.com/apache//apr/apr-1.7.0.tar.gz
$ tar xvfz apr-1.7.0.tar.gz
$ cd apr-1.7.0
$ ./configure --prefix=/usr/local/apr
./configure --prefix=/usr/local/apr
์ ๋ค์๊ณผ ๊ฐ์ ์๋ฌ๊ฐ ๋ฐ์ํ๋ค๋ฉด,
rm: cannot remove `libtoolT': No such file or directory
๋ค์๊ณผ ๊ฐ์ ๋ช ๋ น์ด๋ก libtoolT์ ๋ณต์ฌํด์ค๋ค.
$ cp -arp libtool libtoolT
๊ทธ ๋ค ๋ค์ ./configure --prefix=/usr/local/apr
๋ช
๋ น์ด๋ฅผ ์คํํ๋ค.
$ make
$ make install
apr-util-1.6.1 ์ค์น
$ wget http://mirror.navercorp.com/apache//apr/apr-util-1.6.1.tar.gz
$ tar xvfz apr-util-1.6.1.tar.gz
$ cd apr-util-1.6.1
$ ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
$ make
$ make install
pcre-8.43 ์ค์น
pcre๋ ์ ๊ท์ ํจํด ์ผ์น๋ฅผ ๊ตฌํํ๋ ํจ์์ ์งํฉ์ผ๋ก ์ํ์น ์ค์น์ ํ์ํ๋ฏ๋ก ์ค์นํด์ฃผ์.
$ cd /usr/local
$ wget ftp://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
$ tar xvfz pcre-8.43.tar.gz
$ cd pcre-8.43
$ ./configure --prefix=/usr/local/pcre
$ make
$ make install
apache 2.4.46 ์ค์น
$ wget http://apache.tt.co.kr//httpd/httpd-2.4.46.tar.gz
$ tar xvfz httpd-2.4.46.tar.gz
$ cd httpd-2.4.46
$ ./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
$ make
$ make install
์คํ ๋ฐ ํ์ธ
- ์คํ ๋ช ๋ น์ด : httpd -k start
- ์ข ๋ฃ ๋ช ๋ น์ด : httpd -k stop
& sudo /usr/local/apache2.4/bin/httpd -k start
์ ๋ช
๋ น์ด๋ก ์คํ ํ ๋ก์ปฌํธ์คํธ(127.0.0.1
)์ ์ ์ํด๋ณด์.
curl
๋ช
๋ น์ด์ ํ์ํ ์์๋ค์ ์ค์นํ ๋ค ๋ช
๋ น์ด๋ก๋ ์ํ์น๊ฐ ์ค์น๋์๋์ง ํ์ธํด๋ณด์.
$ sudo apt-get install net-tools
$ sudo apt install curl
$ sudo curl http://127.0.0.1
Apache๊ฐ ์ ์์ ์ผ๋ก ๋์ํ๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.