Search code examples
apachehttpsserverportblock

XAMPP HTTPS config show errors when start Apache


I faced some strange problem.

Now I want to run https vhost apache server on my computer, so I set httpd.conf, httpd-ssl.conf, httpd-vhosts.conf.

But when run apache, it can't start and show below errors.

2:08:20 AM  [Apache]    Status change detected: running
2:08:21 AM  [Apache]    Status change detected: stopped
2:08:21 AM  [Apache]    Error: Apache shutdown unexpectedly.
2:08:21 AM  [Apache]    This may be due to a blocked port, missing dependencies, 
2:08:21 AM  [Apache]    improper privileges, a crash, or a shutdown by another method.
2:08:21 AM  [Apache]    Press the Logs button to view error logs and check
2:08:21 AM  [Apache]    the Windows Event Viewer for more clues
2:08:21 AM  [Apache]    If you need more help, copy and post this
2:08:21 AM  [Apache]    entire log window on the forums

so I changed port as 4433, but there are same errors.

These are my configurations.

<VirtualHost my.com:4433>
    ServerAdmin admin@example.com
    DocumentRoot "D:/Work/Project/Source/public"
    ServerName my.com:4433
    ServerAlias my.com:4433
    ErrorLog "C:/xampp/apache/logs/my/error.log
    CustomLog "C:/xampp/apache/logs/my/access.log"
    SSLEngine on

    SSLCertificateFile "D:/Work/Project/Data/Certificate/server.cert"

    SSLCertificateKeyFile "D:/Work/Project/Data/Certificate/server.key"
</VirtualHost>

I also unblocked ports 443 and 4433.

Please help me to fix this problem.


Solution

  • I found the reason. ErrorLog and CustomLog is non existing path.

    ErrorLog "C:/xampp/apache/logs/my/error.log
    CustomLog "C:/xampp/apache/logs/my/access.log"
    

    After fixed that as below, it's working well.

    ErrorLog "C:/xampp/apache/logs/error.log"
    TransferLog "C:/xampp/apache/logs/access.log"
    

    Thanks!