
VirtualBox
내 Mac에 설치했고 settings
VitualBox로 변경했습니다 Adapter 1 - Attached to: Host-only Adapter, Name: vboxnet0
. 게스트 추가 기능 '설정' > '공유 폴더' > '새 공유 폴더 정의 추가'를
설치하세요 .
./VBoxLinuxAdditions.run
> '자동 마운트'
domain1.com.localhost
쇼를 방문할 때 No input file specified..
폴더가 존재하는지 확인하고 마운트 성공으로 보이는지 확인
하고 access.log 쇼를 확인 404
하므로 폴더 /media/sf_Sites
권한이 잘못된 것인지 의심됩니다. 아니면 내가 그리워하는 것??
ls -l /media/sf_Sites
drwxrwx---. 1 root vboxsf domain1.com
vi /etc/nginx/nginx.conf
user nginx;
vi /etc/nginx/conf.d/default.conf
server {
listen 80;
server_name domain1.com.localhost www.domain1.com.localhost
access_log /var/log/nginx/domain1.com.access.log;
root /media/sf_Sites/domain1.com;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php?$query_string;
location /robots.txt {
alias /media/sf_Sites/domain1.com/app/robots.txt;
}
location ^/(images/|javascripts) {
root /media/sf_Sites/domain1.com/app/assets;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 32k;
fastcgi_buffers 8 32k;
}
}
내 Mac에서
sudo vi /etc/hosts
192.168.56.101 domain1.com.localhost
업데이트
폴더를 /var/www/html/에 마운트합니다.
mkdir /var/www/html/Sites
mount -t vboxsf Sites -o rw,dmode=777,gid=0,uid=0 /var/www/html/Sites
nginx 구성을 변경하고 root /var/www/html/Sites
시도해
domain1.com.localhost
보세요 403 Forbidden
.
domain1.com.localhost/info.php
No input file specified
domain1.com.localhost/index.html
No input file specified
ls -l /var/www/html/Sites
-rwxrwxrwx. 1 루트 루트 index.html -rwxrwxrwx. 1 루트 루트 info.php drwxrwxrwx. 1 루트 루트 domain1.com
하지만 로그인한 virtualbox 루트 사용자로 파일을 생성하고 index.html 파일을 생성 /var/www/html/index.html
하고 nginx config root를 변경하면 해당 파일을 방문할 수 있습니다.
왜???
나는 또한 nginx 사용자를 변경하고 있습니다.
vi /etc/nginx/nginx.conf
user nginx; > user root;
아직도 작동하지 않아...