Bir CentOS 7sunucuda, sudo apachectl restartaltına bir ekleme dosyası ekledikten sonra yazarken aşağıdaki hatayı alıyorum httpd.conf:
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
Sonra yazdığınızda sudo systemctl status httpd.service -l, sonuç:
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: exit-code) since Tue 2014-12-23 20:10:37 EST; 2min 15s ago
Process: 2101 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 2099 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 2099 (code=exited, status=1/FAILURE)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
Dec 23 20:10:37 ip-address httpd[2099]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::e23f:49ff:feb7:2a21. Set the 'ServerName' directive globally to suppress this message
Dec 23 20:10:37 ip-address systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Dec 23 20:10:37 ip-address systemd[1]: Failed to start The Apache HTTP Server.
Dec 23 20:10:37 ip-address systemd[1]: Unit httpd.service entered failed state.
Alabilirim apacheben direktif şunlardır dışarı yorum yaparsanız yeniden ve edersem ben-yorumlama direktifi bulunmaktadır yeniden hatayı yeniden oluşturabilirsiniz. İçerme dosyasının içeriğini kullanarak doğru bir şekilde nasıl apachebaşlayabilirim?
Altındaki çizgi httpd.confolduğunu tetikleyiciler hatadır: IncludeOptional sites-enabled/*.conf. Klasördeki tek .confdosya aşağıdaki içeriğe sahiptir: sites-enabledmydomain.com.conf
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
DocumentRoot /var/www/mydomain.com/public_html
ErrorLog /var/www/mydomain.com/error.log
CustomLog /var/www/mydomain.com/requests.log combined
</VirtualHost>
httpd.confİle önceden yüklenmiş olarak geliyor neyi aynıdır httpdtek satırda haricinde yukarıda direktif bulunmaktadır. Yaptığım çünkü biliyorum sudo yum remove httpd mod_sslve sudo yum install httpd mod_sslsağ bu hatayı tetikleyen önce. Bütün httpd.confbir dosya paylaşım sitesinde okunabilir bu bağlantıya tıklayarak .
Açıkça bu öğretici adımları izlerken bu sorunla karşılaştı .
İçerme dosyasını http/mydomain.comyorumladığımda /var/www/html, içinde DocumentRoottanımlanan statik içeriği başarıyla sunar httpd.conf. Sorun VirtualHost, yukarıda gösterilen include dosyasındaki yönergeden geliyor gibi görünüyor . Teşhise yardımcı olmak için, aşağıdaki .confüç yönerge içinde yer alan tüm dosyaların bağlantılarını aşağıdaki EDIT # 3'e ekledim httpd.conf.
DÜZENLEME # 1
Ben M32 tavsiyesine çalıştığınızda değiştirmeye /etc/hostnametanımlamak mydomain.com, apacheyine yeniden olmayacak ve systemctl status httpd.serviceaşağıdaki sonuçları:
[sudo_user_account@server-ip-address ~]$ sudo systemctl status httpd.service -l
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled)
Active: failed (Result: exit-code) since Tue 2014-12-23 14:25:35 EST; 20s ago
Process: 31993 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 31991 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 31991 (code=exited, status=1/FAILURE)
Status: "Total requests: 1; Current requests/sec: 0; Current traffic: 0 B/sec"
Dec 23 14:25:35 hostname systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Dec 23 14:25:35 hostname systemd[1]: Failed to start The Apache HTTP Server.
Dec 23 14:25:35 hostname systemd[1]: Unit httpd.service entered failed state.
DÜZENLEME # 2
Ayrıca /etc/hosts, aşağıdaki resimde tanımlandığı gibi, dosyamın içeriğini değiştirmek için eyoung100'ün tavsiyesini denedim , ancak yine de yukarıdaki EDIT # 1'de tanımlanan hatayı alıyorum.
DÜZENLEME 3.
DerekC'nin isteği üzerine koştum sudo apachectl configtestve aldım:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::e23f:49ff:feb7:2a21. Set the 'ServerName' directive globally to suppress this message
Syntax OK
Ayrıca, GarethTheRed'in önerisine göre, httpd.conf'daki içerme yönergelerini inceledim . Httpd.conf dosyasında üç içerme yönergesi vardır . Her üç yönergenin klasöründe bulunan tüm dosyalarla birlikte aşağıdaki üçü de listeledim. Bunların tümü .confkurulu standart dosyalardır httpd. Henüz hiçbirini değiştirmedim. .confAşağıdaki bağlantıları tıklayarak bir dosya paylaşım sitesindeki her dosyayı görüntüleyebilirsiniz:
Include conf.modules.d/*.confconf.modules.ddizindeki şu dosyalara referansta bulunur :
00-base.conf
00-dav.conf
00-lua.conf
00-mpm.conf
00-proxy.conf
00-ssl.conf
00-systemd.conf
01-cgi.conf
IncludeOptional conf.d/*.confreferanslar aşağıdaki dosyalar conf.ddizininin:
autoindex.conf
ssl.conf
userdir.conf
welcome.conf
Burada atlayarak olduğumu bir README dosyası da bulunmaktadır.
Ayrıca, IncludeOptional sites-enabled/*.confyönerge ve içeriği yukarıdaki OP'de ayrıntılı olarak özetlenmiştir.
Bunlardan herhangi biri, içindeki VirtualHostayarlarla çakışan dosyalar içeriyor mydomain.com.confmu?
DÜZENLEME 4.
GarethTheRed önerisi uyarınca, ben taşındı mydomain.com.confiçin conf.ddizin ve daha sonra satırları yorum başlayan mydomain.com.confdek birer birer httpdyeniden başardı. Daha sonra kaç satır kaldığını ve httpdhala yeniden başlayabildiğini görmek için satırların yorumunu kaldırmaya başladım . Elde edebildi httpdyeniden başlatmak için, ancaksystemctl status httpd.service -l aynı uyarıyı üretmeye devam ediyor:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::e23f:49ff:feb7:2a21. Set the 'ServerName' directive globally to suppress this message
İzin veren VirtualHostsözdizimihttpd aşağıdaki gibidir (yukarıdaki uyarısı oluşturur devam gerçi) başlamaktır:
<VirtualHost *:80>
ServerName www.mydomain.com
ServerAlias mydomain.com
DocumentRoot /var/www/mydomain.com/public_html
</VirtualHost>
Varlığı uyarıyı http'yi başlatmak için tam bir yetersizliğe yükselten aşağıdaki satırları atlamak zorunda olduğumu unutmayın:
# ErrorLog /var/www/mydomain.com/error.log
# CustomLog /var/www/mydomain.com/requests.log combined
Ayrıca koştum sudo journalctl -xelu httpdve terminal aşağıdakileri tekrarlayarak cevap verdi:
--
-- Unit httpd.service has finished shutting down.
Dec 24 17:48:43 server-ip-address systemd[1]: Stopped The Apache HTTP Server.
-- Subject: Unit httpd.service has finished shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has finished shutting down.
Dec 24 17:48:48 server-ip-address systemd[1]: Starting The Apache HTTP Server...
-- Subject: Unit httpd.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has begun starting up.
Dec 24 17:48:48 server-ip-address httpd[10364]: AH00558: httpd: Could not reliably d
Dec 24 17:48:48 server-ip-address systemd[1]: Started The Apache HTTP Server.
-- Subject: Unit httpd.service has finished start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit httpd.service has finished starting up.
--
-- The start-up result is done.
lines 887-909/909 (END)
Not: Yukarıdaki sonuçlar, eyoung100'ün hosts dosyasını veya m32'nin host dosyasını kullanmamıza bakılmaksızın aynı kalır. Bu sorunun cevaplanması için, günlük dosyaları oluşturabilmem ve ayrıca sunucuadı uyarısından kaçınabilmem gerektiğini düşünüyorum. Aksi takdirde, httpd'yi yapılandırmanın sonraki adımlarının kalıcı hatalara eğilimli olacağından korkuyorum.
apachectl configtest?
IncludeOptionalOrijinal httpd.confdosyanın sonunda bir var mı ? Varsayılan kurulumda olduğuna inanıyorum. Sorun , eklenen yapılandırma dosyasını iki kez okumaya IncludeOptionalzorlayan apacheve sonuç olarak başarısız olmasına neden olan sonuna ekstra eklemeniz olabilir .
mydomain.com.conf, /etc/httpd/conf.d(diğerlerinin olduğu yerde) ' ye taşınmanız ve silmeniz /etc/httpd/sites-enabled(bu bir Debian / Ubuntu şeyidir) ve IncludeOptionaleklediğiniz httpd.conf. Sen göz ardı edebilirsiniz AH00558durmaz olarak şimdilik mesajı apache. Daha confsonra suçluyu bulana kadar bir satırı dosyadan kaldırın (veya alternatif olarak boş bir satırla başlayın ve her seferinde bir satır geri yükleyin).
ServerNameyönerge eklediğinizde tam olarak hangi "belirsiz" hata üretilir ? Sorunuza ekleyin.