Witam. Mam fedorę 13, i domyslnie zainstalowany server www. Wrzuciłem pliki html do var/www./html i po wpisaniu adresu lub ip otwiera mi się bez problemu moja strona internetowa. Problemy zaczęły się gdy postanowiłem zabezpieczyć swoją stronę przez certyfikaty ssl. Chodzi mi żeby mi się strony otwierały przez wpisanie : https://www.kompy.acme.com....Podaję koncówkę konfigurację pliku httpd.conf:
#
# SetHandler server-status
# Order deny,allow
# Deny from all
# Allow from .example.com
#
#
# Allow remote server configuration reports, with the URL of
# http://servername/server-info (requires that mod_info.c be loaded).
# Change the ".example.com" to match your domain to enable.
#
#
# SetHandler server-info
# Order deny,allow
# Deny from all
# Allow from .example.com
#
#
# Proxy Server directives. Uncomment the following lines to
# enable the proxy server:
#
#
#ProxyRequests On
#
#
# Order deny,allow
# Deny from all
# Allow from .example.com
#
#
# Enable/disable the handling of HTTP/1.1 "Via:" headers.
# ("Full" adds the server version; "Block" removes all outgoing Via: headers)
# Set to one of: Off | On | Full | Block
#
#ProxyVia On
#
# To enable a cache of proxied content, uncomment the following lines.
# See http://httpd.apache.org/docs/2.2/mod/mod_cache.html for more details.
#
#
# CacheEnable disk /
# CacheRoot "/var/cache/mod_proxy"
#
#
#
# End of proxy directives.
### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
#
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
#NameVirtualHost *:80
#
# NOTE: NameVirtualHost cannot be used without a port specifier
# (e.g. :80) if mod_ssl is being used, due to the nature of the
# SSL protocol.
#
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
ServerAdmin kompy.acme@com
DocumentRoot /var/www/html
ServerName kompy.acme.com.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
DocumentRoot /var/www/html
ServerName kompy.acme.com
ServerAdmin kompy.acme@com
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile /etc/ssl/servercert.pem
SSLCertificateKeyFile /etc/ssl/private/serverkey.pem
SSLCACertificateFile /etc/ssl/cacert.pem
Przy restarcie /etc/httpd/conf/httpd.conf otrzymuję komunikatt:
[root@server /]# /etc/init.d/httpd restart
Stopping httpd: [FAILED]
Starting httpd: [FAILED]
[root@server /]#
Podaję także wynik apachectl:
[root@server /]# apachectl configtest
Syntax OK
[root@server /]#
Gdzie robię błąd w konfigu ?? Nie instalowałem apache z netu, bo mam już domyślnie zainstalowany serwer www... Przejrzałem mnóstwo artykułów na google związane z konfiguracją httpd.conf pod ssl, ale dalej mam błąd przy uruchomieniu serwera www....Certyfikaty mam dobrze utworzone....POzdrawiam serdecznie
Nie chodzi mi o tzw gotowce, ale o naprowadzenie mnie gdzie popełniłem błąd...
Domyślam się, że w Fedorze już masz zainstalowany właśnie Apache2 :)
Pozdrawiam!
Niestety nie mam na fedorze zainstalowanego apache2,
[root@server /]# cd /etc/apache2/sites-available/default-ssl
bash: cd: /etc/apache2/sites-available/default-ssl: No such file or directory
[root@server /]# cd /etc/apache2
bash: cd: /etc/apache2: No such file or directory
[root@server /]#
na to wychodzi ze będę musiał zainstalować apache2 ze strony apache? I jeszcze jedno pytanko, virtualne hosty ustawiam w pliku httpd.conf jak się domyślam caly czas, i ścieżki do certyfikatów też ustawiam w tym pliku httpd.conf....??/ Sądzę ze plik teraz aktualny httpd.conf mam w miarę dobrze skonfigurowany ale mimo to nie restartuje httpd....Inaczej to napiszę, w wypadku sciągnięcia apache2 wszystko konfiguruję w jednym pliku httpd.conf??? tzn. virtualne hosty , ssl,certyfikaty itp...tak jak robiłem to do tej pory....
P.S Kurczę męczę sie z tym od paru dni...Przy openvpn jak wszystko konfigurowałem + certyfikaty wszystko mi ładnie poszło w parę godzin, certyfikaty do użytkowników wysłałem i wszystko działa aż milo....A tu mam problem...Jeszcze raz dziękuję ci za wszystkie rady...
Nie da się skonfigurować tego w pliku httpd.conf tak jak mam teraz?, bo domyślnie jak po zainstalowaniu fedory to tylko wrzuciłem pliki .html do /var/www/html i strona mi działa w sieci bez problemu, dopiero jak chcę zabezpieczyć stronę przez ssl to mam problemy.....
W Fedorze jest RPM o nazwie httpd.
1. Tu wrzucać klucze (pliki .key) - /etc/pki/tls/private/
2. Tu wqrzucać pliki certyfikatu (.crt) - /etc/pki/tls/certs
3. W /etc/httpd/conf.d/ssl.conf - fragmenty przykładowej konfiguracji (możliwe że pozmieniać tylko)
(...)
LoadModule ssl_module modules/mod_ssl.so
Listen 443
(...)
##
## SSL Virtual Host Context
##
NameVirtualHost pc-local.pl:443
# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/html/strona_ssl/"
ServerName pc-local.pl:443
# Use separate log files for the SSL virtual host; note that LogLevel
# is not inherited from httpd.conf.
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
(...)
4. W /etc/hosts dodałem "127.0.0.1 pc-local.pl", nie wiem co musi być u ciebie, pewnie adres IP serwera.
5. Restart httpd i network.
Przynajmniej tak wstawiałem sobie sam certyfikat wygenerowany przeze mnie we Fedorze 10. Nie wiem jak to jest w przypadku zweryfikowanych certyfikatów/
Ok. Dzięki za wszystkie uwagi, już chyba zainstaluję apache2 ze strony apache i go skonfiguruje podobnie jak konfigurowałem na początku (patrz pierwszy post mój-httpd.conf), bo mimo ze mam go teraz dobrze skonfigurowanego(/etc/httpd/conf/httpd.conf) to nie chce mi wystartować. Bo domyślnie bez konfiguracji ssl bez problemu mi startuje....Oj czuję że trochę czasu upłynie zanim mi to wszystko wypali...Pozdrawiam
P.S W etc/hosts mam ustawione adres ip serwera = domena
10.0.0.103 www.kompy.acme.com
10.0.0.103 kompy.acme.com