Debian linux starting web server failed

Установка Apache в Debian Wheezy

Как нынче устанавливается apache на debian wheezy?
Действуя по этому руководству http://wiki.debian.org/LaMp, набрав в строке браузера 127.0.0.1, 127.0.1.1 и localhost, я ничего не увидел.

mysql-server-5.1 в wheezy уже нет. да и на php c mysql мне пофиг если честно.

Апача, как видишь, нет. Конфиги какие именно? Пути, или хотя бы названия дай пожалуйста.

Извиняюсь, со squeeze названия пакетов на автомате написал.

А так же проверить, включены ли виртхосты в /etc/apache2/sites-enabled/ (тут должны быть симлинки на конфиги из предыдущей директории). Включить/выключить можно руками создав симлинки или же командами a2ensite/a2dissite

Ну и в процессах вообще запущен апач? Если не запущен, то что говорит на /etc/init.d/apache2 start ?

Из-под рута такие вещи надо запускать.
Апач есть и слушает ipv6. Либо отключай ipv6, либо назначай апачу адрес прослушивания в явном виде.

/etc/apache2/apach2.conf http://pastebin.com/CJN7wTmZ
/etc/apache2/ports.conf http://pastebin.com/z99Q83vf
/etc/apache2/sites-available/default http://pastebin.com/s35JWMic http://pastebin.com/caduEsRR
Ссылки есть в /etc/apache2/sites-enable, и в процессах запущен /usr/sbin/apache2 -k start

О, тогда есть апач

Собственно, thesis уже ответил.

Я бы просто прописал конкретный адрес апачу в таком случае, т.е. в ports.conf — Listen 127.0.0.1:80

Ну и рестарт после изменений, само собой.

я поменял на Listen 127.0.0.1:80, при перезапуске апач выдаёт

эээ. Впервые такое вижу. А ipv4 вообще на этом компе работает?

Источник

Не запускается apache

# sudo systemctl status apache2 ● apache2.service — The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; disabled; vendor preset: enab Drop-In: /lib/systemd/system/apache2.service.d └─apache2-systemd.conf Active: failed (Result: exit-code) since Sat 2020-05-09 19:43:59 UTC; 27min ago

May 09 19:43:59 vm-9699334a systemd[1]: Starting The Apache HTTP Server… May 09 19:43:59 vm-9699334a apachectl[23308]: apache2: Could not open configuration f May 09 19:43:59 vm-9699334a apachectl[23308]: Action ‘start’ failed. May 09 19:43:59 vm-9699334a apachectl[23308]: The Apache error log may have more info May 09 19:43:59 vm-9699334a systemd[1]: apache2.service: Control process exited, code May 09 19:43:59 vm-9699334a systemd[1]: apache2.service: Failed with result ’exit-cod May 09 19:43:59 vm-9699334a systemd[1]: Failed to start The Apache HTTP Server. lines 1-13/13 (END)

Логи апача пустые В чем может быть проблема и как ее решить?

systemctl enable —now apache2 что даёт?

May 09 19:43:59 vm-9699334a apachectl[23308]: apache2: Could not open configuration file

угадай с трех раз

Если даже дефолтные конфиги не загрузились, то скорей всего нужно просто:

root@vm-9699334a:

# systemctl enable –now apache2 Synchronizing state of apache2.service with SysV service script with /lib/systemd/systemd-sysv-install. Executing: /lib/systemd/systemd-sysv-install enable apache2 Job for apache2.service failed because the control process exited with error code. See «systemctl status apache2.service» and «journalctl -xe» for details. root@vm-9699334a:

# journalctl -xe May 10 03:28:52 vm-9699334a xrdp[5036]: (5036)(139984984713024)[INFO ] Using default X.5 May 10 03:28:52 vm-9699334a xrdp[5036]: (5036)(139984984713024)[ERROR] Cannot read priva May 10 03:28:52 vm-9699334a xrdp[5036]: (5036)(139984984713024)[DEBUG] TLSv1.2 enabled May 10 03:28:52 vm-9699334a xrdp[5036]: (5036)(139984984713024)[DEBUG] TLSv1.1 enabled May 10 03:28:52 vm-9699334a xrdp[5036]: (5036)(139984984713024)[DEBUG] TLSv1 enabled May 10 03:28:52 vm-9699334a xrdp[5036]: (5036)(139984984713024)[DEBUG] Security layer: r May 10 03:28:52 vm-9699334a xrdp[5036]: (5036)(139984984713024)[DEBUG] Closed socket 12 May 10 03:28:55 vm-9699334a kernel: [UFW BLOCK] IN=eth0 OUT= MAC=54:52:00:0f:69:4f:b2:6b May 10 03:29:06 vm-9699334a systemd[1]: Reloading. May 10 03:29:06 vm-9699334a systemd[1]: Reloading. May 10 03:29:06 vm-9699334a systemd[1]: Reloading. May 10 03:29:07 vm-9699334a systemd[1]: Starting The Apache HTTP Server… – Subject: Unit apache2.service has begun start-up – Defined-By: systemd – Support: http://www.ubuntu.com/support

