Показаны сообщения с ярлыком apache. Показать все сообщения
Показаны сообщения с ярлыком apache. Показать все сообщения

среда, 20 августа 2014 г.

Рекурсивный рерайт на CGI

Сделал челу пых как cgi (без супхп), у него стала валиться 500 ошибка из-за косяка с рерайтами:
Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace
r->uri = /cgi-bin/php/index.php
redirected from r->uri = /index.php
redirected from r->uri = /cgi-bin/php/index.php
redirected from r->uri = /index.php
redirected from r->uri = /cgi-bin/php/index.php
redirected from r->uri = /index.php
redirected from r->uri = /cgi-bin/php/index.php
redirected from r->uri = /index.php
redirected from r->uri = /cgi-bin/php/index.php
redirected from r->uri = /index.php
redirected from r->uri = /

Сделал отдельный рерайт для cgi-bin/php, помогло:
RewriteCond %{REQUEST_URI} ^/cgi-bin/php(.*)
RewriteRule . - [L]

вторник, 20 августа 2013 г.

Apache: Cannot create SSLMutex Configuration Failed

Подняли, блин, под утро..  Апач упал, при запуске в лог:
[error] (28)No space left on device: Cannot create SSLMutex Configuration Failed
Семафоры надо дропнуть:

ipcs -s | grep http| awk '{print $2}' > sema
for a in `cat sema`;do ipcrm -s $a;done

вторник, 19 февраля 2013 г.

Апач - аутентификация и исключение по адресу

Пускаем без пароля с наших акков, все остальные только с паролем.

<VirtualHost xxx.xxx.118.4:80>
.........
<Directory /var/www/html/munin>
        Order deny,allow
        Deny from all
        AuthType Basic
        AuthName "Restricted Resource"
        AuthUserFile /etc/httpd/htpasswd
        Require valid-user
        Allow from xxx.xxx.212.0/24
        Allow from xxx.xxx.98.210/32
        Allow from xxx.xxx.224.67/32
        Satisfy Any
</Directory>
.......
</VirtualHost>

вторник, 28 августа 2012 г.

Сборка php 5.4 для cpanel с php 5.3

Сказали, что надо для панелей запилить пых 5.4, сохранив основным 5.3.
Собрал c блекджеком, проститутками и параметрами:
./configure --prefix=/usr/local/php54 --enable-bcmath --enable-calendar --enable-exif --enable-ftp --enable-gd-native-ttf --enable-mbstring --enable-pdo --enable-soap --enable-sockets --enable-wddx --enable-zip --with-bz2 --with-curl=/opt/curlssl/ --with-freetype-dir=/usr --with-gd --with-gettext --with-imap=/opt/php_with_imap_client/ --with-imap-ssl=/usr --with-jpeg-dir=/usr --with-kerberos --with-libdir=lib64 --with-libexpat-dir=/usr --with-libxml-dir=/opt/xml2 --with-libxml-dir=/opt/xml2/ --with-mcrypt=/opt/libmcrypt/ --with-mysql=/usr --with-mysql-sock=/var/lib/mysql/mysql.sock --with-mysqli=/usr/bin/mysql_config --with-pcre-regex=/opt/pcre --with-pdo-mysql=shared --with-pdo-sqlite=shared --with-pic --with-png-dir=/usr --with-tidy --with-xmlrpc --with-xpm-dir=/usr --with-xsl=/opt/xslt/ --with-zlib --with-zlib-dir=/usr --with-zend-vm --with-pgsql --with-pdo-mysql --with-pdo-pgsql
Пришлось по мелочи либ доставить, конфигурялка подсказала. Взял стоковый php.ini, поправил лимиты на память, аплоад, пост и еррор лог задал.
Дальше самое интересное: в suphp указываем путь до нового пыха и в конфе апача добавляем хандлер:

/opt/suphp/etc/suphp.conf:
application/x-httpd-php54="php:/usr/local/php54/bin/php-cgi"

/usr/local/apache/conf/includes/pre_virtualhost_2.conf:
suPHP_AddHandler application/x-httpd-php54

Теперь клиенту достаточно добавить в .htaccess:
AddType application/x-httpd-php54 .php5 .php4 .php .php3 .php2 .phtml
Самое главное - не забыть закомментить всё при запуске easyapache ))