Apache2 H10292 Invalid proxy UDS filename error after automatic update (Ubuntu 20.04) - ubuntu-20.04

This morning Apache2 was automaticaly updated on my Ubuntu 20.04 server:
Start-Date: 2021-09-28 06:37:07
Commandline: /usr/bin/unattended-upgrade
Upgrade: apache2-data:arm64 (2.4.41-4ubuntu3.3, 2.4.41-4ubuntu3.5), apache2-bin:arm64 (2.4.41-4ubuntu3.3, 2.4.41-4ubuntu3.5), apache2:arm64 (2.4.41-4ubuntu3.3, 2.4.41-4ubuntu3.5), apache2-utils:arm64 (2.4.41- 4ubuntu3.3, 2.4.41-4ubuntu3.5)
End-Date: 2021-09-28 06:37:20
All my websites are down along with a 500 error since then.
Here's what I've found out in the apache error log:
[Tue Sep 28 08:40:34.983062 2021] [proxy:error] [pid 1806:tid 281473819050384] [client 192.168.1.17:51286] AH10292: Invalid proxy UDS filename (proxy:unix:///var/run/php/php7.4-fpm.sites.mydomain.com.sock|fcgi://sites//srv/www/sites/html/bookend/index.php)
Should I reconfigure the PHP settings ?
Should I upgrade/downgrade apache ?
What can I do ?

It happened a lot today apparently. There's a workaround for this that you can apply manually though:
Log through SSh.
Then download this wget https://plesk.zendesk.com/hc/article_attachments/4407408199954/PPPM-13232.tgz && tar -xvf PPPM-13232.tgz -C /usr/local/psa/admin/plib/Template/Variable/Domain/
Rebuild config: plesk sbin httpdmng --reconfigure-all
Hopefully that will do. More info here.

I found this information on the plesk page: https://support.plesk.com/hc/en-us/articles/4407366133906-Website-on-Plesk-server-suddenly-started-to-show-500-error-AH10292-Invalid-proxy-UDS-filename

As explained in this post I've installed the 2.4.49 apache version through a PPA:
sudo add-apt-repository ppa:ondrej/apache2
sudo apt install apache2
Everything is back to normal now.
It's also a good idea to prevent any future automatic apache updates to avoid version conflicts:
sudo apt-mark hold apache2

Related

Apache crashing with seg fault on a graceful restart on Ubuntu 14.04

One of the servers I manage runs Ubuntu 14.04.5 LTS with Apache 2.4.7 and PHP 7.0.11 , and uses PHP's Zend OPcache v7.0.11. It is noted that apache went down every time when we ran the service apache2 graceful (service apache2 reload) command. Apache error log showing the following.
[mpm_prefork:notice] [pid 9662] AH00171: Graceful restart requested, doing restart
*** Error in `/usr/sbin/apache2': corrupted double-linked list: 0x00007f9e1ae8a170 ***
[core:notice] [pid 9662] AH00060: seg fault or similar nasty error detected in the parent process
Apache configuration
#apachectl -V
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:34:04
Server's Module Magic Number: 20120211:27
Server loaded: APR 1.5.1-dev, APR-UTIL 1.5.3
Compiled using: APR 1.5.1-dev, APR-UTIL 1.5.3
Architecture: 64-bit
Server MPM: prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=256
-D HTTPD_ROOT="/etc/apache2"
-D SUEXEC_BIN="/usr/lib/apache2/suexec"
-D DEFAULT_PIDLOG="/var/run/apache2.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="mime.types"
-D SERVER_CONFIG_FILE="apache2.conf"
After some amount of searching on the Internet, the only thing I could come up with that there were some Apache modules might be causing this issue. One of the posts indicated that this particular message is also a symptom for lots of other memory-type bugs in Apache. After disabling the php7.0 module the issue resolved
However anyone can help me to fix this issue without disabling the apache php module ?
Thanks in advance

Unable to start XAMPP Apache server on MacOS-Sierra

Whenever I'm trying to start my Apache server from XAMPP on my Macbook (MacOS-Sierra) . I'm getting following application log :
Starting Apache Web Server...
/Applications/XAMPP/xamppfiles/apache2/scripts/ctl.sh : httpd started
And status remains Stopped. I re-install XAMPP and restarted my laptop multiple times, but I'm still having same issue. Couldn't find anything help to resolve this issue.
I found the solution:
Make sure port 80 is not being used (Use Network Utility and scan for port 80. If you found any application using port 80, then kill it)
Open terminal and execute
sudo apachectl stop
(ignore, if you get any error)
On the same terminal window execute
sudo /Applications/XAMPP/xamppfiles/bin/apachectl start
Open XAMPP control panel, your apache server might have started by now, if not then you can start manually by clicking start button.
This worked for me!!
Simply goto your terminal and type:
sudo apachectl stop
It'll ask for password. Enter your system password.
Go back to XAMPP control panel and start Apache.
It should get started now.
I had the same Problem and fixed it by deleting the lib folder in Applications/XAMPP/xamppfiles/ and installing XAMPP again. It's probably due to old lib files from previous versions not being updated properly.
Another related issue, which I faced caused Apache sever failure. And failure logs is :
[Sun Jul 30 12:43:58.747822 2017] [unique_id:alert] [pid 9188] (EAI 8)nodename nor servname provided, or not known: AH01564:
unable to find IPv4 address of "MacBook-Pro.local" AH00016: Configuration Failed
To solve this :
Executed following command
sudo -e /etc/hosts
Then, changed following entries
127.0.0.1 localhost
::1 localhost
to
127.0.0.1 localhost MacBook-Pro.local
::1 localhost MacBook-Pro.local
I had the same issue when I update my XAMPP app, if you have to do this, you first have to uninstall your XAMPP (save your HTDOCS files in another folder, NOT in XAMPP folder, or you will lose it), and after that you can install the newest version of XAMPP. It worked for me, hope for you too.

Elasticsearch fails to start or run on OSX

I am posting to hopefully help others if they run into this issue on Mac. I recently updated ES to 2.2.x branch using Homebrew:
brew uninstall --force elasticsearch
brew update
brew install elasticsearch
I repeatedly got connection errors trying both localhost and 127.0.0.1 on port 9200.
curl http://localhost:9200
curl: (7) Failed to connect to localhost port 9200: Connection refused
I tried an unload and load.
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
Then tried starting manually.
elasticsearch
The following errors appeared indicating that the Java version 1.7.x was an error and why it would not start.
Exception in thread "main" java.lang.RuntimeException: Java version: Oracle Corporation 1.7.0_45 [Java HotSpot(TM) 64-Bit Server VM 24.45-b08] suffers from critical bug https://bugs.openjdk.java.net/browse/JDK-8024830 which can cause data corruption.
Please upgrade the JVM, see http://www.elastic.co/guide/en/elasticsearch/reference/current/_installation.html for current recommendations.
If you absolutely cannot upgrade, please add -XX:-UseSuperWord to the JAVA_OPTS environment variable.
Upgrading is preferred, this workaround will result in degraded performance.
at org.elasticsearch.bootstrap.JVMCheck.check(JVMCheck.java:123)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:283)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
After getting past this error, there were errors as well for previously-installed plugins on the 1.7.x branch.
Exception in thread "main" java.lang.IllegalStateException: Could not load plugin descriptor for existing plugin [bigdesk]. Was the plugin built before 2.0?
Likely root cause: java.nio.file.NoSuchFileException: /usr/local/var/lib/elasticsearch/plugins/bigdesk/plugin-descriptor.properties
at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214)
at java.nio.file.Files.newByteChannel(Files.java:315)
at java.nio.file.Files.newByteChannel(Files.java:361)
at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:380)
at java.nio.file.Files.newInputStream(Files.java:106)
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:87)
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:378)
at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:128)
at org.elasticsearch.node.Node.<init>(Node.java:146)
at org.elasticsearch.node.Node.<init>(Node.java:128)
at org.elasticsearch.node.NodeBuilder.build(NodeBuilder.java:145)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:178)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:285)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:35)
Refer to the log for complete error details.
The solutions to these issues I discovered were the following:
Edit the /usr/local/etc/elasticsearch/elasticsearch.yml file and verify the bind_host configs are commented so it will default to 0.0.0.0.
Edit the /usr/local/Cellar/elasticsearch/YOUR_VERSION/libexec/bin/elasticsearch.in.sh file and add the -XX:-UserSuperWord flag after the other JAVA_OPTS:
JAVA_OPTS="$JAVA_OPTS -XX:-UseSuperWord"
Manually remove the previous plugins so you can install the latest versions for that ES branch:
/usr/local/Cellar/elasticsearch/2.2.0_1/libexec/bin/plugin list
Installed plugins in /usr/local/var/lib/elasticsearch/plugins:
- bigdesk
- head
/usr/local/Cellar/elasticsearch/2.2.0_1/libexec/bin/plugin remove bigdesk
/usr/local/Cellar/elasticsearch/2.2.0_1/libexec/bin/plugin remove head
After these steps I could once again start ES 2.x and then I can re-install any desired plugins. I hope this helps others if they run into similar issues.
I had this issue on MacOs, when I tried to uninstall elasticsearch7 and install elastisearch#6 using homebrew.
I resolved it by manually deleting the following directories and installed elasticsearch#6
Data: /usr/local/var/lib/elasticsearch/
Logs: /usr/local/var/log/elasticsearch/elasticsearch_<<user>>.log
Plugins: /usr/local/var/elasticsearch/plugins/
Config: /usr/local/etc/elasticsearch/
steps:
>brew uninstall elasticsearch
>rm -rf <<above mentioned directories>>
>brew install elasticsearch#6

Unable to start tomcat7 in ubuntu

I installed tomcat7 but when I tried to start it. It fails to start.
previously I'd installed tomcat7 and it was working fine, But when I tried to add tomcat7 server in netbeans it gave me error of some Catalina home or something. I looked for that solution and applied. Then after adding the tomcat7 server to the netbeans, it won't start. Later I install glassfish server. It also got failed. So again I uninstalled the tomcat7 and tried again to start it. But now it is not getting started.
Creating config file /etc/logrotate.d/tomcat7 with new version
* Starting Tomcat servlet engine tomcat7 [fail]
invoke-rc.d: initscript tomcat7, action "start" failed.
Setting up tomcat7-admin (7.0.52-1ubuntu0.3) ...
Setting up tomcat7-docs (7.0.52-1ubuntu0.3) ...
Setting up tomcat7-examples (7.0.52-1ubuntu0.3) ...
Processing triggers for ureadahead (0.100.0-16) ...
Try this!
Step 1:
When Install tomcat 7 on Ubuntu 14.04
$ sudo apt-get install tomcat7
Step 2
If You find an error post installation which could look something similar to the code below:
Creating config file /etc/logrotate.d/tomcat7 with new version
* no JDK or JRE found - please set JAVA_HOME
invoke-rc.d: initscript tomcat7, action "start" failed.
Setting up authbind (2.1.1) ...
Processing triggers for ureadahead (0.100.0-16) ...
To rectify the above please do the following:
$ sudo mkdir -p /home/data/backup_scripts
$ cp /etc/init.d/tomcat7 /home/data/backup_scripts/
$ sudo vim /etc/init.d/tomcat7
After you open the file i.e tomcat7, please find the following line
JDK_DIRS="/usr/lib/jvm/default-java ${OPENJDKS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle"
Change the above line by appending the following to it:
/usr/lib/jvm/java-8-oracle
Thus the line would now become:
JDK_DIRS="/usr/lib/jvm/default-java ${OPENJDKS} /usr/lib/jvm/java-6-openjdk /usr/lib/jvm/java-6-sun /usr/lib/jvm/java-7-oracle /usr/lib/jvm/java-8-oracle"
Save the file and start the tomcat server. This time it should happen at ease:
$ sudo service tomcat7 start
Hope it works!!!

Configure gitlab with apache2 (or nginx + apache2)

I have installed GitLab in a Ubuntu14.04 server with LAMP. I am aware that GitLab has been designed to work with nginx based servers, but this server has web apps that have been installed over apache2 and I need them.
I tried installing GitLab following this tutorial. I used the gitlab_7.7.1-omnibus.5.4.1.ci-1_amd64.deb package.
I ended up having the same problem than some of the people who commented (error 502). I tried following this link through the comments to see if I could find any relevant information, but it doesn't seem to be relevant for my case.
I keep searching for alternative ways to configure nginx through apache2, but I'm not finding anything.
Here's a log entry that I found in /var/log/gitlab/nginx/gitlab_error.log:
2015/01/30 19:32:27 [error] 995#0: *3 connect() to unix:/var/opt/gitlab
/gitlab-rails/sockets/gitlab.socket failed (111: Connection refused)
while connecting to upstream, client: 127.0.0.1, server: mygitlab.com,
request: "GET / HTTP/1.1", upstream: "http://unix:/var/opt/gitlab/gitlab-
rails/sockets/gitlab.socket:/", host: "localhost:8080"
It seems that it is a problem with upstream socket's configuration.
gitlab-ctl status outputs:
run: logrotate: (pid 4465) 1488s; run: log: (pid 826) 5087s
run: nginx: (pid 837) 5087s; run: log: (pid 825) 5087s
run: postgresql: (pid 827) 5087s; run: log: (pid 817) 5087s
run: redis: (pid 828) 5087s; run: log: (pid 818) 5087s
run: sidekiq: (pid 839) 5087s; run: log: (pid 824) 5087s
run: unicorn: (pid 5861) 0s; run: log: (pid 823) 5087s
Anyways, it seems that Omnibus doesn't install nginx at all (or I guess so, there's no service named 'nginx' in /etc/init.d/. I do not discard the possibility that the log generator confused apache2 with nginx).
Questions:
Is it mandatory to install nginx to run gitlab? If so, can it co-exist with apache properly?
Is proxying GitLab through apache a good approach to what I'm looking for?
I don't know much about Unicorn. I found this question in SO. Does this mean that Unicorn handles upstream sockets in GitLab?
EDIT: Checking this document I decided to check if Omnibus installed Ruby with ruby -v and I noticed that Ruby wasn't installed at all. So I decided to compile and install it, following the document's instructions:
mkdir /tmp/ruby && cd /tmp/ruby
curl -L --progress http://cache.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz | tar xz
cd ruby-2.1.5
./configure --disable-install-rdoc
make
sudo make install
Anyways, it seems some dependencies failed and ruby is not plently operative. When I try sudo gem install bundler --no-ri --no-rdoc, the following errors ocurr:
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass
During the make operation, these errors happened:
Failed to configure -test-/win32/dln. It will not be installed.
Failed to configure -test-/win32/dln/empty. It will not be installed.
Failed to configure -test-/win32/fd_setsize. It will not be installed.
Failed to configure dbm. It will not be installed.
Failed to configure fiddle. It will not be installed.
Failed to configure gdbm. It will not be installed.
Failed to configure openssl. It will not be installed.
Failed to configure readline. It will not be installed.
Failed to configure tk. It will not be installed.
Failed to configure tk/tkutil. It will not be installed.
Failed to configure win32. It will not be installed.
Failed to configure win32ole. It will not be installed.
Failed to configure zlib. It will not be installed.
EDIT2: It seems that compiling and installing Ruby was completely inneccessary. Looking around for config files, I saw that Omnibus installed lots of dependencies (Ruby among them) in /opt/gitlab/embedded/ directory. :-S
Is it mandatory to install nginx to run gitlab? If so, can it co-exist
with apache properly?
Gitlab is bundled with nginx but you can use it with Apache HTTP server.
Is proxying GitLab through apache a good approach to what I'm looking
for?
You can disable nginx in Gitlab config and configure Apache to forward to Gitlab.
I don't know much about Unicorn. I found this question in SO. Does
this mean that Unicorn handles upstream sockets in GitLab?
Unicorn is HTTP server for Ruby. You can forward requests to Gitlab Unicorn server or gitlab-workhorse.
Below is the basic /etc/gitlab/gitlab.rb configuration used with Apache, other lines are commented:
external_url 'https://my.example.com/gitlab'
gitlab_workhorse['enable'] = true
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:9191"
unicorn['listen'] = '127.0.0.1'
unicorn['port'] = 9099
web_server['external_users'] = ['www-data']
web_server['username'] = 'apache' #'gitlab-www'
web_server['group'] = 'apache' #'gitlab-www'
nginx['enable'] = false
And make proxyPass in /etc/apache2/apache2.conf to the gitlab-workhorse running on 9191:
ProxyPass /gitlab http://127.0.0.1:9191/gitlab
RequestHeader add X-Forwarded-Proto "https"
RequestHeader set X-Forwarded-Ssl on

Resources