According to this guide, httpd-2.4.6-40.el7.centos.4.x86_64.rpm is good enough to proceed, but "service httpd configtest" command fails with an error: "Unrecognized header format %". I was able to solve it by installing the latest version of httpd (Apache/2.4.33).
Env details:
Moved from #6828 ...
> ExecStart=/usr/local/bin/dotnet /var/aspnetcore/hellomvc/hellomvc.dll
there is no file dotnet in /usr/local/bin
I guess it should be one of the following:
Env details:
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
Thanks @davidich for the report.
@shirhatti How do you want to proceed?
To be specific the error occurs below 2.4.10, so until centos repos advance beyond, I solved by installing from the non centos repo (instructions from here). Also, I kept getting "Config variable ${APACHE_LOG_DIR} is not defined" until I hard coded the variable reference in hellomvc.conf for ${APACHE_LOG_DIR} to "/etc/httpd/logs/" so perhaps that could be addressed in this update if anyone else reports it. There are many solutions for Ubuntu but I couldn't find a solution on centos.
I also had to set the ServerName in /etc/httpd/conf/httpd.conf which was not in the tutorial to resolve a warning similar to the following:
"Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message"
I also had to change the 00-mpm.conf module from
LoadModule mpm_worker_module modules/mod_mpm_worker.so
to
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
I forget what error required this change for the server to start.
There also remained a non critical permission issue writing to the custom log file /etc/httpd/${APACHE_LOG_DIR}hellomvc-error.log. that I don't care about because it didn't prevent the server from running.
One final edit I had to make was due to CentOS restricting access to everything: After setting up TLS, I got a 503 Service Unavailable error from the site and the solution is hidden in the top right corner of SELinux notifications:
SELinux is preventing /usr/sbin/httpd from name_connect access on the tcp_socket port 5000.
Plugin catchall_boolean (89.3 confidence) suggests *****
If you want to allow httpd to can network connect
Then you must tell SELinux about this by enabling the 'httpd_can_network_connect' boolean.Do
setsebool -P httpd_can_network_connect 1
I had to run this bold line for the site to work.
@shirhatti please comment
To be specific the error occurs below 2.4.10, so until centos repos advance beyond, I solved by installing from the non centos repo (instructions from here). Also, I kept getting "Config variable ${APACHE_LOG_DIR} is not defined" until I hard coded the variable reference in hellomvc.conf for ${APACHE_LOG_DIR} to "/etc/httpd/logs/" so perhaps that could be addressed in this update if anyone else reports it. There are many solutions for Ubuntu but I couldn't find a solution on centos.
While I understand, that solved your issue. I'm not keen on recommending a package maintained by some third-party (CodeIT in this case) in our official docs. I wouldn't mind if it were the vendor itself (i.e., Apache foundation).
The options I see are either:
"Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message"
I'm okay adding a note about it, but I don't really mind since it's a non-critical warning
One final edit I had to make was due to CentOS restricting access to everything: After setting up TLS, I got a 503 Service Unavailable error from the site and the solution is hidden in the top right corner of SELinux notifications:
Sorry folks. I know nothing about SELinux. Perhaps we just add a note saying you may need additional AppArmor or SELinux configuration for this to run?
@blowdart How do you want to address Linux security guidance for running our stuff?
Carefully checked and validated community contributions by someone that knows Linux security? SELinux is going into unsupported territory probably.
@shirhatti I agree with blowdart's point. This documentation is about ASP.NET Core, not linux. Best to stick to the topic. However, I don't see why not fix the bugs. The server wouldn't start until I hard coded the log directory for 2 references to ${APACHE_LOG_DIR} in hellomvc.conf and added the domain for a ServerName in /etc/httpd/conf/httpd.conf. There was a third separate error that didn't prevent the server from starting regarding write permissions to /etc/httpd/${APACHE_LOG_DIR}/hellomvc-error.log which I was able ignore.
The options I see are either:
See if there is a vendor supported way of installing Apache >= 2.4.10
Let the reader figure it out for themselves
Or edit the line to use different syntax, or just wait. The version installed from the official repo was 2.4.06.
Running the configtest gives me below warnings
_sudo service httpd configtest_
[core:warn] [pid 5654:tid 140675401267392] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
[core:warn] [pid 5654:tid 140675401267392] AH00111: Config variable ${APACHE_LOG_DIR} is not defined
Syntax OK
This happened even after upgrading my httpd to 2.4.33 as suggested by @user135711
httpd fails to restart.
However, https restarts successfully after I hardcode it. Please suggest where to set these variables.
@ParidaPunyasloka Yes, that's what this trouble ticket is about. The "Unrecognized header format %" syntax which requires the upgrade. The ${APACHE_LOG_DIR} is a different issue I added to the ticket and fixed by hard coding.
This doesn't seem very actionable from a docs perspective. See: #9853 ... I'll close since there isn't much we can do here.
Most helpful comment
To be specific the error occurs below 2.4.10, so until centos repos advance beyond, I solved by installing from the non centos repo (instructions from here). Also, I kept getting "Config variable ${APACHE_LOG_DIR} is not defined" until I hard coded the variable reference in hellomvc.conf for ${APACHE_LOG_DIR} to "/etc/httpd/logs/" so perhaps that could be addressed in this update if anyone else reports it. There are many solutions for Ubuntu but I couldn't find a solution on centos.
I also had to set the
ServerNamein/etc/httpd/conf/httpd.confwhich was not in the tutorial to resolve a warning similar to the following:"Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message"
I also had to change the 00-mpm.conf module from
LoadModule mpm_worker_module modules/mod_mpm_worker.so
to
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
I forget what error required this change for the server to start.
There also remained a non critical permission issue writing to the custom log file
/etc/httpd/${APACHE_LOG_DIR}hellomvc-error.log.that I don't care about because it didn't prevent the server from running.One final edit I had to make was due to CentOS restricting access to everything: After setting up TLS, I got a 503 Service Unavailable error from the site and the solution is hidden in the top right corner of SELinux notifications: