thanks for einfach's kind advise , i at last do it.
final nginx.conf is
--------------------
worker_processes 1;
worker_rlimit_nofile 1024;
events {
worker_connections 800;
}
#h>
http {
include mime.types;
default_type application/octet-stream;
index index.html index.htm;
keepalive_timeout 65;
server_tokens off;
server {
listen 80;
listen [::]:80;
server_name localhost; #<-for test
root /var/www/d1;
auth_basic "Restricted";
auth_basic_user_file /var/www/1/.htpasswd;
}
#0
server {
listen 80;
listen [::]:80;
server_name a.mydns.jp;
root /var/www/d0;
auth_basic "Restricted";
auth_basic_user_file /var/www/1/.htpasswd;
}
#1
server {
listen 80;
listen [::]:80;
server_name s.sun.ddns.vc;
root /var/www/d1;
auth_basic "Restricted";
auth_basic_user_file /var/www/1/.htpasswd;
}
#2
server {
listen 80;
listen [::]:80;
server_name k.sun.ddns.vc;
root /var/www/d2;
auth_basic "Restricted";
auth_basic_user_file /var/www/2/.htpasswd;
}
#11
server {
listen 80;
listen [::]:80;
server_name member.planex.ddns.vc;
root /var/www/d11;
auth_basic "Restricted";
auth_basic_user_file /var/www/11/.htpasswd;
}
#12
server {
listen 80;
listen [::]:80;
server_name n.luna.ddns.vc;
root /var/www/d12;
auth_basic "Restricted";
auth_basic_user_file /var/www/12/.htpasswd;
}
#h>
}
and i run openbsd on USB only about 4GB .
so i must use hard sisk .
Filesystem 512-blocks Used Avail Capacity Mounted on
/dev/sd1a 8293692 5045444 2833564 64% /
/dev/sd0a 58566000 30109240 25481432 54% /var/www
so
# cat /etc/rc.local
umount /var/www
mount_ext2fs /dev/sd0a /var/www # <-----ext2fs
if [ -x /usr/local/sbin/nginx ]; then
echo ' ----- Starting nginx ----- '; /etc/rc.d/nginx -f start
fi
because
cat /etc/rc.d/nginx
#!/bin/sh
#
# $OpenBSD: nginx,v 1.1 2012/02/19 11:34:36 robert Exp $
daemon="/usr/local/sbin/nginx" #<------
. /etc/rc.d/rc.subr
pexp="nginx:.*master.*process"
rc_reload() {
${daemon} -s reload
}
rc_stop() {
${daemon} -s stop || pkill -f "^${pexp}"
}
rc_cmd $1
and
cat
/etc/rc.shutdown
umount /var/www/
thanks thanks
--
tuyosi
* <http://marc.info/?a=141679096700003&r=1&w=2>*