Thursday, May 9, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1993  / 3 Years ago, sat, may 8, 2021, 9:40:07

I just compiled apache (httpd-2.4.23) using these commands:



APACHE_CONFDIR=/etc/apache2
APACHE_ENVVARS=$APACHE_CONFDIR/envvars
CFLAGS="-O2 -DBIG_SECURITY_HOLE"

./configure --prefix=$APACHE_CONFDIR
make
make install


However, there are folders conf-enabled/conf-available/mods-available etc. missing. Do I do something wrong or is that some kind of new folder structure?



There are folders conf and modules



Also, there are no commands like a2ensite, a2enmod etc. in /usr/sbin and I can't find them anywhere. Thank you


More From » apache2

 Answers
7

A large part of what a distribution like Ubuntu does is to integrate a large number of different software from a multitude of different origins and combine them into a coherent system. To do that, in many cases the original software has to be adapted or extended.



That's the case with Apache. The whole *-available and *-enabled structure is not the Apache projects doing, so to speak, but part of how Debian integrated the Apache HTTPd into its distribution. Therefore, you'll find it in Debian and Debian-based distributions like Ubuntu, but not in the "original" Apache that you compiled yourself.



But it's not that hard to build those structures yourself. You basically need to create the folders yourself, and have Apache read the configs in there with the IncludeOptional directive in apache.conf. That's basically what the Debian version of apache.conf does:



...
# Include module configuration:
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
...
# Include generic snippets of statements
IncludeOptional conf-enabled/*.conf

# Include the virtual host configurations:
IncludeOptional sites-enabled/
...


The commands like a2ensite, a2enmod and so forth are also part of the Debian integration. In fact, most of those are symbolic links on a2enmod, which is a Perl script. All of them basically add (a2en*) or remove (a2dis*) the symbolic links from the respective *-available directory to the *-enabled directory. For example, a2ensite mysite.conf create a symlink in site-enabled/mysite.conf that refers to site-available/mysite.conf. And the sites-enabled directory can be integrated in apache.conf, as shown above.



So you can just create the symlinks yourself with ln -s, or you can write a little script in your language of choice to do that.


[#13001] Sunday, May 9, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
eaderitable

Total Points: 368
Total Questions: 117
Total Answers: 111

Location: Tuvalu
Member since Sat, Feb 11, 2023
1 Year ago
;