– Unit apache2.service has begun starting up. May 10 03:29:07 vm-9699334a apachectl[5096]: AH00534: apache2: Configuration error: No M May 10 03:29:07 vm-9699334a apachectl[5096]: Action ‘start’ failed. May 10 03:29:07 vm-9699334a apachectl[5096]: The Apache error log may have more informat May 10 03:29:07 vm-9699334a systemd[1]: apache2.service: Control process exited, code=ex May 10 03:29:07 vm-9699334a systemd[1]: apache2.service: Failed with result ‘exit-code’. May 10 03:29:07 vm-9699334a systemd[1]: Failed to start The Apache HTTP Server. – Subject: Unit apache2.service has failed – Defined-By: systemd – Support: http://www.ubuntu.com/support

– Unit apache2.service has failed.

– The result is RESULT.

Пробовал, не помогло

/etc/apache2/apache2.conf в студию! И используйте форматирование, простыню текста сложно читать, когда переходы на новую строку не существуют.

Читайте также:  Как определить диск ssd или hdd windows 10

# 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.4/ for detailed information about # the directives and /usr/share/doc/apache2/README.Debian about Debian specific # hints. # # # Summary of how the Apache 2 configuration works in Debian: # The Apache 2 web server configuration in Debian is quite different to # upstream’s suggested way to configure the web server. This is because Debian’s # default Apache2 installation attempts to make adding and removing modules, # virtual hosts, and extra configuration directives as flexible as possible, in # order to make automating the changes and administering the server as easy as # possible.

# It is split into several files forming the configuration hierarchy outlined # below, all located in the /etc/apache2/ directory: # # /etc/apache2/ # |— apache2.conf # | `— ports.conf # |— mods-enabled # | |— *.load # | `— *.conf # |— conf-enabled # | `— *.conf # `— sites-enabled # `— *.conf # # # * apache2.conf is the main configuration file (this file). It puts the pieces # together by including all remaining configuration files when starting up the # web server. # # * ports.conf is always included from the main configuration file. It is # supposed to determine listening ports for incoming connections which can be # customized anytime. # # * Configuration files in the mods-enabled/, conf-enabled/ and sites-enabled/ # directories contain particular configuration snippets which manage modules, # global configuration fragments, or virtual host configurations, # respectively. # # They are activated by symlinking available configuration files from their # respective *-available/ counterparts. These should be managed by using our # helpers a2enmod/a2dismod, a2ensite/a2dissite and a2enconf/a2disconf. See # their respective man pages for detailed information. # # * The binary is called apache2. Due to the use of environment variables, in # the default configuration, apache2 needs to be started/stopped with # /etc/init.d/apache2 or apache2ctl. Calling /usr/bin/apache2 directly will not # work with the default configuration.

# # The accept serialization lock file MUST BE STORED ON A LOCAL DISK. # #Mutex file:$ default

# # The directory where shm and other runtime files will be stored. #

# # 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 $

# # 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 5

# These need to be set in /etc/apache2/envvars User $ Group $

# # HostnameLookups: Log the names of clients or just their IP addresses # e.g., http://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 # container, error messages relating to that virtual host will be # logged here. If you *do* define an error logfile for a # container, that host’s errors will be logged there and not here. # ErrorLog $/error.log

# # LogLevel: Control the severity of messages logged to the error_log. # Available values: trace8, . trace1, debug, info, notice, warn, # error, crit, alert, emerg. # It is also possible to configure the log level for particular modules, e.g. # «LogLevel info ssl:warn» # LogLevel warn

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

# Include list of ports to listen on Include ports.conf

# Sets the default security model of the Apache2 HTTPD server. It does # not allow access to the root filesystem outside of /usr/share and /var/www. # The former is used by web applications packaged in Debian, # the latter may be used for local directories served by the web server. If # your system is serving content from a sub-directory in /srv you must allow # access here, or in any related virtual host. Options FollowSymLinks AllowOverride None Require all denied

