Проблемы с apache

Обсуждение настройки и работы сервисов, резервирования, сетевых настроек и вопросов безопасности ОС для молодых и начинающих системных администраторов.

Модератор: SLEDopit

Faruna
Сообщения: 118

Проблемы с apache

Сообщение Faruna »

У меня возникли проблемы с apache.

В общем: я нашла множество инструкций по утсановке apache.

Делала всё правильно.

Устанавливала полностью LAMP.

По кускам собирала.

Но вот apache запускаю и набираю в браузере "localhost/phpmyadmin",

в ответ на мой запрос:

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

Not Found

The requested URL /phpmyadmin/ was not found on this server.


Создаю тестовый скрипт, помещаю в деректорию var/www/

Набираю "localhost/index.php"

В результате чего у меня выскакивает диалоговое окно с запросом о сохранении фаила "index.php".

Работаю в браузере opera

Подскажите пожалуйста - что мне делать...

Я уже много раз переустанавливала LAMP...

Заранее Вас благодарю...
Спасибо сказали:
Аватара пользователя
0ut
Сообщения: 307
Статус: Злыдень
ОС: *nix

Re: Проблемы с apache

Сообщение 0ut »

1. Какой дистр?
2. ls -la /var/www
Запросы ошибок к операционной системе игнорироваться не могут.
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

0ut писал(а):
13.05.2009 12:26
1. Какой дистр?
2. ls -la /var/www

Дистрибутив ubuntu 8.10.
Спасибо сказали:
Аватара пользователя
0ut
Сообщения: 307
Статус: Злыдень
ОС: *nix

Re: Проблемы с apache

Сообщение 0ut »

dpkg -l | grep phpmyadmin
Запросы ошибок к операционной системе игнорироваться не могут.
Спасибо сказали:
Аватара пользователя
кодировщик
Сообщения: 974
Статус: зарёган в пятницу 13
ОС: Linux

Re: Проблемы с apache

Сообщение кодировщик »

0ut писал(а):
13.05.2009 13:23
dpkg -l | grep phpmyadmin

В LAMP он не входит.
Спасибо сказали:
Аватара пользователя
0ut
Сообщения: 307
Статус: Злыдень
ОС: *nix

Re: Проблемы с apache

Сообщение 0ut »

кодировщик писал(а):
13.05.2009 14:51
0ut писал(а):
13.05.2009 13:23
dpkg -l | grep phpmyadmin

В LAMP он не входит.


так я и думал, но может она его все таки поставила
Запросы ошибок к операционной системе игнорироваться не могут.
Спасибо сказали:
Аватара пользователя
кодировщик
Сообщения: 974
Статус: зарёган в пятницу 13
ОС: Linux

Re: Проблемы с apache

Сообщение кодировщик »

2Faruna
просто в браузере http://localhost
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

PHPMYADMIN - я отдельно ставила.
Сама.
Поэтому он у меня есть.

Ну помогите мне хоть кто-нибудь..
Объясните глупой девочке...
Я просто не шарю...
Вы мне что то даёте, я даже не знаю что это...
Объясните, пожалуйста..

:(
Спасибо сказали:
Аватара пользователя
кодировщик
Сообщения: 974
Статус: зарёган в пятницу 13
ОС: Linux

Re: Проблемы с apache

Сообщение кодировщик »

Faruna писал(а):
13.05.2009 16:22
PHPMYADMIN - я отедльно ставила.
Сама.
Поэтому он у меня есть.

Ну помогите мне хоть кто нибудь..
Объясните глупой девочке...
Я просто не шарю...
Вы мне что то даёте я даже не знаю что это...
Объясните пожалуйста..

:(

Ну если в браузере набрать http://localhost и попробывать перейти на эту страницу, что выйдет?!
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

кодировщик писал(а):
13.05.2009 16:27
Ну если в браузере набрать http://localhost и попробывать перейти на эту страницу, что выйдет?!


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

Not Found

The requested URL / was not found on this server.
Спасибо сказали:
Аватара пользователя
кодировщик
Сообщения: 974
Статус: зарёган в пятницу 13
ОС: Linux

Re: Проблемы с apache

Сообщение кодировщик »

а моно увидеть вывод команды
netstat -tunap
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

а моно увидеть вывод команды
netstat -tunap

Вот держи:

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

Активные соединения с интернетом (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      4967/mysqld     
tcp        0      0 192.168.1.33:54562      205.188.9.101:5190      ESTABLISHED 6101/pidgin     
tcp        0      0 192.168.1.33:60017      64.12.201.36:5190       ESTABLISHED 6101/pidgin     
tcp        0      0 192.168.1.33:59499      89.104.102.12:80        ESTABLISHED 6236/opera      
tcp        0      0 192.168.1.33:59500      89.104.102.12:80        ESTABLISHED 6236/opera      
tcp        0      0 192.168.1.33:44483      213.180.203.18:5222     ESTABLISHED 6101/pidgin     
tcp        0      0 192.168.1.33:54057      89.104.102.12:80        ESTABLISHED 6236/opera      
tcp6       0      0 :::80                   :::*                    LISTEN      5724/apache2    
udp        0      0 0.0.0.0:68              0.0.0.0:*                           5723/dhclient   
udp        0      0 0.0.0.0:51397           0.0.0.0:*                           4865/avahi-daemon:
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           4865/avahi-daemon:
udp6       0      0 :::177                  :::*                                5586/gdm        

Честно говоря я ничего не поняла из того что тут написано)))
Спасибо сказали:
Аватара пользователя
кодировщик
Сообщения: 974
Статус: зарёган в пятницу 13
ОС: Linux

