Change location problem

Hi there. 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? Sorry for my bad english:/
 
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.
 
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 edited /etc/rc.conf:
apache24_flags=" -f /home/etc/apache24/to/httpd.conf "
and
then like this:
apache24_flags=" -f /home/apache24/httpd.conf "
I restarted apache service, then new error occurred(but server worked):

service apache24 restart
/etc/rc.conf: apache24_flags: not found
/etc/rc.conf: apache24_flags: not found
Performing sanity check on apache24 configuration:
Syntax OK
Stopping apache24.
Waiting for PIDS: 1144.
Performing sanity check on apache24 configuration:
Syntax OK
Starting apache24.

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()
 
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.
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/).
What should I do?
Shoul I copy /usr/local/sbin/httpd to /home/sbin ?
 
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
Code:
apache24_enable="yes"
apache24_flags=" -f /home/etc/httpd.conf"
Also I have changed a line in a rc.d script /usr/local/etc/rc.d/apache24
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 like httpd -t and httpd -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;
 
thanks, but it does not work for me. Now I can not change anything on httpd.conf(in both places: /usr/local/etc/apache24/httpd.conf and /home/etc/apache24/httpd.conf. For example: location of index.html).
I started apache service, then new error occurred(but server worked):
2022-10-21 (15).png
 
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
Code:
apache24_enable="yes"
apache24_flags=" -f /home/etc/httpd.conf"
Also I have changed a line in a rc.d script /usr/local/etc/rc.d/apache24
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 like httpd -t and httpd -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;
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
Code:
apache24_enable="yes"
apache24_flags=" -f /home/etc/httpd.conf"
Also I have changed a line in a rc.d script /usr/local/etc/rc.d/apache24
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 like httpd -t and httpd -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?
 
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.

what should i do to use "freebsd jail"?

Go back to the beginning:
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?
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.
 
Why change the location of httpd.conf is very unclear to me.
Note : You can run apache on a different port in a jail. The httpd.conf is relative to the location of the jail.
 
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.



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.
I am sorry.This is an assignment. But I could not solve this. Thanks for "https://docs.freebsd.org/en/books/handbook/jails/[/URL]"
 
Back
Top