AllowOverride None Require all granted

Options Indexes FollowSymLinks AllowOverride None Require all granted

# # Options Indexes FollowSymLinks # AllowOverride None # Require all granted #

# 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. # Require all denied

# # The following directives define some format nicknames for use with # a CustomLog directive. # # These deviate from the Common Log Format definitions in that they use %O # (the actual bytes sent including headers) instead of %b (the size of the # requested file), because the latter makes it impossible to detect partial # requests. # # Note that the use of %i instead of %h is not recommended. # Use mod_remoteip instead. # LogFormat «%v:%p %h %l %u %t \»%r\» %>s %O \«%i\» \«%i\»» vhost_combined LogFormat «%h %l %u %t \»%r\» %>s %O \«%i\» \«%i\»» combined LogFormat «%h %l %u %t \»%r\» %>s %O» common LogFormat «%i -> %U» referer LogFormat «%i» agent

Читайте также:  Windows iso usb uefi

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

# Include generic snippets of statements IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations: IncludeOptional sites-enabled/*.conf

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Источник

Разбор ошибок Debian

The repository does not have a Release file.

При попытке выполнить

sudo apt update

[sudo] password for andrei: Ign:1 cdrom://[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26] buster InRelease Err:2 cdrom://[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26] buster Release Please use apt-cdrom to make this CD-ROM recognized by APT. apt-get update cannot be used to add new CD-ROMs Err:3 http://deb.debian.org/debian buster InRelease Cannot initiate the connection to prod.debian.map.fastly.net:80 (2a04:4e42:14::204). — connect (101: Network is unreachable) Could not connect to prod.debian.map.fastly.net:80 (151.101.84.204), connection timed out Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:14::645). — connect (101: Network is unreachable) Could not connect to deb.debian.org:80 (151.101.86.133), connection timed out Err:4 http://deb.debian.org/debian buster-updates InRelease Cannot initiate the connection to deb.debian.org:80 (2a04:4e42:14::645). — connect (101: Network is unreachable) Err:5 http://security.debian.org/debian-security buster/updates InRelease Cannot initiate the connection to prod.debian.map.fastly.net:80 (2a04:4e42:14::204). — connect (101: Network is unreachable) Could not connect to prod.debian.map.fastly.net:80 (151.101.84.204), connection timed out Cannot initiate the connection to security.debian.org:80 (2a04:4e42:c00::204). — connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:200::204). — connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:400::204). — connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:a00::204). — connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42::204). — connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:800::204). — connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:600::204). — connect (101: Network is unreachable) Cannot initiate the connection to security.debian.org:80 (2a04:4e42:e00::204). — connect (101: Network is unreachable) Could not connect to security.debian.org:80 (151.101.0.204), connection timed out Could not connect to security.debian.org:80 (151.101.128.204), connection timed out Could not connect to security.debian.org:80 (151.101.192.204), connection timed out Could not connect to security.debian.org:80 (151.101.64.204), connection timed out Reading package lists. Done E: The repository ‘cdrom://[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26] buster Release’ does not have a Release file. N: Updating from such a repository can’t be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

sudo vi /etc/apt/sources.list

# deb cdrom:[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26]/ buster contrib main deb cdrom:[Debian GNU/Linux 10.4.0 _Buster_ — Official amd64 DVD Binary-1 20200509-10:26]/ buster contrib main deb http://deb.debian.org/linux/debian/ buster main deb-src http://deb.debian.org/linux/debian/ buster main deb http://security.debian.org/debian-security buster/updates main contrib deb-src http://security.debian.org/debian-security buster/updates main contrib # buster-updates, previously known as ‘volatile’ deb http://deb.debian.org/linux/debian/ buster-updates main contrib deb-src http://deb.debian.org/linux/debian/ buster-updates main contrib

Restarting networking failed because the control process exited with error code.

При попытке перезапустить сеть

andrei@debian:/etc/network$ sudo /etc/init.d/networking restart

[. ] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code. See «systemctl status networking.service» and «journalctl -xe» for details.

Оказалось, что при редактировании /etc/network/interfaces перепутал в названии интерфейса wlp1s0 l и 1 и написал вместо wlp 1 s0 wlp l s0

Failed to start A high performance web server and a reverse proxy server

При попытке установить Nginx в Debian 10

sudo apt install nginx

