Report this

What is the reason for this report?

HTTPS Returns 500 Internal Server Error While HTTP Does Not?

Posted on February 25, 2017

I’ve been trying to get SSL running on my domain (thebashfeed.com) for a few days. I believe I have Apache set up properly and installed Lets Encrypt using DO’s official tutorial. The site is accessible from http:// but not from https://. In fact, when you lead the domain with https:// it returns an internal server error with the following verbiage:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log. **

Here is my server’s Apache error log:**

[Fri Feb 24 19:25:11.151229 2017] [mpm_prefork:notice] [pid 30408] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 OpenSSL/1.0.1f configured – resuming normal operations [Fri Feb 24 19:25:11.151330 2017] [core:notice] [pid 30408] AH00094: Command line: ‘/usr/sbin/apache2’ libpng warning: Incorrect sBIT chunk length libpng warning: Incorrect sBIT chunk length [Fri Feb 24 20:49:50.636080 2017] [mpm_prefork:notice] [pid 30408] AH00169: caught SIGTERM, shutting down [Fri Feb 24 20:49:51.460157 2017] [mpm_prefork:notice] [pid 30887] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 OpenSSL/1.0.1f configured – resuming normal operations [Fri Feb 24 20:49:51.460250 2017] [core:notice] [pid 30887] AH00094: Command line: ‘/usr/sbin/apache2’ [Fri Feb 24 21:00:11.496576 2017] [mpm_prefork:notice] [pid 30887] AH00169: caught SIGTERM, shutting down [Fri Feb 24 21:15:00.327000 2017] [mpm_prefork:notice] [pid 31444] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.21 OpenSSL/1.0.1f configured – resuming normal operations [Fri Feb 24 21:15:00.327157 2017] [core:notice] [pid 31444] AH00094: Command line: ‘/usr/sbin/apache2’

If you can help me understand what needs to be done I would greatly appreciate it.

Thank in advance.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@bashfeedbusiness

Correct. Those files will be recreated once you start/restart MySQL and will then take on the size that is set in the newer configuration, which should prevent that error from popping back up.

If MySQL still fails to start, please tail -50 the log file and post back and we’ll take another look.

@bashfeedbusiness

If you wouldn’t mind, would you please repost that in a code block. To do that, it’d be three backticks, hit enter, paste the config, hit enter, and three more backticks.

Using a code block will keep it formatted. The copy and paste above slightly changes the config and it’s hard to tell what is and isn’t commented in the file as it appears much of that has been stripped.

Once I have that, I’ll see what we can do to tune the config.

You mention that you have higher levels of traffic. What are we looking at?

@bashfeedbusiness

Here’s what I would try and see how it works for you. This is based off an 8GB & 12GB Droplet I was working on with a client just a week ago.

If this doesn’t work, you may in fact need to upgrade RAM, or consider splitting the database from the web server (i.e. a Droplet dedicated to MySQL only).

Please make sure you backed up your configuration prior (as noted in my previous response) so you can revert back should something not work. This should work as-is, though different versions have different options.

[client]
port                                    = 3306
socket                                  = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket                                  = /var/run/mysqld/mysqld.sock
nice                                    = 0

[mysqld]
user                                    = mysql
pid-file                                = /var/run/mysqld/mysqld.pid
socket                                  = /var/run/mysqld/mysqld.sock
port                                    = 3306
basedir                                 = /usr
datadir                                 = /var/lib/mysql
tmpdir                                  = /tmp
lc-messages-dir                         = /usr/share/mysql

skip-external-locking

bind-address                            = 127.0.0.1

key_buffer_size                         = 256M
join_buffer_size                        = 128K
read_buffer_size                        = 256K
sort_buffer_size                        = 256K
table_definition_cache                  = 8192
table_open_cache                        = 4096
thread_cache_size                       = 256
tmp_table_size                          = 256M
max_heap_table_size                     = 256M
max_allowed_packet                      = 64M
thread_stack                            = 192K
thread_cache_size                       = 8
myisam_sort_buffer_size                 = 256M
myisam_max_sort_file_size               = 2048M

myisam-recover                          = BACKUP

group_concat_max_len                    = 1024
max_length_for_sort_data                = 1024
net_buffer_length                       = 16384
max_connect_errors                      = 100000
concurrent_insert                       = 2
read_rnd_buffer_size                    = 512K
bulk_insert_buffer_size                 = 8M

query_cache_limit                       = 512K
query_cache_size                        = 64M
query_cache_type                        = 1
query_cache_min_res_unit                = 2K
query_prealloc_size                     = 262144
query_alloc_block_size                  = 65536

transaction_alloc_block_size            = 8192
transaction_prealloc_size               = 4096

default-storage-engine                  = InnoDB

log_warnings                            = 1
slow_query_log                          = 0
long_query_time                         = 1
slow_query_log_file                     = /var/log/mysql/slowq.log
log_error                               = /var/log/mysql/error.log

innodb_large_prefix                     = 1
innodb_purge_threads                    = 1
innodb_doublewrite                      = 1

innodb_file_per_table                   = 1
innodb_open_files                       = 1000
innodb_data_file_path                   = ibdata1:10M:autoextend
innodb_buffer_pool_size                 = 128M
innodb_additional_mem_pool_size         = 32M

innodb_log_files_in_group               = 2
innodb_log_file_size                    = 64M
innodb_log_buffer_size                  = 8M
innodb_flush_log_at_trx_commit          = 2
innodb_thread_concurrency               = 0
innodb_lock_wait_timeout                = 50

innodb_io_capacity                      = 100
innodb_read_io_threads                  = 2
innodb_write_io_threads                 = 2

[mysqldump]
quick
quote-names
max_allowed_packet                      = 64M

[mysql]

[isamchk]
key_buffer                              = 256M 
sort_buffer                             = 256K
read_buffer                             = 256K
write_buffer                            = 256K

!includedir /etc/mysql/conf.d/

I’ve cleaned up the comments and removed the options that were commented out to reduce the size, though it’s still a little lengthy.

Should MySQL fail to start, we need to check the MySQL error log, run tail -20 on it and that should help us troubleshoot which configuration var doesn’t work with the version you’re running.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.