일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- 자바
- 프래그먼트
- error
- javascript
- 한글
- 개발자
- ubuntu
- C lanuage
- 개발
- android
- 해석
- unity
- H2O
- 컴퓨터과학총론
- php
- Portfolio
- 구글
- server
- 안드로이드
- it
- java
- NGINX
- techEmpower
- C
- MySQL
- mariadb
- 번역
- caddy
- centOS7
- kakao
- Today
- Total
개발모음집
Centos7 Caddy + php 설치하기 본문
curl https://getcaddy.com | bash -s personal http.cgi
(공홈에서 선택하면 아래 설치 코드를 준다 )
14 curl https://getcaddy.com | bash -s personal http.cgi
15 sudo chown root:root /usr/local/bin/caddy
16 sudo chmod 755 /usr/local/bin/caddy
17 sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/caddy
18 sudo groupadd www-data
19 sudo useradd www-data -d /home/caddy -g www-data -s /sbin/nologin
20 sudo mkdir -p /etc/caddy
21 sudo touch /etc/caddy/Caddyfile
22 sudo mkdir -p /etc/ssl/caddy
23 sudo mkdir -p /var/log/caddy
24 sudo chown -R www-data:www-data /etc/caddy
25 sudo chown -R www-data:root /etc/ssl/caddy
26 sudo chown -R www-data:www-data /var/log/caddy
27 curl -o /etc/systemd/system/multi-user.target.wants https://raw.githubusercontent.com/mholt/caddy/master/dist/init/linux-systemd/caddy.service
28 sudo mkdir /etc/caddy
29 sudo chown -R root:www-data /etc/caddy
30 sudo touch /etc/caddy/Caddyfile
31 sudo mkdir /etc/ssl/caddy
32 sudo chown -R www-data:root /etc/ssl/caddy
33 sudo chmod 0770 /etc/ssl/caddy
34 sudo mkdir /var/www
35 sudo chown www-data:www-data /var/www
36 sudo curl -s https://raw.githubusercontent.com/mholt/caddy/master/dist/init/linux-systemd/caddy.service -o /etc/systemd/system/caddy.service
37 sudo systemctl daemon-reload
38 sudo systemctl enable caddy.service
39 sudo systemctl status caddy.service
40 firewall-cmd --permanent --zone=public --add-service=http
41 firewall-cmd --permanent --zone=public --add-service=https
42 firewall-cmd --reload
참고 블로그
43 echo '<h1>Hello World!</h1>' | sudo tee /var/www/html/index.html
44 sudo nano /etc/caddy/Caddyfile
http:// {
root /var/www
gzip
}
45 sudo systemctl start caddy
46 sudo systemctl status caddy.service
47 sudo nano /etc/caddy/Caddyfile
블로그 참고하여 php-fpm 설치하기
Install PHP
- Install PHP:
sudo yum install php php-mysql php-fpm- Open
php.ini
:sudo vim /etc/php.ini- Find the
cgi.fix_pathinfo
directive, uncomment it by removing the#
and set it to 0:cgi.fix_pathinfo=0- Save and close the file:
:wq!- Open
www.conf
:sudo vim /etc/php-fpm.d/www.conf- Find the
listen
directive (it should be the first), and verify that it is set to listen for PHP traffic using a Unix socket (instead of port 9000):listen = /run/php-fpm/php-fpm.sock- Find the
listen.owner
andlisten.group
directives, uncomment them, and modify them as follows:listen.owner = www-data
listen.group = www-data- Find the
Unix user/group of processes
section, and change theuser
andgroup
fromapache
tonginx
:user = caddy
group = caddy- Save and close the file:
:wq!- Restart PHP:
sudo systemctl restart php-fpmThis creates the neededphp-fpm.sock
file- Change permissions and ownership on
php-fpm.sock
:sudo chmod 666 /run/php-fpm/php-fpm.socksudo chown nginx:nginx /run/php-fpm/php-fpm.sock- Restart PHP again:
sudo systemctl restart php-fpm
==>
49 wget http://ca2.php.net/get/php-7.0.15.tar.gz/from/this/mirror
50 sudo yum install php php-mysql php-fpm
51 reboot
52 vi etc/caddyfile
53 vi /etc/caddy/caddyfile
54 sudo systemctl restart caddy
55 sudo yum install php php-mysql php-fpm
56 sudo vi /etc/php.ini
58 sudo chmod 666 /run/php-fpm/php-fpm.sock
60 sudo chown www-data:www-data /run/php-fpm/php-fpm.sock
61 sudo systemctl restart php-fpm
64 sudo add-apt-repository ppa:ondrej/php5-oldstable
에러
phpinfo.php 파일을 실행시켜봐도 php코드 그대로 출력되지 내가 원하는 php정보들이 나오지 않았다.
/etc/caddy/caddyfile에
http:// {
root /var/www/html
gzip
fastcgi / unix:/var/run/php-fpm/php-fpm.sock php
}
fastcgi / unix:/var/run/php-fpm/php-fpm.sock php를 해주면 해결이 된다.
'Server' 카테고리의 다른 글
centos7 h2o 설치하기 (1) | 2017.10.20 |
---|---|
centos7 apache + php + mariaDB, yum 설치하기 (1) | 2017.10.17 |
centos7에서 nginx + php5 + mariaDB yum 설치하기 (0) | 2017.10.12 |
netcraft september 2017 web Server Survey 한글 번역 (0) | 2017.09.20 |
서버 구글 검색량 순위 (0) | 2017.09.20 |