Setting up libnginx-mod-http-upstream-fair (1.14.2-2+deb10u1) . Setting up nginx-full (1.14.2-2+deb10u1) . Job for nginx.service failed because the control process exited with error code. See «systemctl status nginx.service» and «journalctl -xe» for details. invoke-rc.d: initscript nginx, action «start» failed . ● nginx.service — A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2020-06-18 17:30:41 EEST; 12ms ago Docs: man:nginx(8) Process: 7196 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Process: 7198 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE) Oct 11 04:42:44 debian nginx[7198]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[7198]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[7198]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[7198]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[7198]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[7198]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[7198]: nginx: [emerg] still could not bind() Oct 11 04:42:44 debian systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE Oct 11 04:42:44 debian systemd[1]: nginx.service: Failed with result ‘exit-code’. Oct 11 04:42:44 debian systemd[1]: Failed to start A high performance web server and a reverse proxy server. dpkg: error processing package nginx-full (—configure): installed nginx-full package post-installation script subprocess returned error exit status 1 dpkg: dependency problems prevent configuration of nginx: nginx depends on nginx-full ( = 1.14.2-2+deb10u1) | nginx-light (>= 1.14.2-2+deb10u1) | nginx-extras (>= 1.14.2-2+deb10u1); however: Package nginx-full is not configured yet. Package nginx-light is not installed. Package nginx-extras is not installed. dpkg: error processing package nginx (—configure): dependency problems — leaving unconfigured Processing triggers for man-db (2.8.5-2) . Processing triggers for systemd (241-7

Читайте также:  Утилиту autoruns для windows

deb10u4) . Errors were encountered while processing: nginx-full nginx E: Sub-process /usr/bin/dpkg returned an error code (1)

systemctl status nginx.service

● nginx.service — A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Thu 2020-06-18 21:42:54 EEST; 5min ago Docs: man:nginx(8) Process: 15224 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS) Process: 15225 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=1/FAILURE)

sudo journalctl -xe

— Subject: A start job for unit nginx.service has begun execution — Defined-By: systemd — Support: https://www.debian.org/support — — A start job for unit nginx.service has begun execution. — — The job identifier is 2744. Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] bind() to [::]:80 failed (98: Address already in use) Oct 11 04:42:44 debian nginx[15225]: nginx: [emerg] still could not bind() Oct 11 04:42:44 debian systemd[1]: nginx.service: Control process exited, code=exited, status=1/FAILURE — Subject: Unit process exited — Defined-By: systemd — Support: https://www.debian.org/support — — An ExecStart= process belonging to unit nginx.service has exited. — — The process’ exit code is ‘exited’ and its exit status is 1. Oct 11 04:42:44 debian systemd[1]: nginx.service: Failed with result ‘exit-code’. — Subject: Unit failed — Defined-By: systemd — Support: https://www.debian.org/support — — The unit nginx.service has entered the ‘failed’ state with result ‘exit-code’. Oct 11 04:42:44 debian systemd[1]: Failed to start A high performance web server and a reverse proxy server. — Subject: A start job for unit nginx.service has failed — Defined-By: systemd — Support: https://www.debian.org/support — — A start job for unit nginx.service has finished with a failure. — — The job identifier is 2744 and the job result is failed. Oct 11 04:42:44 debian sudo[8241]: pam_unix(sudo:session): session closed for user root Oct 11 04:42:44 debian PackageKit[8233]: daemon quit Oct 11 04:42:44 debian systemd[1]: packagekit.service: Main process exited, code=killed, status=15/TERM — Subject: Unit process exited — Defined-By: systemd — Support: https://www.debian.org/support — — An ExecStart= process belonging to unit packagekit.service has exited. — — The process’ exit code is ‘killed’ and its exit status is 15. Oct 11 04:42:44 debian systemd[1]: packagekit.service: Succeeded. — Subject: Unit succeeded — Defined-By: systemd — Support: https://www.debian.org/support — — The unit packagekit.service has successfully entered the ‘dead’ state. Oct 11 04:42:44 debian sudo[19594]: andrei : TTY=pts/0 ; PWD=/home/andrei ; USER=root ; COMMAND=/usr/bin/journalctl -xe Oct 11 04:42:44 debian sudo[19594]: pam_unix(sudo:session): session opened for user root by andrei(uid=0)

Из логов можно сделать вывод, что порт 80, который нужен Nginx уже занят. Я так подозреваю, что Apache. Поэтому нужно удалить или отключить Apache и поставить Nginx

Источник

Оцените статью