LINUX.ORG.RU

apache + php 5


0

0

Задача установить Apache, php, openssl

зашел /usr/ports/lang/php5

make config

выбираю apache

make install

собирается php5 c apache13 добавляею в httpd.conf

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

создаю test.php

<?php phpinfo ?>

http://127.0.0.1/test.php

выводит текст в окне <?php phpinfo ?>

До этого действовал по тойже схеме все работало


Re: apache + php 5

AddHandler php5-script .php

anonymous ()
Ответ на: Re: apache + php 5 от osipen

Re: apache + php 5

модуль есть и загружается? в логах апача видно, что загрузился именно Apache/x.y.z (UNIX) PHP/5.xx.yy ?

anonymous ()
Ответ на: Re: apache + php 5 от osipen

Re: apache + php 5

плин <?php phpinfo(); ?>

anonymous ()
Ответ на: Re: apache + php 5 от anonymous

Re: apache + php 5

# ee /var/log/httpd-errors [Thu Mar 15 14:07:17 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 14:07:17 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 14:07:32 2007] [error] [client 127.0.0.1] File does not exist: /usr/local/www/data/favicon.ico [Thu Mar 15 14:21:09 2007] [notice] SIGHUP received. Attempting to restart [Thu Mar 15 14:21:09 2007] [warn] module http_core.c is already added, skipping [Thu Mar 15 14:21:10 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 14:21:10 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 14:21:20 2007] [notice] SIGHUP received. Attempting to restart [Thu Mar 15 14:21:21 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 14:21:21 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 14:22:16 2007] [error] [client 127.0.0.1] File does not exist: /usr/local/www/data/favicon.ico [Thu Mar 15 14:22:30 2007] [error] [client 127.0.0.1] file permissions deny server execution: /usr/local/www/cgi-bin/test-cgi [Thu Mar 15 14:22:44 2007] [error] [client 127.0.0.1] File does not exist: /usr/local/www/data/php.test [Thu Mar 15 14:23:17 2007] [notice] SIGHUP received. Attempting to restart [Thu Mar 15 14:23:18 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 14:23:18 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 14:37:07 2007] [notice] caught SIGTERM, shutting down [Thu Mar 15 14:37:11 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 14:37:11 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 14:53:12 2007] [notice] caught SIGTERM, shutting down [Thu Mar 15 14:53:16 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 14:53:16 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 14:56:27 2007] [error] [client 127.0.0.1] file permissions deny server execution: /usr/local/www/cgi-bin/test-cgi [Thu Mar 15 15:00:54 2007] [notice] SIGHUP received. Attempting to restart [Thu Mar 15 15:00:55 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 15:00:55 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 15:00:55 2007] [notice] caught SIGTERM, shutting down [Thu Mar 15 15:01:47 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 15:01:47 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 15:01:52 2007] [notice] SIGHUP received. Attempting to restart [Thu Mar 15 15:01:53 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 15:01:53 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 17:43:17 2007] [notice] caught SIGTERM, shutting down [Thu Mar 15 17:43:21 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations [Thu Mar 15 17:43:21 2007] [notice] Accept mutex: flock (Default: flock) [Thu Mar 15 17:46:01 2007] [error] [client 89.19.164.29] File does not exist: /usr/local/www/data/favicon.ico [Thu Mar 15 18:01:56 2007] [error] [client 89.19.164.29] File does not exist: /usr/local/www/data/favicon.ico [Thu Mar 15 18:01:56 2007] [error] [client 89.19.164.29] File does not exist: /usr/local/www/data/favicon.ico [Thu Mar 15 18:01:59 2007] [error] [client 89.19.164.29] File does not exist: /usr/local/www/data/favicon.ico [Thu Mar 15 19:33:03 2007] [error] [client 89.19.164.29] File does not exist: /usr/local/www/data/favicon.ico

osipen ()

Re: apache + php 5

в httpd.conf:

