[+] Apache nie wstaje.

Konfiguracja serwerów, usług, itp.
bilivj
Posty: 25
Rejestracja: 11 lutego 2014, 18:16

[+] Apache nie wstaje.

Post autor: bilivj »

Zmieniałem ustawienia vhosta jednak nie działało to jak należy.
Przywróciłem sobie oryginalny plik vhosta bo wcześniej zrobiłem jego kopie.
Niestety po tej operacji apache nie wstaje.
Błędy:

Kod: Zaznacz cały

root@aaaaa:~# /etc/init.d/apache2 restart
[....] Restarting apache2 (via systemctl): apache2.serviceJob for apache2.service failed. See 'systemctl status apache2.service' and 'journalctl -xn' for details.
 failed!
root@aaaaa:~# systemctl status apache2.service
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2)
   Active: failed (Result: exit-code) since pon 2015-10-19 14:18:26 CEST; 27s ago
  Process: 10641 ExecStop=/etc/init.d/apache2 stop (code=exited, status=0/SUCCESS)
  Process: 2515 ExecReload=/etc/init.d/apache2 reload (code=exited, status=0/SUCCESS)
  Process: 10940 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)


paź 19 14:18:26 aaaaa.ovh.net apache2[10940]: The apache2 configtest failed. ... (warning).
paź 19 14:18:26 aaaaa.ovh.net apache2[10940]: Output of config test was:
paź 19 14:18:26 aaaaa.ovh.net apache2[10940]: [Mon Oct 19 14:18:26.798915 2015] [alias:warn] [pid 10949] AH00671: The Alias directive in /etc/apache2/conf-enabled/squirre...lier Alias.
paź 19 14:18:26 aaaaa.ovh.net apache2[10940]: AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:62
paź 19 14:18:26 aaaaa.ovh.net apache2[10940]: AH00543: apache2: bad user name web2
paź 19 14:18:26 aaaaa.ovh.net apache2[10940]: Action 'configtest' failed.
paź 19 14:18:26 aaaaa.ovh.net apache2[10940]: The Apache error log may have more information.
paź 19 14:18:26 aaaaa.ovh.net systemd[1]: apache2.service: control process exited, code=exited status=1
paź 19 14:18:26 aaaaa.ovh.net systemd[1]: Failed to start LSB: Apache2 web server.
paź 19 14:18:26 aaaaa.ovh.net systemd[1]: Unit apache2.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
Nie wiem jak rozwiązać ten problem.

System Debian 8 jessie + ispconfig
Awatar użytkownika
Yampress
Administrator
Posty: 6422
Rejestracja: 09 sierpnia 2007, 21:41
Lokalizacja: PL

Post autor: Yampress »

chyba nie do końca stało się tak jak mówisz. Jakiś alias jest od wiewióry.

/etc/apache2/conf-enabled/squirre...lier Alias.
bilivj
Posty: 25
Rejestracja: 11 lutego 2014, 18:16

Post autor: bilivj »

W podanym pliku nic nie modyfikowałem.
Udało mi się postawić apache. Usunąłem pliki vhosta dla domeny którą modyfikowałem z site-avaible oraz site-enabled usunąłem katalog i dodałem ponownie przez pasnel i wstał
Ale nie rozumiem, że jak namieszałem w konfiguracji vhosta a potem przywróciłem oryginał to już nie chciało zadziałać.

Wrzucam plik: squirrelmail.conf bo może jednak jest w nim coś nie tak.

Kod: Zaznacz cały

Alias /squirrelmail /usr/share/squirrelmail

<Directory /usr/share/squirrelmail>
  Options FollowSymLinks
  <IfModule mod_php5.c>
    AddType application/x-httpd-php .php
    php_flag magic_quotes_gpc Off
    php_flag track_vars On
    php_admin_flag allow_url_fopen Off
    php_value include_path .
    php_admin_value upload_tmp_dir /var/lib/squirrelmail/tmp
    php_admin_value open_basedir /usr/share/squirrelmail:/etc/squirrelmail:/var/lib/squirrelmail:/etc/hostname:/etc/mailname
    php_flag register_globals off
  </IfModule>
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>


  # access to configtest is limited by default to prevent information leak
  <Files configtest.php>
    order deny,allow
    deny from all
    allow from 127.0.0.1
  </Files>
</Directory>


# users will prefer a simple URL like http://webmail.example.com
#<VirtualHost 1.2.3.4>
#  DocumentRoot /usr/share/squirrelmail
#  ServerName webmail.example.com
#</VirtualHost>


