How to restart apache2 when I get a pid conflict and php not processed by the server - linux

There are processes named 'apache2' running which do not match y our pid file which are left untouched in the name of safety, Please review the s ituation by hand.
Following Test Were Done
no of pids -> sudo pidof apache2
3501 3500 3498 3497
Remove 3497 id and sudo service apache2 start - >
Error:
* Starting web server apache2 *
* The apache2 configtest failed.
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/authz_default.load: Cannot load /usr/lib/apache2/modules/mod_authz_default.so into server: /usr/lib/apache2/modules/mod_authz_default.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
Need your assist ....
even php not processed in the server

php 5.5 not compatible with precise64 version..so I tried with trusty64 all work fine..

Related

Is there another way to use WSGIScriptAliasMatch for a Django app running through Apache / mod WSGI?

I'm running a Python 3.9/Django 3 app through Apache, connected through WSGI (4.9). Is WSGIScriptAliasMatch not supported any more in Apache? I had previously configured this in a virtual hosts file, /etc/apache2/sites-enabled/000-default-le-ssl.conf,
WSGIScriptAliasMatch ^/api/(.*) /var/www/html/web/directory/wsgi.py/$1 process-group=ssl_directory
but now when I restart Apache or check its config, I get this error complaining about the above line
$ sudo apachectl configtest
AH00526: Syntax error on line 41 of /etc/apache2/sites-enabled/000-default-le-ssl.conf:
Invalid option to WSGI script alias definition.
Action 'configtest' failed.
The Apache error log may have more information.
Is there another way to write WSGIScriptAliasMatch?
This occurred because my WSGI module got reset from version 4.9 to version 3.6, where "WSGIScriptAliasMatch" was not supported.

Installing Apache on Windows Subsystem for Linux

Having just updated to the newest Windows 10 release (build 14316), I immediately started playing with WSL, the Windows Subsystem for Linux, which is supposed to run an Ubuntu installation on Windows.
Maybe I'm trying the impossible by trying to install Apache on it, but then someone please explain me why this won't be possible.
At any rate, during installation (sudo apt-get install apache2), I received the following error messages after the dependencies were downloaded and installed correctly:
initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: No such file or directory
runlevel:/var/run/utmp: No such file or directory
* Starting web server apache2 *
* The apache2 configtest failed.
Output of config test was:
mktemp: failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file or directory
chmod: missing operand after '755'
Try 'chmod --help' for more information.
invoke-rc.d: initscript apache2, action "start" failed.
Setting up ssl-cert (1.0.33) ...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
WARN: / is group writable!
Now, I understand that there seem to be some folders and files missing for Apache2 to work. Before I start changing anything that will mess with my Windows installation, I want to ask whether there's a different way? Also, should I worry about / being group writable or is this just standard Windows behaviour?
In order to eliminate this warning
Invalid argument: AH00076: Failed to enable APR_TCP_DEFER_ACCEP
Add this to the end of /etc/apache2/apache2.conf
AcceptFilter http none
Note the following in your output
failed to create directory via template '/var/lock/apache2.XXXXXXXXXX': No such file
I tried listing /var/lock. It points to /run/lock, which doesn't exist.
Create the directory with
mkdir -p /run/lock
The install should now work (you may need to clean the installation first)
You have to start bash.exe in administrator mode to avoid a lot of problems related to network.
i installed Lamp (Apache/MySQL/Php) without any problem :
Start bash.exe in administrator mode
type : sudo apt-get install lamp-server^
add these 2 lines in /etc/apache2/apache2.conf :
Servername localhost
AcceptFilter http none
then you can start apache :
/etc/init.d/apache2 start
Following the great advice here I edited apache2.conf and inserted the following to end of file after receiving all the various errors above and apache2 then worked great on the debian wsl package:
Servername localhost
AcceptFilter http none
AcceptFilter https none

Check GitLab API access: FAILED. code: 500 and all pages giving 500 error

