Страница 1 из 2

Настройка хостинга под apache + PHP

Добавлено: 2007-11-26 23:27:46
Valmon
Всем добрый вечер!
Пытаюсь воспроизвести статью Настройка хостинга под apache + PHP + MySQL под Apache2.2
Первое с чем столкнулся это suexec
С какими опциями его собирать?
У меня получилось вот так вот!

Код: Выделить всё

# apache2.2
.if ${.CURDIR} == ${PORTSDIR}/www/apache22
WITHOUT_SSL=YES
WITH_SUEXEC=YES
SUEXEC_DOCROOT=/data/http_docs
SUEXEC_USERDIR=/data/http_docs/*/*/cgi-bin
SUEXEC_LOGFILE=/usr/local/var/log/httpd-suexec.log
.endif
Будет 2 разных класса пользователей с разными лимитами по процессам и ресурсам
Структура каталогов хостинга следующая

Код: Выделить всё

/data/http_docs/webusers1/user_name/domain_name/http/
                                                                                    /cgi-bin/
                      /webusers2/user_name/domain_name/http/
                                                                        /cgi-bin/
Домашняя деректария пользователей /data/http_docs/webusers1/user_name/
Классы пользователей /data/http_docs/webusers1/ и webusers2/

И еще один вопрос!
Как запретить юзерам выходить из своей директории с фтп клиентом

Жду советов и помощи в покореннии гранита науки

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-26 23:30:35
Alex Keda
ничё не понял...
про ftp - chroot в мане

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-26 23:38:34
Valmon
Ну я про suexec
Расписал что где будет лежать, где выполнятся cgi-bin, где корень сайта http каталог

Вот и спросил, правильный ли make.conf

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-26 23:41:45
Alex Keda
не уверен что можно юзать звёздочку.
а так - вроде ничё

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-27 0:25:34
Valmon
А как тогда быть с cgi-bin?

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-27 1:04:27
Valmon
И как можно проверить, работает ли suexec вообще, и с какими опциями

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-27 9:23:16
Alex Keda
если проинсталлился - значит работает

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-27 16:42:45
Valmon
Он то собрался!
Но вертуал хосты не работают, выкидывает походу на первый попавшийся
И при старте мотерится вот так вот

Код: Выделить всё

ru-point# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
[Tue Nov 27 16:31:30 2007] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
Syntax OK
Stopping apache22.
Waiting for PIDS: 19426.
Performing sanity check on apache22 configuration:
[Tue Nov 27 16:31:33 2007] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
Syntax OK
Starting apache22.
[Tue Nov 27 16:31:33 2007] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
[Tue Nov 27 16:31:33 2007] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
Конфиги хостов

Код: Выделить всё

<VirtualHost *:80>
    ScriptAlias /cgi-bin/ /data/http_docs/webusers1/xxxxxx_com/xxxxxx.com/cgi-bin/
    ServerAdmin support@xxxxxx.com
    SuexecUserGroup xxxxxx_com xxxxxx_com
    DocumentRoot /data/http_docs/webusers1/xxxxxx_com/xxxxxxcom/http
    ServerName xxxxxx.com
    ServerAlias www.xxxxxx.com
    # Директория пользователя
    <Directory /data/http_docs/webusers1/xxxxxx_com/xxxxxx.com/http>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order deny,allow
      Allow from all
    </Directory>
    DirectoryIndex index.php index.html index.htm index.shtml index.php3
    AddType application/x-httpd-php .php .php3
    Action  application/x-httpd-php /cgi-bin/php-cgi
    ErrorLog /data/http_docs/webusers1/xxxxxx_com/xxxxxx.com/log/error.log
    CustomLog /data/http_docs/webusers1/xxxxxx_com/xxxxxx.com/log/access.log common
</VirtualHost>

