apache24_enable="YES"
apache24_flags=" -f /path/to/httpd.conf "
You can specify another path to the config file
Try to edit your /etc/rc.conf
Code:apache24_enable="YES" apache24_flags=" -f /path/to/httpd.conf "
If you want to have more information then read:
1) /usr/local/etc/rc.d/apache24 - this is a startup script of Apache
2) Apache's httpd manual page httpd()
I created /home directory. And then /home/www /home/etc /home/libexec. I can change html code.But httpd.conf does not works in /home/etc/apache24 (works in /usr/local/etc/apache24/).Configuration stayed,remained in "/usr/local/etc/apache24/"
The server is the file "/usr/local/sbin/httpd"
The configuration details from which location you serve your files.
apache24_enable="yes"
apache24_flags=" -f /home/etc/httpd.conf"
required_files=/home/etc/httpd.conf
root@testjail:/home/backup # /usr/local/etc/rc.d/apache24 restart
Starting apache24.
AH00557: httpd: apr_sockaddr_info_get() failed for testjail.local
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
root@testjail:/home/backup # ps -auxww | grep httpd
root 21018 0.0 0.1 17284 6004 - SsJ 13:27 0:00.03 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT
www 21019 0.0 0.1 17284 5892 - SJ 13:27 0:00.01 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT
www 21020 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT
www 21021 0.0 0.1 17284 5892 - SJ 13:27 0:00.01 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT
www 21022 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT
www 21023 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT
httpd -t
and httpd -S
then add to the end of this command the line:what should i do to use "freebsd jail"?I tried to build a clean environment with apache24,
and tried to run apache with httpd.conf in non-default location.
I have moved httpd.conf,
have added to the rc.conf
Also I have changed a line in a rc.d script /usr/local/etc/rc.d/apache24Code:apache24_enable="yes" apache24_flags=" -f /home/etc/httpd.conf"
Code:required_files=/home/etc/httpd.conf
In my opinion, it works!
Code:root@testjail:/home/backup # /usr/local/etc/rc.d/apache24 restart Starting apache24. AH00557: httpd: apr_sockaddr_info_get() failed for testjail.local AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message root@testjail:/home/backup # ps -auxww | grep httpd root 21018 0.0 0.1 17284 6004 - SsJ 13:27 0:00.03 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21019 0.0 0.1 17284 5892 - SJ 13:27 0:00.01 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21020 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21021 0.0 0.1 17284 5892 - SJ 13:27 0:00.01 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21022 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21023 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT
But if you like to run commands likehttpd -t
andhttpd -S
then add to the end of this command the line:
"-f /home/etc/httpd.conf"
root@testjail:/home/backup # httpd -S
httpd: Could not open configuration file /usr/local/etc/apache24/httpd.conf: No such file or directory
root@testjail:/home/backup # httpd -S -f /home/etc/httpd.conf
AH00557: httpd: apr_sockaddr_info_get() failed for testjail.local
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
ServerRoot: "/usr/local"
Main DocumentRoot: "/usr/local/www/apache24/data"
Main ErrorLog: "/var/log/httpd-error.log"
Mutex default: dir="/var/run/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www" id=80
Group: name="www" id=80
P.S.
Can you describe a reason for running apache with non-standart location?
In my opinion you are going to have misconfigured and heavy-upgradable configuration.
I think, running an apache with a minimal set of system files and libraries as a "freebsd jail" may be a better solution for the most cases;
Is your server running normally? Can you tell me what it's doing from beginning to end?I tried to build a clean environment with apache24,
and tried to run apache with httpd.conf in non-default location.
I have moved httpd.conf,
have added to the rc.conf
Also I have changed a line in a rc.d script /usr/local/etc/rc.d/apache24Code:apache24_enable="yes" apache24_flags=" -f /home/etc/httpd.conf"
Code:required_files=/home/etc/httpd.conf
In my opinion, it works!
Code:root@testjail:/home/backup # /usr/local/etc/rc.d/apache24 restart Starting apache24. AH00557: httpd: apr_sockaddr_info_get() failed for testjail.local AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message root@testjail:/home/backup # ps -auxww | grep httpd root 21018 0.0 0.1 17284 6004 - SsJ 13:27 0:00.03 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21019 0.0 0.1 17284 5892 - SJ 13:27 0:00.01 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21020 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21021 0.0 0.1 17284 5892 - SJ 13:27 0:00.01 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21022 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT www 21023 0.0 0.1 17284 5892 - SJ 13:27 0:00.00 /usr/local/sbin/httpd -f /home/etc/httpd.conf -DNOHTTPACCEPT
But if you like to run commands likehttpd -t
andhttpd -S
then add to the end of this command the line:
"-f /home/etc/httpd.conf"
root@testjail:/home/backup # httpd -S
httpd: Could not open configuration file /usr/local/etc/apache24/httpd.conf: No such file or directory
root@testjail:/home/backup # httpd -S -f /home/etc/httpd.conf
AH00557: httpd: apr_sockaddr_info_get() failed for testjail.local
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
ServerRoot: "/usr/local"
Main DocumentRoot: "/usr/local/www/apache24/data"
Main ErrorLog: "/var/log/httpd-error.log"
Mutex default: dir="/var/run/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/var/run/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www" id=80
Group: name="www" id=80
P.S.
Can you describe a reason for running apache with non-standart location?
In my opinion you are going to have misconfigured and heavy-upgradable configuration.
I think, running an apache with a minimal set of system files and libraries as a "freebsd jail" may be a better solution for the most cases;
apr_sockaddr_info_get() failed for host
is likely due to not having the correct hostname and IP in the /etc/hosts file or in DNS. what should i do to use "freebsd jail"?
What are you trying to do here? Why are you putting httpd.conf somewhere else? Just leave it at its default location; /usr/local/etc/apache24/httpd.conf.Did anyone move the location of apache24 files in freebsd? I did this, but the httpd.conf file
works on default location. What should I do?
I am sorry.This is an assignment. But I could not solve this. Thanks for "https://docs.freebsd.org/en/books/handbook/jails/[/URL]"Please don't post pictures of text. That makes it impossible for us to quote or copy/paste from it.
apr_sockaddr_info_get() failed for host
is likely due to not having the correct hostname and IP in the /etc/hosts file or in DNS.
![]()
Chapter 17. Jails and Containers
Jails improve on the concept of the traditional chroot environment in several waysdocs.freebsd.org
Go back to the beginning:
What are you trying to do here? Why are you putting httpd.conf somewhere else? Just leave it at its default location; /usr/local/etc/apache24/httpd.conf.
Prevent an XY problem and tell us exactly what you're trying to accomplish.