Re: Проблемы с apache

Сообщение кодировщик »

Это показывает сетевые соеденения.
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

Это показывает сетевые соеденения

спасябки за инфу))
Ну а что теперь мне делать ?

у меня уже ручки попрограммировать чешутся :(
Спасибо сказали:
sim1
Сообщения: 155
ОС: GNU,BSD
Контактная информация:

Re: Проблемы с apache

Сообщение sim1 »

вывод команды netstat -tunap говорит о том, что апач запушен

Not Found

The requested URL / was not found on this server.


Эта ошибка означает, что у вас не правильно настроен апач или, скорее, всего вы его не настраивали.
Ваш httpd.conf нужно поправить в следующих местах:

1. Исправить DocumentRoot на папку где у вас лежат все сайты например

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

DocumentRoot "/usr/local/www"

2. Описать папку, указанную в пнкт 1

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

<Directory "/usr/local/www">
....
</Directory>

3. Настроить апач для заданного сайта

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

NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin root@example.com
    DocumentRoot "/usr/local/www/phpMyAdmin"
    ServerName example.com
    ErrorLog "/var/log/example.com-error_log"
    CustomLog "/var/log/example.com-error_log-access_log" common
</VirtualHost>

а вообще почитайте как настраивать апач.
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

sim1 писал(а):
13.05.2009 17:10
вывод команды netstat -tunap говорит о том, что апач запушен

Not Found

The requested URL / was not found on this server.

Эта ошибка означает, что у вас не правильно настроен апач или, скорее, всего вы его не настраивали.
Ваш httpd.conf нужно поправить в следующих местах:

1. Исправить DocumentRoot на папку где у вас лежат все сайты например
DocumentRoot "/usr/local/www"
2. Описать папку, указанную в пнкт 1

<Directory "/usr/local/www">


....
</Directory>
3. Настроить апач для заданного сайта
NameVirtualHost *:80

<VirtualHost *:80>
    ServerAdmin root@example.com
    DocumentRoot "/usr/local/www/phpMyAdmin"
    ServerName example.com
    ErrorLog "/var/log/example.com-error_log"
    CustomLog "/var/log/example.com-error_log-access_log" common
</VirtualHost>
а вообще почитайте как настраивать апач.


Спасибо, я сейчас посмотрю в интернете. :blush:

И попробую вашу версию.
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

Вот смотрите, в общем.
Почитала как настраивать apache.
Не помогло... Либо я дура - либо не знаю.
Вот, в общем, я переустановила apache, вот инструкция по которой я его сейчас установила заного.

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

Устанавливаем MySQL
Открываем терминал и ручками пишем:
1. sudo apt-get install mysql-server
2. После установки должен открыться диалог создания root-пароля для MySQL, если этого не произошло, то пишем:
sudo mysqladmin -u root password XXXX
где XXXX — ваш пароль
3. Теперь установим GUI для управления БД MySQL:
sudo apt-get install mysql-admin
MySQL установлен.

Устанавливаем Apache2 и PHP5
Опять же делаем ручками:
1. sudo apt-get install apache2
2. Теперь приконнектим к новоиспеченному апачу php5, вместе с библиотеками для работы с MySQL и графикой:
sudo apt-get install php5 libapache2-mod-php5 libapache2-mod-auth-mysql php5-mysql php-image-graph imagemagick
3. После установки — перезапускам апач:
sudo /etc/init.d/apache2 restart
Проверяем работоспособность нашего веб-сервера — заходим в браузер и пишем:
localhost/apache2-default
Должна появиться надпись: «It works!».
Директории по умолчанию:
/var/www/ — скрипты и файлы пользователей;
/etc/php5/ и /etc/apache2/ — конфигурационные файлы php5 и apache2;
4. Проверяем работоспособность PHP5. Создадим файл phpinfo.php:
sudo gedit /var/www/phpinfo.php
В него заносим следующее:
<?php phpinfo(); ?>
5. Сохраняем его и заходим по ссылке: localhost/phpinfo.php
Если появилась инфо о php5 — все ок!

Настраиваем Virtual Hosts для Apache2
1. Вводим в терминале:
sudo /etc/init.d/apache2 stop
2. sudo gedit /etc/apache2/sites-available/default
3. Закоменттим все что есть после строчки «NameVirtualHost 127.0.0.1:80» (ставим в начале строки «#»);
4. Здесь я покажу 3 способа создания виртуальных хостов. В конце файла добавляем такие строчки:
<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/localhost/www
ServerName localhost
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>

<VirtualHost ipbased>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/ipbased/www
ServerName ipbased
ErrorLog /var/log/apache2/error.log
TransferLog /var/log/apache2/access.log
</VirtualHost>

<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/namebased/www
ServerName namebased
ErrorLog /var/log/apache2/error.log
TransferLog /var/log/apache2/access.log
</VirtualHost>

Не забываем создать директории указанные в DocumentRoot'ах.
5. Заходим в Система > Администрирование > Сеть. Переходим во вкладку «Узлы». Ищем ip-шник «127.0.0.1». Выбрали? — нажимаем «Свойства». Добавляем такие записи:
localhost
namebased

6. Далее жмем «Добавить» и вводим ip-шник на который хотим, чтобы откликался хост «ipbased». В поле «Псевдонимы» вводим:
ipbased
7. sudo /etc/init.d/apache2 start
8. Все! Проверям хосты: ipbased/, localhost/, namebased/, 127.0.0.1/, http://[ip-адрес хоста ipbased]

Устанавливаем XDebug и соединяем его с PHP5
В случае, если вы ставили апач и пхп по выше изложенным инструкциям, то пора показать как установить и приклеить к этому всему отладчик xdebug:
1. В терминале вводим:
sudo apt-get install php-pear php5-dev
2. Далее:
sudo pecl install xdebug
3. Теперь открываем php.ini:
sudo gedit /etc/php5/apache2/php.ini
XDebug лежит в /usr/lib/php5/20060613+lfs/ (если ставили сервер, по этим инструкциям). Возможно последняя директория может отличаться. Захотите — найдете :).
Небольшой тюннинг по текущему пункту:
тюннинг №1:
По умолчанию расширения (extensions) хранятся в каталоге вида /usr/lib/php5/20060613+lfs. Мне такой путь не нравится, поэтому предлагаю поменять каталог на /usr/lib/php5/ext и прописать изменения в php.ini
sudo gedit /etc/php5/apache2/php.ini
Заменяем; extension_dir=’./’ на extension_dir = ”/usr/lib/php5/ext/”.

Спасибо S2nek .
тюннинг №2:
Я бы предложил положить строки, касающиеся xdebug, в /etc/php5/conf.d/xdebug.ini. Так реально удобнее.

Спасибо develop7 .

Итак, пишем в конец файла php.ini (xdebug.ini, если использовали тюннинг №2) следующее:
zend_extension=«/usr/lib/php5/20060613+lfs/xdebug.so»;(«/usr/lib/php5/ext/xdebug.so», если использовали тюннинг №1)
xdebug.remote_enable=1
xdebug.profiler_output_dir = «/home/yourhome/projects/tmp_xdebug»; здесь директория для сохранения результатов профилировщика

Все. С серваком покончили :)