# redirect to https when available (thanks omen@descolada.dartmouth.edu)
#
#  Note: There are multiple ways to do this, and which one is suitable for
#  your site's configuration depends. Consult the apache documentation if
#  you're unsure, as this example might not work everywhere.
#
#<IfModule mod_rewrite.c>
#  <IfModule mod_ssl.c>
#    <Location /squirrelmail>
#      RewriteEngine on
#      RewriteCond %{HTTPS} !^on$ [NC]
#      RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI}  [L]
#    </Location>
#  </IfModule>
#</IfModule>


Alias /squirrelmail /usr/share/squirrelmail
Alias /webmail /usr/share/squirrelmail




<VirtualHost *:80>
  DocumentRoot /usr/share/squirrelmail
  ServerName webmail.aaaaaa.ovh.net
</VirtualHost>


Awatar użytkownika
pawkrol
Moderator
Posty: 939
Rejestracja: 03 kwietnia 2011, 10:25

Post autor: pawkrol »

Przykład :

Kod: Zaznacz cały

<VirtualHost *:80>
alias /costam "/opt/html/costam/"
    <Directory "/opt/html/costam/">
       Options Indexes FollowSymLinks MultiViews
       AllowOverride ALL
    Order deny,allow
    </Directory>
</VirtualHost>
Jak dla mnie nie ma aliasów w sekcji virtualhost, bądź jest ona nie zamknięta.
bilivj
Posty: 25
Rejestracja: 11 lutego 2014, 18:16

Post autor: bilivj »

Czyli problem może być z wrzuconymi luźno:

Kod: Zaznacz cały

Alias /squirrelmail /usr/share/squirrelmail
Alias /webmail /usr/share/squirrelmail
Postąpiłem według instrukcji: https://www.howtoforge.com/tutorial/per ... onfig-3/3/ punkt 19

Czy powinno być?

Kod: Zaznacz cały

<VirtualHost *:80>
Alias /squirrelmail /usr/share/squirrelmail
</VirtualHost>
Awatar użytkownika
Yampress
Administrator
Posty: 6422
Rejestracja: 09 sierpnia 2007, 21:41
Lokalizacja: PL

Post autor: Yampress »

No i instalowałeś alias do katalogu wiewióra. No i zostało...
Awatar użytkownika
pawkrol
Moderator
Posty: 939
Rejestracja: 03 kwietnia 2011, 10:25

Post autor: pawkrol »

https://httpd.apache.org/docs/2.2/mod/mod_alias.html

Wprowadziłem Cię w błąd. Wg manuala alias może także być poza sekcją virtualhost. Chociaż ja zawsze używam w tejże sekcji.

Co pokazuje polecenie ( wtedy gdy masz błędy)
Ewentualnie error.log

Kod: Zaznacz cały

apachectl configtest
bilivj
Posty: 25
Rejestracja: 11 lutego 2014, 18:16

Post autor: bilivj »

Kod: Zaznacz cały

root@aaaaaa:~# apachectl configtest
[Mon Oct 19 21:25:12.650186 2015] [alias:warn] [pid 7369] AH00671: The Alias directive in /etc/apache2/conf-enabled/squirrelmail.conf at line 49 will probably never match because it overlaps an earlier Alias.
AH00548: NameVirtualHost has no effect and will be removed in the next release /etc/apache2/sites-enabled/000-ispconfig.conf:62
Syntax OK
root@aaaaaa:~#
49 linijka pliku squirrelmail.conf

Kod: Zaznacz cały

Alias /squirrelmail /usr/share/squirrelmail
62 linijka pliku ispconfig.conf

Kod: Zaznacz cały

NameVirtualHost *:80
Chyba, że wrzucić całe te pliki?
Awatar użytkownika
pawkrol
Moderator
Posty: 939
Rejestracja: 03 kwietnia 2011, 10:25

Post autor: pawkrol »

1. Warn - Masz zdublowane aliasy (Alias /squirrelmail /usr/share/squirrelmail)
2. NameVirtualHost - jak podaje komunikat opcja będzie usunięta w następnej wersji
3. Sekcja virtualhost. Zerknij sobie na przykład który Ci podałem oraz:

Kod: Zaznacz cały

/etc/apache2/sites-enabled/000-default
może ci się coś rozjaśni.
bilivj
Posty: 25
Rejestracja: 11 lutego 2014, 18:16

Post autor: bilivj »

Wielkie dzięki za pomoc, zero błędów teraz.

Pozdrawiam
Zablokowany