{"id":9,"date":"2013-07-02T15:08:38","date_gmt":"2013-07-02T12:08:38","guid":{"rendered":"http:\/\/www.brf.kiev.ua\/?p=9"},"modified":"2013-07-02T15:10:19","modified_gmt":"2013-07-02T12:10:19","slug":"%d1%83%d1%81%d1%82%d0%b0%d0%bd%d0%be%d0%b2%d0%ba%d0%b0-%d0%b8-%d0%bd%d0%b0%d1%81%d1%82%d1%80%d0%be%d0%b9%d0%ba%d0%b0-apache-php-mysql-%d0%bd%d0%b0-freebsd","status":"publish","type":"post","link":"https:\/\/www.brf.kiev.ua\/?p=9","title":{"rendered":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Apache + PHP + MySQL \u043d\u0430 FreeBSD"},"content":{"rendered":"<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0436\u0435 \u0434\u043b\u044f\u00a0<strong>FreeBSD<\/strong>.<\/p>\n<p>\u0411\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0437 \u043f\u043e\u0440\u0442\u043e\u0432.<\/p>\n<p><!--more--><\/p>\n<p><strong>Apache<\/strong>:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>cd \/usr\/ports\/www\/apache22<br \/>\nmake&amp;&amp;make install&amp;&amp;make clean<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>PHP<\/strong>:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>cd \/usr\/ports\/lang\/php5<br \/>\nmake&amp;&amp;make install&amp;&amp;make clean<\/strong><br \/>\n<strong>cd \/usr\/ports\/lang\/php5-extensions\/<br \/>\n<strong>make&amp;&amp;make install&amp;&amp;make clean<\/strong><\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>MySQL<\/strong>:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>cd \/usr\/ports\/databases\/mysql51-server<br \/>\nmake&amp;&amp;make install&amp;&amp;make clean<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u00a0<strong>Apache<\/strong>\u00a0\u0438\u00a0<strong>MySQL<\/strong>\u00a0\u043f\u0440\u0438 \u0441\u0442\u0430\u0440\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0444\u0430\u0439\u043b\u00a0<strong>\/etc\/rc.conf<\/strong>\u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>apache22_enable=\u201dYES\u201d<br \/>\nmysql_enable=\u201dYES\u201d<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c\u00a0<strong>Apache<\/strong>\u00a0\u0438\u00a0<strong>MySQL<\/strong>:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>\/usr\/local\/etc\/rc.d\/mysql-server start<br \/>\napachectl start<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u00a0<strong>root\u00a0<\/strong>\u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>mysqladmin -u root password &#8216;\u043c\u0435\u0433\u0430\u0441\u043b\u043e\u0436\u043d\u044b\u0439\u043f\u0430\u0440\u043e\u043b\u044c&#8217;<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435.<\/p>\n<p>\u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0434\u043b\u044f \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438\u00a0<strong>Apache<\/strong><strong>\/usr\/local\/etc\/apache22\/httpd.conf,<\/strong>\u00a0\u0438\u0449\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441\u00a0<strong>AddType<\/strong>\u00a0\u0438 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0442\u0443\u0434\u0430:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>AddType application\/x-httpd-php\u00a0\u00a0\u00a0 .php<br \/>\nAddType application\/x-httpd-php-sourse\u00a0\u00a0\u00a0 .phps<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u042d\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e \u0431\u044b \u0441\u0435\u0440\u0432\u0435\u0440 \u0437\u043d\u0430\u043b \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438\u00a0<strong>php<\/strong>\u00a0\u0438<strong>phps<\/strong>.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0438\u043c\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0445\u043e\u0441\u0442\u0430:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>ServerName localhost<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0427\u0442\u043e \u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c Web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043e\u0442\u0440\u044b\u0432\u0430\u0435\u043c \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c\u00a0<strong>localhost,\u00a0<\/strong>\u0435\u0441\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u0430\u0434\u043f\u0438\u0441\u044c\u00a0<strong>\u201cIt works!\u201d,<\/strong>\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e.<\/p>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443\u00a0<strong>php<\/strong>. \u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435\u00a0<strong>\/usr\/local\/www\/apache22\/data\/\u00a0<\/strong>\u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b\u00a0<strong>index.php\u00a0<\/strong>\u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>&lt;?phpinfo()?&gt;<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0412 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c\u00a0<strong>localhost\/index.php,\u00a0<\/strong>\u0434\u043e\u043b\u043d\u0430 \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e\u00a0<strong>php<\/strong>.<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043d\u0430 \u043d\u0430\u0448\u0435\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043b\u0435\u0436\u0438\u0442 \u043e\u0434\u0438\u043d \u0441\u0430\u0439\u0442, \u0444\u0430\u0439\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0430\u043f\u043a\u0435\u00a0<strong>\/usr\/local\/www\/apache22\/data\/.\u00a0\u00a0<\/strong>\u0415\u0441\u043b\u0438 \u0436\u0435 \u0432\u0430\u043c \u043c\u0430\u043b\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u043e \u043f\u0440\u0438\u0434\u0435\u0442\u0441\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u043e\u0432.<\/p>\n<p>\u041d\u0430\u0448\u0438 \u0441\u0430\u0439\u0442\u044b \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0432 \u043f\u0430\u043f\u043a\u0435\u00a0<strong>\/usr\/local\/www\/<\/strong>, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0444\u0430\u0439\u043b\u0430<strong>http.conf\u00a0<\/strong>\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>&lt;Directory &#171;\/usr\/local\/www\/*&#187;&gt;<br \/>\nOptions Indexes FollowSymLinks<br \/>\nAllowOverride None<br \/>\nOrder allow,deny<br \/>\nAllow from all<br \/>\n&lt;\/Directory&gt;<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0442\u0440\u043e\u043a\u0443:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>NameVirtualHost *:80<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0438<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>Include etc\/apache22\/sites-enabled\/*<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u0443 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u043e\u0432. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u044d\u0442\u0443 \u043f\u0430\u043f\u043a\u0443 \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>mkdir \/usr\/local\/etc\/apache22\/sites-enabled<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0412 \u043d\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>&lt;VirtualHost *:80&gt;<br \/>\nServerName example.com<br \/>\nDocumentRoot \/usr\/local\/www\/example.com<br \/>\n&lt;\/VirtualHost&gt;<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0445\u043e\u0441\u0442\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043b\u0438\u0448\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u0441\u0430\u0439\u0442\u0430, \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c\u00a0<strong>example.com<\/strong>\u00a0\u043d\u0430 \u043d\u043e\u0432\u043e\u0435 \u0438\u043c\u044f \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441\u0430\u0439\u0442\u0430, \u0441 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0438\u043c\u0435\u043d\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0435\u00a0<strong>\/usr\/local\/www\/.<\/strong><\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u043b\u0438 \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0430\u0439\u0442\u00a0<strong>bestsite.com<\/strong>\u00a0\u0442\u043e \u0443 \u043d\u0430\u0441 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u0430\u043f\u043a\u0430<strong>\/usr\/local\/www\/bestsite.com<\/strong>\u00a0\u0438 \u0444\u0430\u0439\u043b\u00a0<strong>\/usr\/local\/etc\/apache22\/sites-enabled\/bestsite.com<\/strong>\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>&lt;VirtualHost *:80&gt;<br \/>\nServerName bestsite.com<br \/>\nDocumentRoot \/usr\/local\/www\/bestsite.com<br \/>\n&lt;\/VirtualHost&gt;<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u00a0<strong>Apache<\/strong>:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>apachectl restart<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0438 \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430\u00a0<strong>bestsite.com<\/strong>.<\/p>\n<p>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f\/\u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0445\u043e\u0441\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e:<\/p>\n<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"500\"><strong>#!\/bin\/sh<\/strong>#Add function<br \/>\n<strong>add_site()<br \/>\n{<br \/>\necho &#171;Creating new site&#187;<br \/>\nsleep 1<br \/>\necho -n\u00a0 &#171;Please, enter the name of site:&#187;<\/strong><\/p>\n<p>while read SITE<br \/>\ndo<br \/>\nif<br \/>\n[ &#171;$SITE&#187; != &#171;&#187; ]<br \/>\nthen<br \/>\nDIR=&#187;\/usr\/local\/www\/$SITE&#187;<br \/>\nFILE=&#187;\/usr\/local\/etc\/apache22\/sites-enabled\/$SITE&#187;<br \/>\nif<br \/>\n[ -d $DIR ]<br \/>\nthen<br \/>\necho\u00a0 &#171;Site with that name already exists&#187;<br \/>\necho\u00a0 &#171;Please try again with correct name&#187;<br \/>\nexit 1<br \/>\nelse<br \/>\ntouch $FILE<br \/>\necho\u00a0 &#171;Creating settings file $FILE&#187;<br \/>\nsleep 1<br \/>\necho &#171;&lt;VirtualHost *:80&gt;<br \/>\nServerName $SITE<br \/>\nDocumentRoot $DIR<br \/>\n&lt;\/VirtualHost&gt;&#187; &gt;&gt;$FILE<\/p>\n<p><strong>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 echo &#171;Creating directory for site $DIR&#187;<br \/>\nsleep 1<br \/>\nmkdir -p $DIR<br \/>\nchmod -R 777 $DIR<br \/>\necho &#171;127.0.0.1 $SITE&#187; &gt;&gt; \/etc\/hosts<br \/>\necho\u00a0 &#171;Restarting Apache&#187;<br \/>\nsleep 1<br \/>\napachectl restart<br \/>\necho\u00a0 &#171;Congratulations, the site $SITE has been successfully added&#187;<br \/>\nexit 0<br \/>\nfi<br \/>\nfi<br \/>\necho &#171;You have not entered a name&#187;<br \/>\necho -n &#171;Please, enter the name of the site or CTRL+Z to exit:&#187;<br \/>\ndone<br \/>\n}<\/strong><\/p>\n<p>#function for removing<br \/>\n<strong>rm_site()<br \/>\n{<br \/>\necho &#171;Removing site&#187;<br \/>\necho -n &#171;Please, enter the site name:&#187;<br \/>\nwhile read SITE<br \/>\ndo<br \/>\nif<br \/>\n[ &#171;$SITE&#187; != &#171;&#187; ]<br \/>\nthen<br \/>\nDIR=&#187;\/usr\/local\/www\/$SITE&#187;<br \/>\nFILE=&#187;\/usr\/local\/etc\/apache22\/sites-enabled\/$SITE&#187;<br \/>\nif<br \/>\n[ -d $DIR ]<br \/>\nthen<br \/>\necho &#171;Removing site $SITE&#187;<br \/>\nsleep 1<br \/>\nrm -r $DIR<br \/>\nrm $FILE<br \/>\nsed -i &#171;&#187; &#8216;\/127.0.0.1 $SITE\/d&#8217; \/etc\/hosts<br \/>\necho\u00a0 &#171;Restarting Apache&#187;<br \/>\nsleep 1<br \/>\napachectl restart<br \/>\necho &#171;Congratulations, the site $SITE has been successfully removed&#187;<br \/>\nexit 0<br \/>\nelse<br \/>\necho &#171;Site $SITE not on the server&#187;<br \/>\nfi<br \/>\nfi<br \/>\necho &#171;You have not entered a name&#187;<br \/>\necho -n &#171;Please, enter the name of the site or CTRL+Z to exit:&#187;<br \/>\ndone<br \/>\n}<\/strong><\/p>\n<p>#check user rights<br \/>\n<strong>if<br \/>\n[ $(whoami) != &#171;root&#187; ]<br \/>\nthen<br \/>\necho &#8216;You must be root.&#8217;<br \/>\nexit 1<br \/>\nfi<\/strong><\/p>\n<p>#deletion-addition process<br \/>\n<strong>if<br \/>\n[ &#171;$1&#187; = &#171;&#187; ]<br \/>\nthen<br \/>\necho &#171;Invalid option&#187;<br \/>\necho\u00a0 &#171;Use &#8216;add&#8217; or &#8216;remove&#8217; option&#187;<br \/>\nexit 1<br \/>\nelse<br \/>\ncase $1 in<br \/>\nadd)<br \/>\nadd_site<br \/>\n;;<br \/>\nrm)<br \/>\nrm_site<br \/>\n;;<br \/>\nesac<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u0421\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u0435\u0433\u043e. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0444\u0430\u0439\u043b\u00a0<strong>site,\u00a0<\/strong>\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c \u0438 \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443\u00a0<strong>\/usr\/bin<\/strong>.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0441 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:<\/p>\n<p><strong>site add \u2013\u00a0<\/strong>\u0434\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0430\u0439\u0442\u0430;<\/p>\n<p><strong>site rm \u2013\u00a0<\/strong>\u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p><a href=\"http:\/\/materynko.blogspot.com\/2011\/06\/apache-php-mysql-freebsd.html\">http:\/\/materynko.blogspot.com\/2011\/06\/apache-php-mysql-freebsd.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 Web-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u0436\u0435 \u0434\u043b\u044f\u00a0FreeBSD. \u0411\u0443\u0434\u0435\u043c \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0438\u0437 \u043f\u043e\u0440\u0442\u043e\u0432.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[14,7],"tags":[23,15,22],"_links":{"self":[{"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=\/wp\/v2\/posts\/9"}],"collection":[{"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9"}],"version-history":[{"count":3,"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":11,"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions\/11"}],"wp:attachment":[{"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.brf.kiev.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}