ããŸããŸVDSãããã€ããŒãé »ç¹ã«å€æŽããå¿ èŠãããããã®ãã³ã«ã·ã¹ãã ãåæ§æããå¿ èŠããã£ããããæ§æã«é¢ããçãèŠçŽãæžãããšã«ããŸããã Linux UbuntuãµãŒããŒ12.04 LTSã§ã¯ã次ã®ãã¹ãŠãæ£åžžã«æ©èœããŸãã ãã®èšäºã§ã¯ãnginx + apache2ãeacceleratorãmemcachedãfure-ftpdãphpãmysqlãphpmyadminãããã³ã²ãŒã ãµãŒããŒã³ã³ãããŒã«ããã«ã®åææ§æãã€ã³ã¹ããŒã«ããŠå®è¡ããæ¹æ³ã«ã€ããŠèª¬æããŸãã
ãŸããããã€ãã®çšèªã®ç°¡åãªèª¬æããå§ããŸãã
VDS-å¥åVPS-ä»®æ³å°çšïŒãã©ã€ããŒãïŒãµãŒããŒ-ä»®æ³ãã·ã³ããµãŒããŒ-å ±æãã¹ãã£ã³ã°ãååã§ãªããå°çšãµãŒããŒãé«äŸ¡ãªå Žåã«å¿ èŠã§ãã VDSã¬ã³ã¿ã«ãµãŒãã¹ã®çŸä»£åžå Žã«ã¯éåžžã«å€ãã®ãããã€ããŒããããããããã«é·æãšçæããããŸããããããã«ã€ããŠã¯èª¬æããŸããã
ä»®æ³åã®ã¿ã€ã-ç°¡åã«èšãã°ããããä»®æ³ãã·ã³ã®ç·šææ¹æ³ã§ãã çŸåšãæãäžè¬çãªã®ã¯OpenVZãšXENã§ãã ããã«ãOpenVZã¯äœã³ã¹ãã§ãããã®ã¿ã€ãã®ä»®æ³åã§ã¯ãããŒããŠã§ã¢ãµãŒããŒã§å®è¡ããããã¹ãŠã®ä»®æ³ãã·ã³ã«å¯ŸããŠããã¹ãã·ã¹ãã ã®ç¹å¥ã«ä¿®æ£ãããã³ã¢ã䜿çšãããããã§ãã ãã®ã¿ã€ãã®ä»®æ³åã®æ¬ ç¹ã¯ãOSã«ãŒãã«ã®ãã©ã¡ãŒã¿ãŒãå€æŽããããšãäžå¯èœã§ãããã»ãšãã©ã®å Žåãéå°è²©å£²ãååšããããšã§ãïŒããã«ã€ããŠã¯åŸã§è©³ãã説æããŸãïŒã ãŸããæ·±å»ãªãããžã§ã¯ãã®å Žåã¯ãXENãŸãã¯KVMä»®æ³åã䜿çšããããšããå§ãããŸããã²ã¹ãOSã¯ãä»®æ³ãã·ã³ã«ã€ã³ã¹ããŒã«ãããŠããããšããç¥ãããOSã䜿çšãããšãç¹ã«XEN-HWMãšKVMã§ãã»ãšãã©äœã§ãã§ããŸãã
éå°è²©å£²-ãããã€ããŒã¯å®éãããå€ãã®ãªãœãŒã¹ã販売ããŠããŸãã ããã¯ã顧客ã100ïŒ ã®å²åã§ãªãœãŒã¹ã䜿çšããããšã¯ãã£ãã«ãªããšããäºå®ã®ããã«æ©èœããŸãããéå°è²©å£²çãé倧è©äŸ¡ããæªåŸ³ãªãããã€ããŒã¯ãã¡ã¢ãªäžè¶³ã«ãã極端ãªãã·ã³æäœãã¹ã¯ãªããã®å€±æãªã©ã®åé¡ãçµéšããå¯èœæ§ããããŸãã XENããã³KVMã§ã®ä»®æ³åã®çš®é¡ã«æ»ããšãéå°è²©å£²ã¯æè¡çã«ã¯äºå®äžäžå¯èœã§ãã
ãã¹ãã£ã³ã°ãããã€ããŒã®éžæ
ãããã£ãŠãVDSãµãŒãã¹ãè³Œå ¥ããããšã«ããŸããã ãããã€ããŒã®éžææ¹æ³ã å°çããå§ããå¿ èŠããããŸã-ãµãŒããŒãå°ççã«é 眮ãããå Žæã
ãã€ã-ãã©ã¹ïŒå®ãé¢çšãé«éãã£ãã«ãç¡å¶éã®ãã©ãã£ãã¯ããã€ãã¹-ãã·ã¢ãžã®ããªã倧ããªé 延-çŽ80ããªç§ããã¬ã³ããã©ãã«ãŒããã¬ã³ãã¯ã©ã€ã¢ã³ãããŠã§ã¢ãŒãºãªã©ã«éåžžã«æ·±å»
ã«ããããªã©ã³ã-åãããšã¯ãã€ãã§ãããããå°ãé«äŸ¡ã§ãããäž»ãªãã©ã¹ã¯ãããŸããŸãªçš®é¡ã®ä¿åããã³éä¿¡ãããæ å ±ã«å¿ å®ãªæ³åŸã§ãã
ç±³åœ-ã»ãšãã©ã®å Žåããã©ãã£ãã¯ãèæ ®ããŠããã·ã¢ãžã®å€§èŠæš¡ãªping-äžè¬ã«ãæè¯ã®éžæè¢ã§ã¯ãããŸããã
ãã·ã¢ããŠã¯ã©ã€ã-ãã·ã¢ã®èŽè¡ãžã®æå°éã®é 延ãã»ãšãã©ã®å Žåãæ¬äŒŒç¡å¶éã®ãã©ãã£ãã¯ïŒäžå®ã®ãããå€ãè¶ ããé床ã®äœäžããŸãã¯çä¿¡/çºä¿¡ã®ãã·ã¢/å€åœãã©ãã£ãã¯ã®å²åã«åŸãå¿ èŠæ§ïŒãæãä¿¡é Œæ§ã®é«ãããŒã¿ã»ã³ã¿ãŒã§ã¯ãªããã»ãšãã©ã®å Žåãããã€ãã®å€§èŠæš¡ãªãµãŒãã¹åæ¢3ã€ã®ç¬ç«ããé»æ°å ¥åãã€ã³ã¿ãŒããããã£ãã«ãšãã£ãŒãŒã«çºé»æ©ã®åé·æ§ã«ãããããããæ°æéã
ä»®æ³åã¿ã€ãã®éžæ
ãªãœãŒã¹ãèš±å¯ããå Žåãããã¯ééããªãKVMãŸãã¯XENã§ãã ãããããã¹ãŠã®ãããã€ããŒããããã®ã¿ã€ãã®ä»®æ³ãã·ã³ãå©çšã§ããããã§ã¯ãªããOpenVZãããå°ããéãããããŸãã ãããã£ãŠããããžã§ã¯ãããã©ãã£ãã¯ã®å°ãªãç¹å®ã®ãµã€ã\ 2 \ 10ïŒ1æ¥ãããæ倧çŽ10,000åã®äžæã®ãã¹ãïŒããã³\ãŸãã¯äœããã®ICQãã£ããã§ãââãå ŽåãOpenVZã§ååã§ãã
ã²ãŒã ãµãŒããŒããããªãã£ããã®ãã¹ããªã©ãããå³ããã¿ã¹ã¯ãå®è¡ããå¿ èŠãããå Žåã¯ãXEN |ãéžæããããšããå§ãããŸãã KVMããVPNãã³ãã«ãäœæããå¿ èŠãããå Žåã¯ããããã®ã¿ã€ãã®ä»®æ³åãéžæããå¿ èŠããããŸãã VPNã¯ãOpenVZãããããã§äœæããæ¹ãç°¡åã§ãã
ãµãŒããŒã®ã»ããã¢ãã
ããã«ããµãŒããŒã§æ§æããããŸããŸãªæ©èœã«ã€ããŠèª¬æããŸããããã€ãã®æ©èœã圹ç«ã€å ŽåããããŸãã ç§ã䜿çšããŠãããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã¯Ubuntu 12.04.1 LTSã§ãã 以äžã§å®è¡ãããã³ãã³ãã®å€§åã¯ã«ãŒãæš©éãå¿ èŠãšããç§ã¯æ ãè ãªã®ã§ãã«ãŒãã®äžã§ãã¹ãŠã®ã¢ã¯ã·ã§ã³ãå®è¡ããŸãã éåžžãã«ãŒãã®ããäžã«ãã°ã€ã³ããããšã¯äžå¯èœã§ãããããsudoç¹æš©ãæã€ãŠãŒã¶ãŒãšããŠãã°ã€ã³ããsudo -sã³ãã³ããå®è¡ããŸãã
ã³ã¢ãåæ§ç¯ãã
OpenVZãéžæããå Žåã¯ãèšäºã®ãã®éšåãå®å šã«ã¹ãããã§ããŸãã
ãã®æé ã¯çç£æ§ã®ç®ã«èŠããå¢å ããããããããã®æé ã¯èªå·±éçºãšãæªæ¥ãžã®å®è·µãã®ããã«ã®ã¿å¿ èŠã§ãã
kernel.orgããææ°ã®å®å®ããã«ãŒãã«ããŒãžã§ã³ã®ãœãŒã¹ã³ãŒããããŠã³ããŒãããŸãã ããã¯çŸåšããŒãžã§ã³3.6.7ã§ãã
wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.6.7.tar.bz2
â¢ã¢ãŒã«ã€ããå±éãã
tar -xjf linux-3.6.7.tar.bz2
â¢ã³ã³ãã€ã«ã«å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ãã
aptitude update aptitude install build-dep linux kernel-package
â¢ãœãŒã¹ãã©ã«ããŒã«ç§»åããŠãã«ãŒãã«æ§æãçæããŸãã ãã®å Žåããã¹ãŠãèªåçã«å®è¡ãããŸããçŸåšã®ããŒããŠã§ã¢ã«å¿ èŠãªã¢ãžã¥ãŒã«ã®ã¿ãã«ãŒãã«ã«å«ãŸããŸãã ã«ãŒãã«ãæåã§æ§æããå Žåã¯ãmake configãŸãã¯make menugonfigã®ãªã¯ãšã¹ãã§googleããŠãã ããã
cd linux-3.6.7 make localyesconfig
â¢ã«ãŒãã«ã®ã³ã³ãã€ã«ãéå§ããŸã-éããªãããã»ã¹ã¯15åããæ°æéã«ãªããŸãã
fakeroot make-kpkg --initrd --append-to-version=-custom kernel_image kernel_headers
â¢äžèšã®ãã£ã¬ã¯ããªã«ç§»åããŠãããã±ãŒãžãã€ã³ã¹ããŒã«ããŸã
cd .. dpkg -i linux-*.deb
â¢åèµ·åããŠãã«ãŒãã«ãèµ·åããŠããããšã確èªããŸãã
reboot uname -r
â¢ä»¥äžããã·ã¹ãã å ã®æ°ããã«ãŒãã«ã§ãã
ã¿ã€ã ãŸãŒã³ãšPCåãå€æŽãã
Ubuntuãèªåã§å°çšãµãŒããŒã«ã€ã³ã¹ããŒã«ããå Žåãã€ã³ã¹ããŒã«äžã«ã·ã¹ãã ã®èšèªãšå°ççãã©ã¡ãŒã¿ãŒãèšå®ããŸãããVDSã®å Žåããããã€ããŒã¯ãµãŒããŒã«ããŒã«ããã·ã¹ãã ã®æ¢è£œã®ã€ã¡ãŒãžãæã£ãŠããŸãã ãŸãããµãŒããŒäžã®ã¿ã€ã ãŸãŒã³ã®æ£ããæå»ã確èªã§ããŠããããã§ãã
â¢ãããã£ãŠãã¿ã€ã ãŸãŒã³ãèšå®ãããã®ããã«ã³ã³ãœãŒã«ã§ã³ãã³ããå®è¡ããŸã
dpkg-reconfigure tzdata
â¢å Žæãéžæããæ¬äŒŒã°ã©ãã£ãã¯ã€ã³ã¿ãŒãã§ã€ã¹ã衚瀺ãããŸãã
â¢çªç¶ïŒãã®ãããªãã®ãèŠãããšããªãïŒæ¥ä»/æå»ã«ççŸãããå Žåã次ã®ã³ãã³ããå®è¡ããŠãçŸåšã®æ¥ä»ãšæå»ã眮ãæããŸãã
hwclock --set --date=â11/24/2012 16:19:55"
â¢ãµãŒããŒåãå€æŽããã«ã¯ã/ etc / hostnameãã¡ã€ã«ãéããå 容ãç®çã®ãµãŒããŒåã«çœ®ãæããŸãã
ããã¯ãšã³ãapache2ãPHPãMySQLãphpmyadminã§nginxãã€ã³ã¹ããŒã«ããŸã
èšäºã®ãã®éšåã§ã¯ãå€æ°ã®æ¥ç¶çšã«èšèšãããWebãµãŒããŒãã€ã³ã¹ããŒã«ããŠæ§æããŸãã
â¢æåã«ãWebãµãŒããŒã®æšæºã®ãåäŸçšãããã±ãŒãžã»ãããã€ã³ã¹ããŒã«ããŸãã
aptitude update aptitude install mysql-server mysql-client libmysqlclient15-dev apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-certlibapache2-mod-php5 libapache2-mod-ruby php5 php5-common php5-curl php5-dev php5-gd php5-idn php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-mysql php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl phpmyadmin g++
â¢MySQLã®ãã¹ã¯ãŒããèšå®ããããã«æ±ãããã次ã«phpmyadminã®åŠçæ¹æ³ãå°ããããŸããApacheã§å¿çããå¿ èŠããããphpmyadminã®ããŒãºã«å¿ããŠMySQLã®ãã¹ã¯ãŒããæ±ããããŸãã
â¢å·çæç¹ã§ã¯ãphpmyadminã¯apache2æ§æã«èªåçã«ç»é²ãããŠããŸããã§ããããã®çµæãã¢ãã¬ã¹site_site.zone / phpmyadminã§ãšã©ãŒ404ã衚瀺ãããããããã¡ã€ã«/etc/apache2/apache2.confãéããŠè¡ãæåŸã«è¿œå ããŸã
Include /etc/phpmyadmin/apache.conf
â¢apache2ã¢ãžã¥ãŒã«ããªã³ã«ãã
a2enmod include a2enmod rewrite a2enmod suexec a2enmod ssl
â¢ããã©ã«ãã®Apacheæ§æãæç»ããŸãã ãããè¡ãã«ã¯ã/ etc / apache2 / sites-available / defaultãéãããã®ãã¡ã€ã«ã®ãã¹ãŠãæ¶å»ããŠã次ã®ããã«èšè¿°ããŸãã
<VirtualHost *:800> ServerAdmin @e-mail DocumentRoot /home/www/_. <Directory /> Options FollowSymLinks AllowOverride All </Directory> <Directory /home/www/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order deny,allow deny from all allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride All Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel crit CustomLog /var/log/apache2/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride All Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
â¢800çªç®ã®ããŒãã瀺ãããŠãããšããäºå®ã¯ãšã©ãŒã§ã¯ãªããnginxã¯httpã®80åã®æšæºããŒãã§ãã³ã°ããŸãã DocumentRootãã©ã¡ãŒã¿ãŒã¯ãç§ã«ã¯ããããªãçç±ã§ã/ var / www / ...ãæå®ããããšããå§ãããŸããç§ã®æèŠã§ã¯ãéèŠãªããŒã¿ã/ homeã«ä¿åããæ¹ãè«ççã§ããããã¯ã¢ãããã»ããã¢ããããæ¹ãç°¡åã§ãã
â¢ãã¡ã€ã«/etc/apache2/ports.confãç·šéããŸã
NameVirtualHost *:800 Listen 800
â¢ãã¡ã€ã«/ etc / apache2 / sites-available / defaultã/ etc / apache2 / sites-enabled / site_addressã«ã³ããŒããŸã
â¢ä»¥äžã®ããã«ããµã€ãã®ã¢ãã¬ã¹ã§æ§æããããã£ã¬ã¯ããªãšãã¡ã€ã«ã«ååãä»ããæ¹ãè¯ã å°æ¥çã«ã¯ãããã«ãããå¿ èŠãªconfigs \ãã£ã¬ã¯ããªã®æ€çŽ¢ãç°¡åã«ãªããŸãïŒäŸïŒ/home/www/tweedle.ru /etc/apache2/sites-enabled/tweedle.ru
â¢/etc/apache2/apache2.confãã¡ã€ã«ãç·šéããŸã-MaxClientsãã©ã¡ãŒã¿ãŒã®å€ã20ã«å€æŽããŸããããã¯2ã€ã®å Žæã§è¡ãå¿ èŠããããŸãã
â¢nginxãªããžããªãèŠå®ããŸãããã®ããã«ããã¡ã€ã«/etc/apt/sources.listãéããæåŸã«è¿œå ããŸã
deb http://nginx.org/packages/ubuntu/ precise nginx deb-src http://nginx.org/packages/ubuntu/ precise nginx
â¢nginxãšapache2-mod-rpafãã€ã³ã¹ããŒã«ããŸã
wget http://nginx.org/keys/nginx_signing.key apt-key add nginx_signing.key aptitude update aptitude install libapache2-mod-rpaf libpcre3 libpcre3-dev nginx
â¢æ¬¡ã«ãnginxãèšå®ããŸãããã®ããã«ããã¡ã€ã«/usr/local/etc/nginx/nginx.confãéããå 容ã次ã®ãã®ã«çœ®ãæããŸãã
user www-data; worker_processes 1; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; events { worker_connections 1024; } http { include /etc/nginx/mime.types; default_type application/octet-stream; server_names_hash_bucket_size 64; access_log /var/log/nginx/access.log; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; tcp_nodelay on; gzip on; gzip_proxied any; gzip_min_length 300; gzip_http_version 1.0; gzip_buffers 4 8k; gzip_comp_level 9; gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript; } include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*;
â¢WebãµãŒããŒã®åœ¹å²ããµãŒããŒã®äž»ãªåœ¹å²ã§ããå Žåãããã³/ãŸãã¯ãµã€ãã®ãã©ãã£ãã¯ãå€ãå Žåãworker_processeså€ã䜿çšå¯èœãªCPUã³ã¢ã®æ°ã«èšå®ããŸããããã§ãªãå Žåã1ã€ã®ããã»ã¹ã§ååã§ã
â¢ãµã€ã/etc/nginx/sites-enabled/site_address.zoneã®æ§æãäœæããŸã
server { listen 80; server_name _.; access_log /var/log/nginx.access_log; location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx|mp3|bsp)$ { root /home/www/_./; index index.php index.html index.htm; access_log off; expires 30d; } location ~ /\.ht { deny all; } location / { proxy_pass http://127.0.0.1:800/; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-for $remote_addr; proxy_set_header Host $host; proxy_connect_timeout 60; proxy_send_timeout 90; proxy_read_timeout 90; proxy_redirect off; proxy_set_header Connection close; proxy_pass_header Content-Type; proxy_pass_header Content-Disposition; proxy_pass_header Content-Length; } }
â¢memcachedãã€ã³ã¹ããŒã«ããŸããè¿œå ã®èšå®ã¯å¿ èŠãããŸãã
aptitude install memcached
â¢eAcceleratorãã€ã³ã¹ããŒã«ãã
aptitude install php5-dev aptitude install make cd /tmp/ wget https://github.com/downloads/eaccelerator/eaccelerator/eaccelerator-0.9.6.1.tar.bz2 tar xvjf eaccelerator-0.9.6.1.tar.bz2 cd eaccelerator-0.9.6.1
â¢ããã§ãeAcceleratorãã³ã³ãã€ã«ããåã«ãã³ãŒãã®1ã€ã®ãã°ãä¿®æ£ããŸããããã«ãããããããçš®é¡ã®åé¡ãçºçããŸããããšãã°ãphpmyadminã§ã®æ¿èªãæ©èœããªããªããŸãã 867è¡ç®ã®
if (php_check_open_basedir(realname TSRMLS_CC)) {
ãã¡ã€ã«ãéããŸã
if (php_check_open_basedir(realname TSRMLS_CC)) {
ã
if (php_check_open_basedir(p->realfilename TSRMLS_CC)) {
ãŸã
if (php_check_open_basedir(p->realfilename TSRMLS_CC)) {
ä¿åããŠç¶è¡...
phpize ./configure --enable-eaccelerator=shared make make install
â¢ãã£ãã·ã¥çšã®ãã©ã«ããŒãäœæããæš©éãä»äžããŸã
mkdir -p /var/cache/eaccelerator chmod 0777 /var/cache/eaccelerator
â¢eacceleratorã§åäœããããã«phpãæ§æããŸãããã®ããã«ããã¡ã€ã«/etc/php5/apache2/php.iniãéããŠäžã«è¿œå ããŸã
[PHP] extension = "eaccelerator.so" eaccelerator.shm_size = "16" eaccelerator.cache_dir = "/var/cache/eaccelerator" eaccelerator.enable = "1" eaccelerator.optimizer = "1" eaccelerator.check_mtime = "1" eaccelerator.debug = "0" eaccelerator.filter = "" eaccelerator.shm_max = "0" eaccelerator.shm_ttl = "0" eaccelerator.shm_prune_period = "0" eaccelerator.shm_only = "0" eaccelerator.compress = "1" eaccelerator.compress_level = "9" eaccelerator.allowed_admin_path = "/var/www/eaccelerator"
â¢ãµãŒãã¹ãåèµ·åãããµã€ãã/ home / www / site_nameã«ããããšã確èªããŸã
service apache2 restart service nginx restart service memcached restart
â¢çŸåšã100MBæªæºã®RAMãæ¶è²»ããããªãé«éã®WebãµãŒããŒããããŸãã TodoïŒæ¬ ç¹ã1ã€ãããŸã-phpmyadminã¯ã¢ãã¬ã¹site.zoneã§å©çšå¯èœã§ã/ phpmyadmin㯠ïŒãïŒåçãªãïŒã§è¡šç€ºãããŸããäžæçãªè§£æ±ºçã¯ãã¢ãã¬ã¹site.zone㧠phpmyadminãéãããšã§ãïŒ800 / phpmyadmin
pure-ftpd MySQL FTPãµãŒããŒã®ã€ã³ã¹ããŒã«
FTPãµãŒããŒã¯ããµãŒããŒãããµãŒããŒãžã®æ å ±ã®ç°¡åãã€è¿ éã§äŸ¿å©ãªè»¢éã«åœ¹ç«ã¡ãŸãã
â¢mysqlãµããŒãä»ãã®pure-ftpdã®ã€ã³ã¹ããŒã«
aptitude install pure-ftpd-mysql
â¢ftpãŠãŒã¶ãŒãšãã®äžã®ãŠãŒã¶ãŒçšã®ã°ã«ãŒããäœæããŸããããã¯ããµãŒããŒäžã§äœãèµ·ãã£ãŠããããç£èŠããã®ããã䟿å©ã«ããããã«è¡ãããŸãã
groupadd -g 4001 ftpusers && useradd -u 4001 -s /bin/false -d /bin/null -c "pureftpd user" -g ftpusers ftp
â¢pure-ftpdçšã®ããŒã¿ããŒã¹ãMySQLã§äœæããŸãã ããã¯phpmyadminã䜿çšããŠå®è¡ã§ããŸããã匷åã§åŒ·åãªã³ããŒã¢ã³ãããŒã¹ãã䜿çšãããšãã³ã³ãœãŒã«ã§é«éã«å®è¡ã§ããŸã
mysql -u root âp
CREATE DATABASE pureftpd; GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP ON pureftpd.* TO 'pureftpd'@'localhost' IDENTIFIED BY '__pureftpd'; FLUSH PRIVILEGES;
â¢FTPã¢ã«ãŠã³ããä¿åãããããŒãã«ãäœæããŸãã
USE pureftpd; CREATE TABLE ftpd ( User varchar(16) NOT NULL default '', status enum('0','1') NOT NULL default '0', Password varchar(64) NOT NULL default '', Uid varchar(11) NOT NULL default '-1', Gid varchar(11) NOT NULL default '-1', Dir varchar(128) NOT NULL default '', ULBandwidth smallint(5) NOT NULL default '0', DLBandwidth smallint(5) NOT NULL default '0', comment tinytext NOT NULL, ipaccess varchar(15) NOT NULL default '*', QuotaSize smallint(5) NOT NULL default '0', QuotaFiles int(11) NOT NULL default 0, PRIMARY KEY (User), UNIQUE KEY User (User) ) ENGINE=MyISAM; quit;
â¢æ¬¡ã«ãpure-ftpdãæ§æããŸãããã®ããã«ããã¡ã€ã«/etc/pure-ftpd/db/mysql.confãéãããã®å 容ã次ã®ããã«ããŸãã
MYSQLSocket /var/run/mysqld/mysqld.sock MYSQLUser pureftpd MYSQLPassword __pureftpd MYSQLDatabase pureftpd MYSQLCrypt md5 MYSQLGetPW SELECT Password FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MYSQLGetUID SELECT Uid FROM ftpd WHERE User="\L" AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MYSQLGetGID SELECT Gid FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MYSQLGetDir SELECT Dir FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MySQLGetBandwidthUL SELECT ULBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MySQLGetBandwidthDL SELECT DLBandwidth FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MySQLGetQTASZ SELECT QuotaSize FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R") MySQLGetQTAFS SELECT QuotaFiles FROM ftpd WHERE User="\L"AND status="1" AND (ipaccess = "*" OR ipaccess LIKE "\R")
â¢æ¬¡ã«ããŠãŒã¶ãŒã®ããŒã ãã£ã¬ã¯ããªãååšããªãå Žåã¯èªåçã«äœæãããããã«ããŸã
echo "yes" > /etc/pure-ftpd/conf/CreateHomeDir
â¢æ¬¡ã®ã³ãã³ãã¯ãããŒã ãã£ã¬ã¯ããªãããäžäœã®ãã£ã¬ã¯ããªãžã®ã¢ã¯ã»ã¹ããŠãŒã¶ãŒã«èš±å¯ããŸããã
echo "yes" > /etc/pure-ftpd/conf/ChrootEveryone
â¢æåŸã«ããŠãŒã¶ãŒã®ãã¹ãåæ€èšŒããªãã«ããŸã-ããã«ãããèªèšŒããã»ã¹ãå€§å¹ ã«é«éåããããã©ãã£ãã¯éããããã«æžå°ããŸãã
echo "yes" > /etc/pure-ftpd/conf/DontResolve
â¢ãµãŒãã¹ãåèµ·åããŠèšå®ãé©çšãã
service pure-ftpd-mysql restart
â¢ããã§ãGIDããã³UID 4002ãããŒã ãã£ã¬ã¯ããª/ home / wwwãããŠã³ããŒã/ã¢ããããŒãã®é床å¶éãæ¯ç§1ã¡ã¬ãã€ãã«èšå®ããå æãã£ã¹ã¯å®¹éãå¶éããªãwww-ftpãŠãŒã¶ãŒãäœæããŸãã ã³ãã³ãã©ã€ã³ã䜿çšããŠäŸã瀺ããŸããphpmyadminã§ãSQLã¯ãšãªã®å®è¡ãã䜿çšããããphpmyadminã§ãè¡ã®è¿œå ãã䜿çšããããšãã§ããŸãããã ãããã®å ŽåãããŒã¿ããŒã¹ã®ãã¹ã¯ãŒããmd5ããã·ã¥ãšããŠä¿åããããšããäºå®ãå°ç¡ãã«ããå¿ èŠã¯ãããŸãããããã³ãã¹ã¯ãŒããã£ãŒã«ãã§ãæ©èœãmd5ãéžæããŸã
mysql -u root -p
USE pureftpd; INSERT INTO `ftpd` (`User`, `status`, `Password`, `Uid`, `Gid`, `Dir`, `ULBandwidth`, `DLBandwidth`, `comment`, `ipaccess`, `QuotaSize`, `QuotaFiles`) VALUES ('www-ftp', '1', MD5('___www-ftp'), '4002', '4002', '/home/www', '1024', '1024', '', '*', '0', '0'); quit;
â¢ããã ãã§ãããã°ã€ã³www-ftpãšæå®ããããã¹ã¯ãŒãã䜿çšããŠã site_site.zonaã®ã¢ãã¬ã¹ã«ããFTPãµãŒããŒã«æ¥ç¶ãè©Šã¿ãããšãã§ããŸãã
â¢FTPãããã³ã«ãä»ããŠããŒã¿ã誀ã£ãæã«æž¡ããªãããã«è»¢éããå Žåã¯ãTLSæå·åãèšå®ããå¿ èŠã¯ãããŸããã ãããè¡ãã«ã¯ã次ãå®è¡ããŸãã
echo 1 > /etc/pure-ftpd/conf/TLS mkdir -p /etc/ssl/private/
â¢opensslããã±ãŒãžãã€ã³ã¹ããŒã«ãããŠããªãå Žåã¯ã€ã³ã¹ããŒã«ãã蚌ææžãçæããŸãã
aptitude update aptitude install openssl openssl req -x509 -nodes -days 3652 -newkey rsa:2048 -keyout /etc/ssl/private/pure-ftpd.pem -out /etc/ssl/private/pure-ftpd.pem
â¢è³ªåã«çããŸã-ãã®ããŒã¿ã¯äœæããã蚌ææžã«è¡šç€ºãããŸãã
â¢èšŒææžãžã®ã¢ã¯ã»ã¹æš©ãèšå®ããpure-ftpdãåèµ·åããŸã
chmod 600 /etc/ssl/private/pure-ftpd.pem service pure-ftpd-mysql restart
â¢ããã ãã§ãã ããŒã¿ãæå·åããã«ã¯ãã¯ã©ã€ã¢ã³ãåŽã§TLSæå·åãæå¹ã«ããå¿ èŠãããããã¹ãŠã®FTPã¯ã©ã€ã¢ã³ããããããµããŒãããŠããããã§ã¯ãªãããšã«æ³šæããŠãã ããã
ã²ãŒã ãµãŒããŒç®¡çã³ã³ãã¬ãã¯ã¹ã®ã€ã³ã¹ããŒã«-ã²ãŒã ããã«ãéã
ãªãŒãã³ã²ãŒã ããã«ïŒå¥åOGPïŒã¯ãããŸããŸãªã²ãŒã ãµãŒããŒãç£èŠããã³ç®¡çã§ããå¯äžã®ç¡æãœãªã¥ãŒã·ã§ã³ã§ãã å·çæç¹ã§ã¯ãWindowsããã³Linuxãã©ãããã©ãŒã äžã®ãµãŒããŒãåãã50çš®é¡ä»¥äžã®ã²ãŒã ããµããŒããããŠããŸãã Counter-StrikeïŒ2Dã1.5ã1.6ãSourceãGOïŒããã³MinecraftïŒVanillaãBukkitïŒãªã©ã®äžè¬çãªãã®ãå«ã
è€åäœã¯2ã€ã®éšåã§æ§æãããŸã-ç£èŠãšå¶åŸ¡ïŒããã³ããšã³ãïŒãå®è¡ããWebéå£ãšãã²ãŒã ãµãŒããŒãåãããã·ã³ã«ãã³ã°ã¢ããããŠããã³ããšã³ãã«ãã°ã転éãããšãŒãžã§ã³ããµãŒãã¹ãšãããã³ããšã³ãããã²ãŒã ãµãŒããŒã«ããŒã ã転éããŸãã
â¢ãŸãã httpïŒ//www.opengamepanel.orgã§ç»é²ããŸããããã¯ã€ã³ã¹ããŒã«ã«ã¯å¿ èŠãããŸããããè¿œå ã®ã¢ãžã¥ãŒã«ïŒèª²éã·ã¹ãã ãªã©ïŒãããŒãããã®ä»ã®ã°ããºããµã€ãã«ããŠã³ããŒãã§ããŸãã
â¢å¿ èŠãªããã±ãŒãžãã€ã³ã¹ããŒã«ãã
aptitude update aptitude install libxml-parser-perl libpath-class-perl libarchive-any-perl screen
â¢ã·ã¹ãã ãx64ã®å Žåãè¿œå ã§ia32-libsãã€ã³ã¹ããŒã«ããŸã
aptitude install ia32-libs
â¢ãšãŒãžã§ã³ãèªäœãããŠã³ããŒããã
wget "http://www.opengamepanel.org/downloads/ogp_agent_nightly.tar.gz" -O agent.tar.gz tar xf agent.tar.gz cd agent
â¢ã€ã³ã¹ããŒã«ã 泚æ-以åã«ã·ã¹ãã ã§ãŠãŒã¶ãŒãäœæããrootããã³sudoã°ã«ãŒãã«å«ãããŠãŒã¶ãŒã®ããŒã ãã£ã¬ã¯ããªãäœæããŸãããããã¯ããšãŒãžã§ã³ããæ£ããæ©èœããããã«å¿ èŠãªãã¹ãŠã§ãã
bash ./install.sh
â¢ãµãŒãã¹ãã¹ãã³ãããŠãŒã¶ãŒåãå°ããããŸããåã®æ®µèœã§è©±ãããã®ããã¹ã¯ãŒããå®è¡å¯èœãã¡ã€ã«ïŒ/ home /ãŠãŒã¶ãŒå/ OGPïŒãé 眮ããããã£ã¬ã¯ããªãæå®ããå¿ èŠãããããšãŒãžã§ã³ãããŒã®å ¥åãæ±ããããŸã-ããã¯ãŠãŒã¶ãŒãã¹ã¯ãŒãã§ã¯ãªãããšãŒãžã§ã³ã管çããŒã§ãããåŸã§åœ¹ç«ã¡ãŸãããŸããSteamããªã·ãŒã«ãŒã«ã«åæããããæ±ããããŸãã
â¢ã€ã³ã¹ããŒã«åŸãäœæãããŠãŒã¶ãŒã§ãã°ã€ã³ããŠå®è¡ããŸã
cd /home/ /OGP perl ./ogp_agent.pl --log-stdout
â¢ãã¹ãŠãæ£åžžã§ãããããã»ã¹ãéå§ãããããŒã12679ã§ãªãã¹ã³ããŠããããšãé£çµ¡ããå¿ èŠããããŸãã
â¢ctrl + cãæŒããŠãã«ãŒãã®äžã«ãã°ã€ã³ããŠç»é²ããŸããããã¯ãã·ã¹ãã ã®èµ·åæã«ãµãŒãã¹ãéå§ãããããã«ããããã«å¿ èŠã§ãã
update-rc.d ogp_agent defaults
â¢è€æ°ã®ãµãŒããŒïŒå°çšãŸãã¯ä»®æ³ïŒãããå Žåãããããã«ãšãŒãžã§ã³ããã€ã³ã¹ããŒã«ããå¿ èŠããããŸã
â¢æ¬¡ã«ãOGPããWebã€ã³ã¿ãŒãã§ã€ã¹ãã€ã³ã¹ããŒã«ããã¢ãŒã«ã€ããããŠã³ããŒãããŠè§£åããŸã
wget "http://www.opengamepanel.org/downloads/ogp_web_nightly.tar.gz" -O upload.tar.gz tar xf upload.tar.gz
â¢ã¢ããããŒããã©ã«ããŒã®ã³ã³ãã³ããããµã€ãããããã©ã«ããŒã«ç§»åãã
â¢ãã©ãŠã¶ãŒã§ã site_address.zone / folder_c_ogpãéããèšèªãéžæããŸãããã¡ã€ã«ãŸãã¯ãã©ã«ããŒãäœæããããã®ååãªæš©éããªãããšãçªç¶éç¥ãããå Žåãchmodã§777ã®ã¢ã¯ã»ã¹èš±å¯ãä»äžããŸãããã®ãããogpã§ãã©ã«ããŒã«ç§»åããŠã³ãã³ããå®è¡ããŸãã
chmod 777 âv âR *
â¢Webã€ã³ã¿ãŒãã§ã€ã¹ã«æ»ãããåè©Šè¡ããã¯ãªãã¯ããŠããã次ãžããã¯ãªãã¯ããŸã
â¢ããŒã¿ããŒã¹ã«æ¥ç¶ããããã®ãã©ã¡ãŒã¿ãŒãæå®ããã次ãžããã¯ãªãã¯ããŸã
â¢ç®¡çè ã¢ã«ãŠã³ããç»é²ããã次ãžããã¯ãªãã¯ããŸã
â¢æ¬¡ã«ãæ瀺ã«åŸããŸãã次ã®èšäºã§ã¯ããµãŒããŒãOGPã«è¿œå ããããã»ã¹ã«ã€ããŠèª¬æããŸãã