접기
1. nginx
nginx는 다음과 같이 쉽게 설치 가능합니다.
root@ubuntu:~# apt-get install nginx
근데 php를 올려야 XE같은 프로그램을 사용할 수 있겠죠?
2. php5
root@ubuntu:~# apt-get -y install php5-cli php5-cgi php5-mysql
3. mysql
apt-get을 이용하여 설치하겠습니다.
root@ubuntu:~# apt-get -y install mysql-server mysql-client
약간의 설정을 위해서 mysql을 정지합니다.
root@ubuntu:~# service mysql stop
root@ubuntu:~# mysqld --skip-grant-tables --skip-networking &
root@ubuntu:~# mysql mysql
mysql> UPDATE user SET password=PASSWORD('설치시 입력했던 비밀번호를 입력하세요') WHERE USER="root" AND Host="localhost";
mysql> quit
root@ubuntu:~# service mysql start
4. nginx + php
root@ubuntu:~# vi /etc/nginx/sites-available/default
에서,
location ~ \.php$ {
fastcgi_pass 127....
...fastcgi_params;
}
부분을 찾아 주석해제 해준다.
또 includefastcgi_params; 부분을
include fastcgi_params;로 띄어쓰기 오타 교정을 해준다.
또 fastcgi_param SCRIPT_FILE..... 부분에서
/scripts가 아니라 /var/www/nginx-default로 바꾼다. 띄어쓰기 하지 말것. 그리고 폴더 뒤에 /도 붙이지 말것!!!
이렇게 하면 nginx 부분 세팅은 끝났다.
이제 마지막으로 spawn_fcgi만 세팅하면 된다.
root@ubuntu:~# cd /usr/local/src
root@ubuntu:/usr/local/src# wget http://www.lighttpd.net/download/lighttpd-1.4.18.tar.bz2
root@ubuntu:/usr/local/src# tar -xvjf lighttpd-1.4.18.tar.bz2
root@ubuntu:/usr/local/src/lighttpd-1.4.1.8# cd lighttpd-1.4.18
root@ubuntu:/usr/local/src/lighttpd-1.4.1.8# ./configure
root@ubuntu:/usr/local/src/lighttpd-1.4.1.8# make
root@ubuntu:/usr/local/src/lighttpd-1.4.1.8# cp src/spawn-fcgi /usr/bin/spawn-fcgi
여기서 가장 중요한건 make install을 하지 말것! 당신은 lighttpd를 설치하기 위해 온것이 아니니까 말이죠.
만약 configure: error: no acceptable C compiler found in $PATH 이런 오류가 나오면 apt-get -y install gcc를 실행할것.
이제 스크립트 몇개만 작성하면 되겠다.
root@ubuntu:~# vi /usr/bin/php-fastcgi
내용은 아래와 같이.
#!/bin/sh
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -f /usr/bin/php5-cgi
저장하고 퍼미션 조정해준다.
root@ubuntu:~# chmod 0755 /usr/bin/php-fastcgi
또하나의 init 스크립트를 작성해야 한다.
root@ubuntu:~# vi /etc/init.d/init-fastcgi
내용은 아래와 같이 할 것.
#!/bin/bash
PHP_SCRIPT=/usr/bin/php-fastcgi
RETVAL=0
case "$1" in
start)
$PHP_SCRIPT
RETVAL=$?
;;
stop)
killall -9 php
RETVAL=$?
;;
restart)
killall -9 php
$PHP_SCRIPT
RETVAL=$?
;;
*)
echo "Usage: php-fastcgi {start|stop|restart}"
exit 1
;;
esac
exit $RETVAL
자 이제 역시 퍼미션 조정을 해주고 실행되게 바꾼다.
root@ubuntu:~# chmod 755 /etc/init.d/init-fastcgi
root@ubuntu:~# update-rc.d init-fastcgi defaults
자 이제 reboot 명령어로 재부팅하여 php 연동을 확인하자.
기본 폴더는, 여기까지 매뉴얼대로 따라왔다면, /var/www/nginx-default 이다.
5. gd, mcrypt 설치하기
다시 보다가 생각했습니다.
XE 등을 설치하려면 gd 라이브러리가 있어야 하고 phpmyadmin을 사용하려면 mcrypt가 있어야겠죠.
보통 우분투는 php5-gd를 설치하면 의존성이 있던데,
제 경우엔 mirror를 kr로 바꿔서 그런 의존성이 없군요. (/etc/apt/sources.list에서 미러를 모두 http://kr.archive.ubuntu.com/ubuntu/로 바꾸면 속도도 빨라지고 좋네요.)
여튼, gd 설치
root@ubuntu:~# apt-get -y install php5-gd
mcrypt 설치
root@ubuntu:~# apt-get -y install php5-mcrypt
접기
더보기
How do I use software from a PPA?
To start installing and using software from a Personal Package Archive, you first need to tell Ubuntu where to find the PPA.
Important: The contents of Personal Package Archives are not checked or monitored. You install software from them at your own risk.
Adding the PPA to Ubuntu 9.10 (Karmic) and later
If you're using the most recent version of Ubuntu (or any version from Ubuntu 9.10 onwards), you can add a PPA to your system with a single line in your terminal.
Step 1: On the PPA's overview page, look for the heading that reads Adding this PPA to your system. Make a note of the PPA's location, which looks like:
ppa:gwibber-daily/ppa
Step 2: Open a terminal and enter:
sudo add-apt-repository ppa:user/ppa-name
Replace ppa:user/ppa-name
with
the PPA's location that you noted above.
![]([:[/2011/05/06/db04670bec63e5a596d5da3f7954e6d6/201105_0.png]:])
Your system will now fetch the PPA's key. This enables your Ubuntu system to verify that the packages in the PPA have not been interfered with since they were built.
![]([:[/2011/05/06/db04670bec63e5a596d5da3f7954e6d6/201105_1.png]:])
Step 3: Now, as a one-off, you should tell your system to pull down the latest list of software from each archive it knows about, including the PPA you just added:
sudo apt-get update
Now you're ready to start installing software from the PPA!
On older (pre 9.10) Ubuntu systems
Step 1: Visit the PPA's overview page in Launchpad. Look for the heading that reads Adding this PPA to your system and click the Technical details about this PPA link.
Step 2: Use the Display sources.list entries drop-down box to select the version of Ubuntu you're using.
Step 3: You'll see that the text-box directly below reads something like this:
deb http://ppa.launchpad.net/gwibber-daily/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/gwibber-daily/ppa/ubuntu jaunty main
Copy those lines.
Step 4: Open a terminal and type:
sudo gedit /etc/apt/sources.list
This will open a text editor containing the list of archives that your system is currently using. Scroll to the bottom of the file and paste the lines you copied in the step above.
Save the file and exit the text editor.
Step 5: Back on the PPA's overview page, look for the Signing key heading. You'll see something like:
1024R/72D340A3 (What is this?)
Copy the portion after the slash but not
including the help link; e.g. just 72D340A3
.
Step 6: Now you need to add that key to your system so Ubuntu can verify the packages from the PPA. In your terminal, enter:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 72D340A3
Replace 72D340A3
with
whatever you copied in the step 5.
This will now pull down the PPA's key and add it to your system.
Step 7: Now, as a one-off, you should tell your system to pull down the latest list of software from each archive it knows about, including the PPA you just added:
sudo apt-get update
Now you're ready to start installing software from the PPA!
Read more about Personal Package Archives in our help wiki.
'PHP' 카테고리의 다른 글
★ php ★ [PHP_JSON]PHP에서 JSON 사용하기 (0) | 2011.05.09 |
---|---|
★ php ★ 공유 클래스 만들기와 Intent 활용 (0) | 2011.05.08 |
★ php ★ imagebutton 에 이미지 예쁘게 잘 넣기 (0) | 2011.05.08 |
★ php ★ 시험도 끝나서 php를 공부하는 중인데, (0) | 2011.05.08 |
★ php ★ php 파일 다운로드 (열기, 저장, 취소) (0) | 2011.05.08 |