I'm still having some problems on using httpd (aka Apache2) after the update of my MacOs on BigSur.
I tried to make a clean reinstall of apache2 using the brew httpd services (like said in a lot of tutorials) but it still not working. I make a summary of the steps taked and I'll add some debug command.
To reinstall I done:
sudo apachectl stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist 2>/dev/null
brew install httpd
After that I reboot and launched the command:
brew services start httpd
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
But if I run the following command:
brew services list
Name Status User Plist
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
fuseki stopped
httpd error matteo.ceradini /Users/matteo.ceradini/Library/LaunchAgents/homebrew.mxcl.httpd.plist
mongodb-community started matteo.ceradini /Users/matteo.ceradini/Library/LaunchAgents/homebrew.mxcl.mongodb-community.plist
unbound stopped
As you can see the httpd is in an error status (in fact going to localhost:8080 I get an error) and I can't understand why.
Any suggestion how to fix this?
Thank you.
Something seems to not working, but still I can't find why.
I stopped all the services (either sudo brew and brew without sudo), and next running the commands:
sudo lsof -i :80
sudo lsof -i :8080
sudo lsof -i tcp:80
sudo lsof -i tcp:8080
the results is always nothing. But if I run:
sudo brew services start httpd
==> Successfully started `httpd` (label: homebrew.mxcl.httpd)
The httpd will not start (even if in the terminal command it says yes):
sudo brew services list
httpd error root /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
And if I check the apachetl error I get always that the port 80 is occupied, even if there isn't processes on that port:
apachectl -e error
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
I urgently need to find a solution for this bug. It seems that in some httpd is corrupted, even if I uninstall and reinstall again
UPDATE:
I really don't know how I did it, but now it's working. I stopped all the brew httpd services and I restard apache using the command:
sudo apachectl -k start
and that worked for me
I just had exactly the same issue on Monterey. As digging in, it seems that the problem was a symbol not found ( _apr_bucket_alloc_aligned_floor ), expected in: /usr/lib/libaprutil-1.0.dylib.
Reinstalling apr-util fixed my case:
brew reinstall apr-util
FIRST ANSWER:
Sounds like the service started OK then later (or immediately) died, and reports an error. Using the command 'apachectl -e error' should provide details, but you'd wanna check the logs ('vi /usr/local/var/log/httpd/error_log', then shift-G [to goto end]).
SECOND (EXPLAINATION) ANSWER:
"
If you use (sudo) brew services ... to start httpd you have to use the proper (sudo) brew services list command to check the status:
If you start it as root then list it with root privs:
sudo brew services start httpd > sudo brew services list
or with user privs:
brew services start httpd > brew services list.
"
Judging by the result from sudo apachectl -e error, it cannot use port 8080 because another app is using it.
The first warning - can be ignored - or set the FQDN in httpd.conf. Usually this is in the '/usr/local/etc/httpd' folder. Edit with sudo vi /usr/local/etc/httpd/httpd.conf. (I like vi - use whatever you feel comfortable with - sudo open -e /usr/local/etc/httpd/httpd.conf is common).
The default config has the line #ServerName www.example.com:8080, remove that '#' and replace 'www.example.com:8080' with 'MBP-Matteo.local' - or whatever.
Type sudo lsof -i tcp:8080 to list all apps using port 8080, mostly only apps that LISTEN are important.
Next error: You must stop that other app which is using port 8080 (and prevent starting on boot) - or - set Apache to use a different port. (Note: If you choose a port lower than 1024, 'sudo' must be used to start the service.) Usually port 80 is devoted to Apache. The port to be used can be set by editing the config file, as above, then find the line 'Listen 8080', and replace 8080 with the desired port.
After the changes, try to start again with [sudo] 'brew services start httpd'. Then check with [sudo] 'brew services list'. Hopefully all works fine.
FIRST ANSWER: Sounds like the service started OK then later (or immediately) died, and reports an error. Using the command 'apachectl -e error' should provide details, but you'd wanna check the logs ('vi /usr/local/var/log/httpd/error_log', then shift-G [to goto end]).
The first command gives this result:
sudo apachectl -e error
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using MBP-Matteo.local. Set the 'ServerName' directive globally to suppress this message
(48)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
AH00015: Unable to open logs
And the file '/usr/local/var/log/httpd/error_log' is empty
SECOND (EXPLAINATION) ANSWER: " If you use (sudo) brew services ... to start httpd you have to use the proper (sudo) brew services list command to check the status:
The results doesn't change if I executed brew commands with both sudo or without (given that previously I was using without sudo)
Any suggestions?
my solution, stop httpd service, then check httpd.conf and check DocumentRoot "/opt/homebrew/var/www"
<Directory "/opt/homebrew/var/www"> when returning to the original state this route, restart the httpd service and it worked without problems.
A simple brew reinstall httpd fixed it for me. All .conf files remained intact after reinstall for anyone wondering.
I am trying to use laravel queue:work on live server and keep alive the work using Supervisor. After configuration it shows as follows:
[root#vmi485931 supervisord.d]# sudo supervisorctl reload
Restarted supervisord
[root#vmi485931 supervisord.d]# sudo service supervisor restart
Redirecting to /bin/systemctl restart supervisor.service
Failed to restart supervisor.service: Unit not found.
Any clue?
there are some package missing in Centos 7. i had some issue on centos 7 and i fixed issue with this commands :
1- need python-meld3 package
sudo rpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/python-meld3-0.6.10-1.el7.x86_64.rpm
2-needs supervisor lib.
sudo rpm -ivh https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/s/supervisor-3.4.0-1.el7.noarch.rpm
If you are trying to restart the processes that are run by supervisor, run
sudo supervisorctl restart all
You can use supervisor process name instead of 'all' to restart a specific process.
If you are trying to restart supervisor itself,sudo systemctl restart supervisor should work.
I working on CentOS7 and I install ceph by manual build
./autogen.sh
./configure
make
make install
and manual deploy by follow this link http://ceph.com/docs/master/install/manual-deployment/
but ceph doesn't exist in directory /etc/rc.d/init.d/
Failed to issue method call: Unit ceph.service failed to load: No such
file or directory
So, I can't start service.
In document of manual deploy it's said I have to use command
sudo /etc/rc.d/init.d/ceph start mon.node1
In CentOS7 use systemd
So, use command sudo systemctl start ceph-osd#0 will work!!!
You can run systemctl status ceph* as a quick way to show any services on the box or systemctl list-units --type=service | grep ceph the service name syntax is ceph-mon#<hostname>.service or ceph-osd#<osd_num>.service
Please run systemctl list-unit-files and you can list all ceph services and you must find OSD number with ceph osd tree and put in this command systemctl status ceph-osd#{OSD_NUM}.target
Note: We love RethinkDB but our current project does not use it so we need to free up resources on our local machine ...
We installed RethinkDB using homebrew:
brew update && brew install rethinkdb
And added the rethinkdb process to our plist as per the instructions in:
http://rethinkdb.com/docs/start-on-startup/
But now we need to shut it down to free-up the 8080 port for another service.
What command do we need to run? (thanks!)
Do this in the terminal
check to see if you started it using brew
$ brew services list
stop rethinkdb:
$ brew services stop rethinkdb
restart:
$ brew services start rethinkdb
Like this, I think, if you used launchctl:
sudo launchctl unload -w /Library/LaunchDaemons/com.rethinkdb.server.plist
I have tried to install clamav in linux centos, but not able to succeed, so anybody provide me the procedure to install clamav antivirus and test the same.
Thanks in advance
First thing to do is install the program sudo apt-get install clamav
It´s necessary install the deamon program as well sudo apt-get install clamav-daemon
Once that we have the program properly installed, will be necessary configure to make it works with our app. /etc/clamav/clamd.conf
TCPAddr 127.0.0.1
TCPSocket 3310
To configure by console the antivirus just type sudo dpkg-reconfigure clamav-freshclam
Restart the service sudo /etc/init.d/clamv-* restart
For CentOS 6
Install ClamAV via yum epel repo:
yum install clamd
Edit config file:
vim /etc/clamd.conf
ExtendedDetectionInfo yes
ExcludePath /usr/local/maldetect/
DetectPUA yes
Set to start on boot:
chkconfig clamd on
Update ClamAV prior to a scan:
freshclam
Start ClamAV:
service clamd start
Add the cron for daily automatic scans:
vim /etc/cron.daily/daily-clamscan
#!/bin/bash
SCAN_DIR="/"
LOG_FILE="/var/log/clamav/daily-clamscan.log"
/usr/bin/clamscan -i -r $SCAN_DIR >> $LOG_FILE
Set proper cron permissions:
sudo chmod +x /etc/cron.daily/daily-clamscan
Update the logrotate file to look for all logs via wildcard
vim /etc/logrotate.d/daily-clamscan
/var/log/clamav/daily-clamscan.log {
missingok
notifempty
create 644 clam clam
}
Thats how I installed it on my machine. Here are a few good quick commands or you can use the cron to manually run it. I also installed Linux Malware Detect (LMD) with it so I can do more for my scans.
Full System Scan that only displays infected files and runs in the background with bell
Use jobs command to view status
clamscan -r --bell -i / &