Устанавливаем Eclipse+PDT и настраиваем в нем XDebug
1. Качаем Eclipse SDK v3.3.1.1:
если 32-битная JVM (виртуальная машина java): отсюда
если 64-битная JVM: отсюда

2. Распаковываем эклипс в директорию на ваш выбор, запускаем его и заходим в меню Help > Software Updates > Find and Install
если при запуске эклипс матюкается, что мол «а джавы-то нет» :), то набираем ручками в терминале такую команду:
sudo apt-get install sun-java6-jdk

3. Выбираем «Search for new features to install»
4. В следующем окне нажимаем «New Remote Site...»
5. В поле «Name» вводим «PDT Updates», а в «URL» — «download.eclipse.org/tools/pdt/updates/». Ставим галочки на всех зеркалах. Next >
6. Как только поиск закончится — раскрываем «PDT Updates» и ставим галочку возле «PDT SDK...». Также не забываем нажимать «Select Required» для установки необходимых компонентов
7. Перезагружаем Эклипс
8. Идем Window > Open Perspective > PHP. Если такой пункт меню есть — все ок. Если нет — пробуем такие варианты:
1-й вариант:
у меня проблема эта возникла из-за виртуальной машины java. Я поставил java-6-sun, потом поставил eclipse+pdt. PHP Perspectives отсутствовала (хотя ставил All in one)
В итоге помогла команда:
sudo update-alternatives --config java
Выбрал там установленную java-6-sun, запустил Eclipse — вуаля. все есть