I am getting 500 error code when viewing pages and doing:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Outputs
Check GitLab API access: FAILED. code: 500
gitlab-shell self-check failed
Try fixing it:
Make sure GitLab is running;
Check the gitlab-shell configuration file:
sudo -u git -H editor /home/git/gitlab-shell/config.yml
Please fix the error above and rerun the checks.
Checking the logs for production located at /home/git/gitlab/log/production.log
tail -n 100 /home/git/gitlab/log/production.log
I see the last few errors are related to:
Errno::EACCES (Permission denied - connect(2) for /var/run/redis/redis.sock):
config/initializers/rack_attack_git_basic_auth.rb:5:inblock in `'
So from the command line:
cd /var/run/redis/
ls -l
Output
-rw-r--r-- 1 redis redis 5 Mar 29 16:39 redis-server.pid
srwxrwxr-x 1 root root 0 Mar 29 16:39 redis.sock
Here I think the file itself redis.sock has the wrong permissions or owned by the wrong user (root), lets changed that to redis:
chown redis:redis redis.sock
ls -l
Output
-rw-r--r-- 1 redis redis 5 Mar 29 16:39 redis-server.pid
srwxrwxr-x 1 redis redis 0 Mar 29 16:39 redis.sock
Doing this now everything works, I can now push/pull to gitlab from terminal, and also view pages without getting a 500 error.
There maybe different causes for a 500 error (though most times its permission errors like these) so its important to check the logs.
For me a port change in /etc/redis.conf from 0 to the standard port 6379 in combination with renaming the rescue.yml ind rescue.yml_old to disable it and setting the servername in apache2 hardcoded sovled the issue.
I've to look more inside tomorrow, but I'm quite sure the main problem was the FQDM of the apache server.
If you get a info message like this, when you restart apache2 :
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using xxxxxxx. Set the 'ServerName' directive globally to suppress this message
You might put ServerName blablabla.com e.g. in /etc/apache2/ports.conf . Restart Apache2 or restart the whole server ( redis etc. ) and try again.

Apache2 "configtest failed" when trying to restart

i tried to protect a directory in my www-folder by using a .htaccess file which had no effect so i changed line
AllowOverride None
in my apache2.conf to
AllowOverride All
as root.
now i see that this wasn't the right way to do it. when trying to restart apache using
/etc/init.d/apache2 restart (or stop and start)
I'm getting the following error message:
[FAIL] Starting web server: apache2 failed!
[warn] The apache2 configtest failed. ... (warning).
Output of config test was:
apache2: Syntax error on line 140 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/php5.load: Cannot load /usr/lib/apache2/modules/libphp5.so into server: /usr/lib/apache2/modules/libphp5.so: cannot open shared object file: No such file or directory
Action 'configtest' failed.
The Apache error log may have more information.
I changed the line to AllowOverride None again but the problem remains. The apache2 error.log does not contain any information. And Line 140 in the config file is
IncludeOptional mods-enabled/*.load
as the error message indicates there is no libphp5.so in /usr/lib/apache2/modules just libphp5filter.so
apt-get install libapache2-mod-php5
just did the job. Now I'm not sure if the changes apache2.conf actually caused the problem...
I know:) that before you wanted add copy of /etc/apache2/sites-available/default. So u have to delete it (ex. site1): sudo a2dissite site1 && sudo a2ensite default

Can't find mod_authz_svn.so while restarting apache2

I tried to install and setup a svn server using apache2,
I followed instructions on internet but while i tried to restart apache2 it shows the following error:
apache2: Syntax error on line 204 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/mods-enabled/authz_svn.load: Cannot load /usr/lib/apache2/modules/mod_authz_svn.so into server: libsvn_repos-1.so.0: cannot open shared object file: No such file or directory
Action 'configtest' failed.
i checked the path but the file do exist,im not sure what is happening.
need some help thanks~
Based on your pathes, it looks like you are playing debian or ubuntu config. if I remember well, this module *mod_authz_svn.so* is available with libapache2-svn, so you need first to apt-get this module as root, and then to enable it (being in the directory /etc/apache2, *a2enmod my_module*) and reload your apache config (or restart apache).
The other way around is to load the module as a DSO. Then it's a different process.

Resources