Конфиг апача по дефолту, добавлена строка Include /data/http_docs/http_conf/*.conf

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-27 16:47:06
Alex Keda
варнинги - ерунда :)

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-27 16:55:22
Valmon
Ну темнемение, вертуалхосты не работают!
Может быть дело в них и есть?
Я все взял из статьии и поменял только

Код: Выделить всё

    User ${user_name}
    Group ${user_name}
На это

Код: Выделить всё

    SuexecUserGroup ${user_name} ${user_name}

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-27 20:22:13
Alex Keda
ты эта, сделай рабочий виртуалхост и с него шаблон нарисуй.
я так делал...

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-27 23:19:06
Valmon
Странно, он матерится как постами выше, когда конфиги отдельными файлами и ссылка с *.conf и не матерится когда одним файлом все конфиги и жесткая ссылка vhosts.conf
И все хосты работают

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-28 16:25:50
Valmon
Не хочет php как cgi работать
Всетаки наверное не катят звездочки

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-29 12:42:16
Valmon
Вроде бы работает, но ругается в браузере что у вас нет прав на просмотр данной страници
А в логах

Код: Выделить всё

[Thu Nov 29 11:51:43 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:44 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:45 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:45 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:46 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:46 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:46 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:47 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:47 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:48 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:51:48 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:54:23 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:55:42 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:55:48 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:55:49 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 11:55:49 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/
[Thu Nov 29 12:08:50 2007] [error] [client 213.208.181.165] client denied by server configuration: /data/http_data/webroot/ru-point_com/ru-point.com/http/

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-29 15:08:29
Alex Keda
ну это уже апач.
разреши да и всё.

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-29 15:24:34
Valmon
Рарешить что и где?

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-29 22:26:27
serge
На диры вирт хостов в соответствии с уже написанным

Код: Выделить всё

<Directory /data/http_docs/webusers1/xxxxxx_com/xxxxxx.com/http>
      Options Indexes FollowSymLinks MultiViews
      AllowOverride All
      Order deny,allow
      Allow from all
</Directory>
А также на файловой системе

Код: Выделить всё

chmod -R 750 suexec_user suexec_group /data/http_docs/webusers1/xxxxxx_com/xxxxxx.com/http
Если 750 то апача еще добавить в группу к suexec_group иначе права 755 (это для контента отличного от скриптов).

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-30 0:55:22
Valmon
Блин, пытаюсь поставить расширение, а он ругаетс что php5-bz2-5.2.5 уже стоит

Код: Выделить всё

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/ports/archivers/php5-bz2/work/php-5.2.5/ext/bz2/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

===>  Installing for php5-bz2-5.2.5
===>   php5-bz2-5.2.5 depends on file: /usr/local/include/php/main/php.h - found
===>   Generating temporary packing list
===>  Checking if archivers/php5-bz2 already installed
===>   php5-bz2-5.2.5 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of archivers/php5-bz2
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/archivers/php5-bz2.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
КАк быть тогда с расширениями

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-30 8:52:45
Alex Keda
ну удали.
во проблема-то :)

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-30 9:30:42
Valmon
Тоесть? pkg_delete php5-bz2-5.2.5?

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-30 11:30:29
Valmon
Думаю удалять вот так вот это не решение

Код: Выделить всё

----------------------------------------------------------------------
Libraries have been installed in:
   /usr/ports/devel/php5-pcre/work/php-5.2.5/ext/pcre/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

===>  Installing for php5-pcre-5.2.5
===>   php5-pcre-5.2.5 depends on file: /usr/local/include/php/main/php.h - foun
d
===>   Generating temporary packing list
===>  Checking if devel/php5-pcre already installed
===>   php5-pcre-5.2.5 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of devel/php5-pcre
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop in /usr/ports/devel/php5-pcre.
*** Error code 1

Stop in /usr/ports/security/pecl-filter.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
*** Error code 1

Stop in /usr/ports/lang/php5-extensions.
Может быть удалить все из /usr/local/include/php/

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-30 13:08:35
serge
А может быть

Код: Выделить всё

portupgrade
:?:

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-30 19:04:24
Valmon
А это разве решение?
У меня все порты обнавленны с помощью CVSup

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-30 19:17:20
serge
А не путаешь ли софт установленный из портов и дерево портов? Если нет, тогда для чего вот это делал?
Блин, пытаюсь поставить расширение, а он ругаетс что php5-bz2-5.2.5 уже стоит
т.е. зачем ставил то, что уже есть???

Re: Настройка хостинга под apache + PHP

Добавлено: 2007-11-30 19:56:45
Valmon
Нет, не путаю!
Я намеренно не чего из расширенней не ставил, скорей всего что-то из софта потянул за собой
Но факт в том что стоит то оно может быть и стоит но не работает
По крайней мере phpinfo не не показывает что они стоят