Спасибо ewgRa .
2-й вариант:
Идем сюды

9. Заходим в Window > Prefernces… > PHP > PHP Servers.
10. Жмем «New». В поле «Name» вводим «My Site On localhost», ниже — «localhost». Next. Finish.
11. Теперь идем в Window > Prefernces… > PHP > Debug. Выбираем такие настройки:
PHP Debugger: XDebug
Server: My Site On localhost
PHP Executable: None Defined
12. Идем в Window > Prefernces… > General > Web Browser. Если галочка «Use internal Web Browser» скрыта, то жмем «New» и добавляем свой любимый браузер.
13. Все! Создаем PHP-проект и радуемся. Если не радуемся — курим мануалы на www.eclipse.org :)

Надеюсь ничего не забыл;)

Всё делаю как там написано, а торможу вот на каком моменте:

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

4. Проверяем работоспособность PHP5. Создадим файл phpinfo.php:
sudo gedit /var/www/phpinfo.php
В него заносим следующее:
<?php phpinfo(); ?>
5. Сохраняем его и заходим по ссылке: localhost/phpinfo.php
Если появилась информация о php5 — все ок!

У меня ничего подобного не запускается.
Просто not found.
И что делать — не знаю.
Сейчас пыталась настроить - эффект один и тот же..
И вообще просто не знаю что делать.... :cry:
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

Я сколько ищу, ничего не могу найти, что бы мне помогло....
Опишите, пожалуйста, инструкцию, как полностью удалить установленные пакеты.
Что бы они нигде не остались...
Что бы качать их по-новой и устанавливать по этой инструкции...
Я обычно удаляю пакеты так:

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

sudo apt-get remove имя_пакета

Может, удаляю я не правильно, потому что он не запрашивает по-новой настройки...
Может, я в первый раз где то ошибку допустила...
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

Извините, пожалуйста, за нервы...
Просто уже целую неделю пытаюсь установить, и ничего не получается...
Проект висит - всё встало...
Не программировала - много новых идей, а тут облом...
Дело в том что я ранее сидела на ubuntu 8.04 но он навернулся из-за обновления триггеров.
Но туда всё прекрасно встало и я сидела, программировала себе в удовольствие...
Спасибо сказали:
Аватара пользователя
strah
Сообщения: 283
ОС: Freebsd, linux, Solaris.

Re: Проблемы с apache

Сообщение strah »

У меня ничего подобного не запускаеться.
Просто not found.

ЭЭ, а кто это конкретно пишет? Веб сервер, при заходе на страничку. Или вот это: "sudo gedit /var/www/phpinfo.ph"?
Ну, и, держи вдогонку мой конфиг(debian):


--/etc/apache2/apache2.conf------------


Код:

ServerRoot "/etc/apache2" # # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. # #<IfModule !mpm_winnt.c> #<IfModule !mpm_netware.c> LockFile /var/lock/apache2/accept.lock #</IfModule> #</IfModule> # # PidFile: The file in which the server should record its process # identification number when it starts. # This needs to be set in /etc/apache2/envvars # PidFile ${APACHE_PID_FILE} # # Timeout: The number of seconds before receives and sends time out. # Timeout 300 # # KeepAlive: Whether or not to allow persistent connections (more than # one request per connection). Set to "Off" to deactivate. # KeepAlive On # # MaxKeepAliveRequests: The maximum number of requests to allow # during a persistent connection. Set to 0 to allow an unlimited amount. # We recommend you leave this number high, for maximum performance. # MaxKeepAliveRequests 100 # # KeepAliveTimeout: Number of seconds to wait for the next request from the # same client on the same connection. # KeepAliveTimeout 15 ## ## Server-Pool Size Regulation (MPM specific) ## # prefork MPM # StartServers: number of server processes to start # MinSpareServers: minimum number of server processes which are kept spare # MaxSpareServers: maximum number of server processes which are kept spare # MaxClients: maximum number of server processes allowed to start # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_prefork_module> StartServers 4 MinSpareServers 4 MaxSpareServers 8 MaxClients 20 MaxRequestsPerChild 0 </IfModule> # worker MPM # StartServers: initial number of server processes to start # MaxClients: maximum number of simultaneous client connections # MinSpareThreads: minimum number of worker threads which are kept spare # MaxSpareThreads: maximum number of worker threads which are kept spare # ThreadsPerChild: constant number of worker threads in each server process # MaxRequestsPerChild: maximum number of requests a server process serves <IfModule mpm_worker_module> StartServers 4 MaxClients 20 MinSpareThreads 25 MaxSpareThreads 75 ThreadsPerChild 25 MaxRequestsPerChild 0 </IfModule> # These need to be set in /etc/apache2/envvars User ${APACHE_RUN_USER} Group ${APACHE_RUN_GROUP} # # AccessFileName: The name of the file to look for in each directory # for additional configuration directives. See also the AllowOverride # directive. # AccessFileName .htaccess # # The following lines prevent .htaccess and .htpasswd files from being # viewed by Web clients. # <Files ~ "^\.ht"> Order allow,deny Deny from all </Files> # # DefaultType is the default MIME type the server will use for a document # if it cannot otherwise determine one, such as from filename extensions. # If your server contains mostly text or HTML documents, "text/plain" is # a good value. If most of your content is binary, such as applications # or images, you may want to use "application/octet-stream" instead to # keep browsers from trying to display binary files as though they are # text. # DefaultType text/html # # HostnameLookups: Log the names of clients or just their IP addresses # e.g., www.apache.org (on) or 204.62.129.132 (off). # The default is off because it'd be overall better for the net if people # had to knowingly turn this feature on, since enabling it means that # each client request will result in AT LEAST one lookup request to the # nameserver. # HostnameLookups Off # ErrorLog: The location of the error log file. # If you do not specify an ErrorLog directive within a <VirtualHost> # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a <VirtualHost> # container, that host's errors will be logged there and not here. # ErrorLog /var/log/apache2/error.log # # LogLevel: Control the number of messages logged to the error_log. # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. # LogLevel warn # Include module configuration: Include /etc/apache2/mods-enabled/*.load Include /etc/apache2/mods-enabled/*.conf # Include all the user configurations: Include /etc/apache2/httpd.conf # Include ports listing Include /etc/apache2/ports.conf # # The following directives define some format nicknames for use with # a CustomLog directive (see below). # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i # LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent # # Define an access log for VirtualHosts that don't define their own logfile CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects # # Some examples: #ErrorDocument 500 "The server made a boo boo." #ErrorDocument 404 /missing.html #ErrorDocument 404 "/cgi-bin/missing_handler.pl" #ErrorDocument 402 http://www.example.com/subscription_info.html # # # Putting this all together, we can internationalize error responses. # # We use Alias to redirect any /error/HTTP_<error>.html.var response to # our collection of by-error message multi-language collections. We use # includes to substitute the appropriate text. # # You can modify the messages' appearance without changing any of the # default HTTP_<error>.html.var files by adding the line: # # Alias /error/include/ "/your/include/path/" # # which allows you to create your own set of files by starting with the # /usr/share/apache2/error/include/ files and copying them to /your/include/path/, # even on a per-VirtualHost basis. The default include files will display # your Apache version number and your ServerAdmin email address regardless # of the setting of ServerSignature. # # The internationalized error documents require mod_alias, mod_include # and mod_negotiation. To activate them, uncomment the following 30 lines. # Alias /error/ "/usr/share/apache2/error/" # # <Directory "/usr/share/apache2/error"> # AllowOverride None # Options IncludesNoExec # AddOutputFilter Includes html # AddHandler type-map var # Order allow,deny # Allow from all # LanguagePriority en cs de es fr it nl sv pt-br ro # ForceLanguagePriority Prefer Fallback # </Directory> # # ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var # ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var # ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var # ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var # ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var # ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var # ErrorDocument 410 /error/HTTP_GONE.html.var # ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var # ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var # ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var # ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var # ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var # ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var # ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var # ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var # ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var # ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var # Include of directories ignores editors' and dpkg's backup files, # see README.Debian for details. # Include generic snippets of statements Include /etc/apache2/conf.d/ # Include the virtual host configurations: Include /etc/apache2/sites-enabled/