LoadModule php5_module        libexec/apache/libphp5.so
<...>
AddModule mod_php5.c
<...>
<IfModule mod_php5.c>
        AddType application/x-httpd-php .php
        AddType application/x-httpd-php-source .phps
</IfModule>

anonymous ()
Ответ на: Re: apache + php 5 от anonymous

Re: apache + php 5

A chto v <...> dolzno bit napisano esli tak napisat to oshibka esli zakomentirovat to v logah ->

[Fri Mar 16 09:07:07 2007] [notice] caught SIGTERM, shutting down

[Fri Mar 16 09:09:26 2007] [warn] module php5_module is already loaded, skipping

[Fri Mar 16 09:09:26 2007] [warn] module mod_php5.c is already added, skipping

[Fri Mar 16 09:09:27 2007] [notice] Apache/1.3.37 (Unix) PHP/5.2.1 with Suhosin-Patch configured -- resuming normal operations

[Fri Mar 16 09:09:27 2007] [notice] Accept mutex: flock (Default: flock)

osipen ()
Ответ на: Re: apache + php 5 от osipen

Re: apache + php 5

Вроде получилось добавил в httpd.conf <IfModule mod_php5.c>

AddType application/x-httpd-php .php

AddType application/x-httpd-php-source .phps

</IfModule>

Только интересно допустем я создаю test.php ->

<?php phpinfo ?>

браузер не выводит ничего.

а если создать test2.php ->

<html> <head> <title> test </title> </head> <h1>test</h1> <? echo date('H:i, jS F'); ?> </html>

Браузер на экран выводит test 10:05, 16th June

osipen ()
Ответ на: Re: apache + php 5 от osipen

Re: apache + php 5

блин еще раз.. Я ж тебе написал, что у тебя ошибка в синтаксисе. сравни <?php phpinfo(); ?> и свой текст

anonymous ()
Ответ на: Re: apache + php 5 от anonymous

Re: apache + php 5

Спасибо большое anonymous (*), век твоего добра не забуду. Может ответишь еше на один маленький вопрос. А если я захочу прикрутить opensss к apache + php, что мне надо будет сделать.

osipen ()
Ответ на: Re: apache + php 5 от osipen

Re: apache + php 5

Я не знаю что такое opensss, но если речь о SSL,то:

Установить openssl, собрать модуль для апача (собранного с опциями --enable-ssl --with-ssl), 
загрузить его: 

IfModule mod_ssl.c>
    Include conf/ssl.conf
</IfModule>

#<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
#</IfDefine>

убедиться, что он запускается:
# apachectl startssl
ps ax|grep http должен показать httpd -DSSL

создать личный ключ для подписи:
# openssl genrsa -out ca.key 2048

создать ключ для сервера:
# openssl genrsa -out fqdn.name.of.your.server key 1024

подписать его личным ключом:
# openssl x509 -req -in fqdn.name.of.your.server.csr -out fqdn.name.of.your.server.crt -sha1 -CA ca.crt -CAkey ca.key -CAcreateserial -days 3650

Дать нормальные права на сертификаты + в ssl.conf прописать нужные пути к сертификатам и описать виртуальный хост для захода по https.

А вообще куча доментации в инете.

anonymous ()
Ответ на: Re: apache + php 5 от anonymous

Re: apache + php 5

Установил openssl, Пытаюсь собрать модуль из портов /usr/ports/www/apache13-modssl

Выдает ->

===> Installing for apache+mod_ssl-1.3.37+2.8.28 GNU Midnight Commander is already running on this terminal.

===> apache+mod_ssl-1.3.37+2.8.28 conflicts with installed package(s): pport will be disabled. apache-1.3.37_2 │ │ [ OK ] [ Quit ] │ They install files into the same place. └────────────────────────────────────┘

Please remove them first with pkg_delete(1).

*** Error code 1

Stop in /usr/ports/www/apache13-modssl.

osipen ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.