----/etc/apache2/ports.conf

Код:

Listen 80 #у меня порт немножко другой :) <IfModule mod_ssl.c> # SSL name based virtual hosts are not yet supported, therefore no # NameVirtualHost statement here Listen 443 </IfModule>


---/etc/apache2/sites-enabled/000-default-----

Код:

NameVirtualHost *:80 <VirtualHost *:80> ServerAdmin mail@blablabla.jp DocumentRoot /home/strah/www/ #у себя эту строчку савишь в соответствии с FAQ <Directory /> AllowOverride None Order allow,deny Deny from all </Directory> <Directory /home/strah/www/> #эту тоже Options MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost>
/earth: file system full
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

ЭЭ, а кто это конкретно пишет? Веб сервер, при заходе на страничку. Или вот это: "sudo gedit /var/www/phpinfo.ph"?

Это браузер что веб сервер не доступен.
Ну, и, держи вдогонку мой конфиг(debian)

Ты мне объясни по подробнее с нуля как и что делать)))
Я так не смогу...
Спасибо сказали:
Аватара пользователя
strah
Сообщения: 283
ОС: Freebsd, linux, Solaris.

Re: Проблемы с apache

Сообщение strah »

Лена, давай так, выкладывай сюда /etc/apache2/apache2.conf,/etc/apache2/httpd.conf, все файлы в /etc/apache2/sites-enabled, название той папки, где будет размещаться веб-сервер, а мы тебе поправим эти конфиги, как нужно.
/earth: file system full
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

/etc/apache2/apache2.conf

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

#
# Based upon the NCSA server configuration files originally by Rob McCool.
#
# This is the main Apache server configuration file.  It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/docs/2.2/ for detailed information about
# the directives.
#
# Do NOT simply read the instructions in here without understanding
# what they do.  They're here only as hints or reminders.  If you are unsure
# consult the online docs. You have been warned.
#
# The configuration directives are grouped into three basic sections:
#  1. Directives that control the operation of the Apache server process as a
#     whole (the 'global environment').
#  2. Directives that define the parameters of the 'main' or 'default' server,
#     which responds to requests that aren't handled by a virtual host.
#     These directives also provide default values for the settings
#     of all virtual hosts.
#  3. Settings for virtual hosts, which allow Web requests to be sent to
#     different IP addresses or hostnames and have them handled by the
#     same Apache server process.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path.  If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "/var/log/apache2/foo.log"
# with ServerRoot set to "" will be interpreted by the
# server as "//var/log/apache2/foo.log".
#

### Section 1: Global Environment
#
# The directives in this section affect the overall operation of Apache,
# such as the number of concurrent requests it can handle or where it
# can find its configuration files.
#

#
# ServerRoot: The top of the directory tree under which the server's
# configuration, error, and log files are kept.
#
# NOTE!  If you intend to place this on an NFS (or otherwise network)
# mounted filesystem then please read the LockFile documentation (available
# at <URL:http://httpd.apache.org/docs-2.1/mod/mpm_common.html#lockfile>);
# you will save yourself a lot of trouble.
#
# Do NOT add a slash at the end of the directory path.
#
ServerRoot "/etc/apache2"

#
# The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
#
#<IfModule !mpm_winnt.c>
#<IfModule !mpm_netware.c>
LockFile /var/lock/apache2/accept.lock
#</IfModule>
#</IfModule>

#
# PidFile: The file in which the server should record its process
# identification number when it starts.
# This needs to be set in /etc/apache2/envvars
#
PidFile ${APACHE_PID_FILE}

#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

#
# KeepAlive: Whether or not to allow persistent connections (more than
# one request per connection). Set to "Off" to deactivate.
#
KeepAlive On

#
# MaxKeepAliveRequests: The maximum number of requests to allow
# during a persistent connection. Set to 0 to allow an unlimited amount.
# We recommend you leave this number high, for maximum performance.
#
MaxKeepAliveRequests 100

#
# KeepAliveTimeout: Number of seconds to wait for the next request from the
# same client on the same connection.
#
KeepAliveTimeout 15

##
## Server-Pool Size Regulation (MPM specific)
##

# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_prefork_module>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      10
    MaxClients          150
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
# StartServers: initial number of server processes to start
# MaxClients: maximum number of simultaneous client connections
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestsPerChild: maximum number of requests a server process serves
<IfModule mpm_worker_module>
    StartServers          2
    MaxClients          150
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    MaxRequestsPerChild   0
</IfModule>

# These need to be set in /etc/apache2/envvars
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives.  See also the AllowOverride
# directive.
#

AccessFileName .htaccess

#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<Files ~ "^\.ht">
    Order allow,deny
    Deny from all
</Files>

#
# DefaultType is the default MIME type the server will use for a document
# if it cannot otherwise determine one, such as from filename extensions.
# If your server contains mostly text or HTML documents, "text/plain" is
# a good value.  If most of your content is binary, such as applications
# or images, you may want to use "application/octet-stream" instead to
# keep browsers from trying to display binary files as though they are
# text.
#
DefaultType text/plain


#
# HostnameLookups: Log the names of clients or just their IP addresses
# e.g., www.apache.org (on) or 204.62.129.132 (off).
# The default is off because it'd be overall better for the net if people
# had to knowingly turn this feature on, since enabling it means that
# each client request will result in AT LEAST one lookup request to the
# nameserver.
#
HostnameLookups Off

# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here.  If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog /var/log/apache2/error.log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

# Include module configuration:
Include /etc/apache2/mods-enabled/*.load
Include /etc/apache2/mods-enabled/*.conf

# Include all the user configurations:
Include /etc/apache2/httpd.conf

# Include ports listing
Include /etc/apache2/ports.conf

#
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
# If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
#
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

#
# Define an access log for VirtualHosts that don't define their own logfile
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined

#
# Customizable error responses come in three flavors:
# 1) plain text 2) local redirects 3) external redirects
#
# Some examples:
#ErrorDocument 500 "The server made a boo boo."
#ErrorDocument 404 /missing.html
#ErrorDocument 404 "/cgi-bin/missing_handler.pl"
#ErrorDocument 402 http://www.example.com/subscription_info.html
#

#
# Putting this all together, we can internationalize error responses.
#
# We use Alias to redirect any /error/HTTP_<error>.html.var response to
# our collection of by-error message multi-language collections.  We use
# includes to substitute the appropriate text.
#
# You can modify the messages' appearance without changing any of the
# default HTTP_<error>.html.var files by adding the line:
#
#   Alias /error/include/ "/your/include/path/"
#
# which allows you to create your own set of files by starting with the
# /usr/share/apache2/error/include/ files and copying them to /your/include/path/,
# even on a per-VirtualHost basis.  The default include files will display
# your Apache version number and your ServerAdmin email address regardless
# of the setting of ServerSignature.
#
# The internationalized error documents require mod_alias, mod_include
# and mod_negotiation.  To activate them, uncomment the following 30 lines.

#    Alias /error/ "/usr/share/apache2/error/"
#
#    <Directory "/usr/share/apache2/error">
#        AllowOverride None
#        Options IncludesNoExec
#        AddOutputFilter Includes html
#        AddHandler type-map var
#        Order allow,deny
#        Allow from all
#        LanguagePriority en cs de es fr it nl sv pt-br ro
#        ForceLanguagePriority Prefer Fallback
#    </Directory>
#
#    ErrorDocument 400 /error/HTTP_BAD_REQUEST.html.var
#    ErrorDocument 401 /error/HTTP_UNAUTHORIZED.html.var
#    ErrorDocument 403 /error/HTTP_FORBIDDEN.html.var
#    ErrorDocument 404 /error/HTTP_NOT_FOUND.html.var
#    ErrorDocument 405 /error/HTTP_METHOD_NOT_ALLOWED.html.var
#    ErrorDocument 408 /error/HTTP_REQUEST_TIME_OUT.html.var
#    ErrorDocument 410 /error/HTTP_GONE.html.var
#    ErrorDocument 411 /error/HTTP_LENGTH_REQUIRED.html.var
#    ErrorDocument 412 /error/HTTP_PRECONDITION_FAILED.html.var
#    ErrorDocument 413 /error/HTTP_REQUEST_ENTITY_TOO_LARGE.html.var
#    ErrorDocument 414 /error/HTTP_REQUEST_URI_TOO_LARGE.html.var
#    ErrorDocument 415 /error/HTTP_UNSUPPORTED_MEDIA_TYPE.html.var
#    ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var
#    ErrorDocument 501 /error/HTTP_NOT_IMPLEMENTED.html.var
#    ErrorDocument 502 /error/HTTP_BAD_GATEWAY.html.var
#    ErrorDocument 503 /error/HTTP_SERVICE_UNAVAILABLE.html.var
#    ErrorDocument 506 /error/HTTP_VARIANT_ALSO_VARIES.html.var



# Include of directories ignores editors' and dpkg's backup files,
# see README.Debian for details.

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/


фаил /etc/apache2/httpd.conf пуст

Название и путь к папке /home/unwind/www/

/etc/apache2/sites-enabled
Там только один фаил был
0000-default

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

NameVirtualHost *:80

<VirtualHost *:80>

    ServerAdmin webmaster@localhost
     DocumentRoot "/var/l/www/phpMyAdmin"
      ErrorLog "/var/log/example.com-error_log"
    DocumentRoot  "/var/www/"
    CustomLog "/var/log/example.com-error_log-access_log" common
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory "/var/www/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        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 warn

    CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>
Спасибо сказали:
Аватара пользователя
strah
Сообщения: 283
ОС: Freebsd, linux, Solaris.

Re: Проблемы с apache

Сообщение strah »

Здесь у тебя все верно, попробуй, приведи /etc/apache2/sites-enabled/000-default к виду:

Код:

<VirtualHost *:80> ServerAdmin lena@unknown.jp DocumentRoot /home/unwind/www/ <Directory /> AllowOverride None Order allow,deny Deny from all </Directory> <Directory /home/unwind/www/> Options Indexes, MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost>
/earth: file system full
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

strah писал(а):
13.05.2009 23:30
Здесь у тебя все верно, попробуй, приведи /etc/apache2/sites-enabled/000-default к виду:

Код:

<VirtualHost *:80> ServerAdmin lena@unknown.jp DocumentRoot /home/unwind/www/ <Directory /> AllowOverride None Order allow,deny Deny from all </Directory> <Directory /home/unwind/www/> Options Indexes, MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost>


Т.е. удалить всё ??? и оставить только это ?
Спасибо сказали:
Аватара пользователя
strah
Сообщения: 283
ОС: Freebsd, linux, Solaris.

Re: Проблемы с apache

Сообщение strah »

Faruna писал(а):
13.05.2009 23:34
Т.е. удалить всё ??? и оставить только это ?

Хай.
/earth: file system full
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

Сделала.
Теперь попробовала запустить скрипт, находящийся в этой директории.
ну, т.е. /home/unwind/www/, и прописала http://localhost/index.php после чего он меня спросил, хочу ли я сохранить файл index.php....
Спасибо сказали:
Аватара пользователя
strah
Сообщения: 283
ОС: Freebsd, linux, Solaris.

Re: Проблемы с apache

Сообщение strah »

Faruna писал(а):
13.05.2009 23:41
Сделала.
Теперь попробывала запустить скрипт находящийся в этой директории.
ну т.е. /home/unwind/www/ и прописала http://localhost/index.php после чего он меня просил хочу ли я сохранить файл index.php....

Так, /etc/apache2/mods-enabled/php5.load присутствует? Пакет php5-common установлен? Кроме того, попробуй заменить в файле /etc/apache2/apache2.conf строчку "DefaultType text/plain" на "DefaultType text/html".
/earth: file system full
Спасибо сказали:
Faruna
Сообщения: 118

Re: Проблемы с apache

Сообщение Faruna »

Так, /etc/apache2/mods-enabled/php5.load присутствует? Пакет php5-common установлен? Кроме того, попробуй заменить в файле /etc/apache2/apache2.conf строчку "DefaultType text/plain" на "DefaultType text/html".

Как пишет терминал - присутствует.
Сейчас попробую прописать.

Прописала - всё равно одно и тоже.
А терминал пишет, что присутствует.

Я иммею ввиду — присутствует php5-common

/etc/apache2/mods-enabled/php5.load - этого фаила нет
Спасибо сказали:
Аватара пользователя
devilr
Сообщения: 3670
ОС: Mandriva => Gentoo (~amd64)
Контактная информация:

Re: Проблемы с apache

Сообщение devilr »

Я думаю, что апач просто не знает, что делать с php файлами
Допустим у меня в /etc/apache2/httpd.conf

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

DirectoryIndex    index.html    index.php
AddHandler    php5-script    php
AddType        text/html    php
AddType        application/x-httpd-php .php .htm .html .phtml
LoadModule    php5_module modules/libphp5.so

ключевое здесь AddType
Кстати, а если просто положить html файл в тут папку, где лежит index.php - он откроется в браузере?

P.S. У меня не убунту, но все же
Мудрость приходит с возрастом.
Иногда возраст приходит один.
Эхо разума
Спасибо сказали:
Ответить